Skip to content

Commit c3918dc

Browse files
authored
Merge pull request #596 from bosh/high_score_tags
add switch tag information for 0.80 high_score mode text_input binding support
2 parents c529774 + 677f349 commit c3918dc

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed

docs/config/instructions/tags.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,18 @@ For the full reference of Ball Device tags, see [ball_devices:tags](../ball_devi
171171

172172
### Switch Tags
173173

174-
Switches in particular have a wide variety of built-in behaviors provided by MPF. Features such as flipper cancel and automatic ball detection on playfields will automatically work if you include these tags. To see the full reference, visit [switches:tags](../switches.md#tags).
174+
Switches in particular have a wide variety of built-in behaviors provided by MPF.
175+
Features such as flipper cancel, automatic ball detection on playfields,
176+
and high_score text input selection will automatically work
177+
if you include the appropriate tags on your switch configurations.
178+
To see the full reference, visit [switches:tags](../switches.md#tags).
175179

176180
### Playfield Tags
177181

178-
If your game has a single playfield, it should have the tag "default" set in its config. If your game has multiple playfields, one of them will need to be tagged as default - usually it will be the one that the plunger lane most frequently ejects to. See: [playfields:tags](../playfields.md#tags).
182+
If your game has a single playfield, it should have the tag "default" set in its config.
183+
If your game has multiple playfields, one of them will need to be tagged as default -
184+
usually it will be the one that the plunger lane most frequently ejects to.
185+
See: [playfields:tags](../playfields.md#tags).
179186

180187

181188
## Using `*` for a catch all

docs/config/switches.md

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ consumed by something, e.g. `light_player` or if `debug:true` is defined
269269
for them. They will be posted regardless of the `debug` setting, it is
270270
only a question of visibility in the `mpf monitor`.
271271

272+
#### Built-in Tags
273+
272274
Special-purpose tags for switches include:
273275

274276
* `playfield_active` - This tag should be used for all switches on the
@@ -285,15 +287,52 @@ Special-purpose tags for switches include:
285287
(Note that in MPF, the game start process is kicked off when this
286288
switch is released, not pressed, which allows the "time held down"
287289
to be sent to MPF to perform alternate game start actions.) See: [Start Button](../tutorial/9_start_button.md).
290+
With MPF 0.80, the `start` tag is used by the high_score mode to select a letter or submit the name text.
288291
* `left_flipper` and `right_flipper` - MPF will provide automatic [flipper_cradle](../events/flipper_cradle.md)
289292
and [flipper_cancel](../events/flipper_cancel.md) events if your cabinet flipper buttons are tagged with
290-
their respective flippers.
293+
their respective flippers. With MPF 0.80, the built-in high_score mode and slide hook onto these two flipper tags
294+
to control character selection and submission.
295+
296+
#### Tags for optional built-in modes
297+
298+
Some of the default modes included with MPF include switch tag hooks so that it is easy for you to incorporate features into your game.
299+
300+
##### Tilt Mode
301+
302+
MPF's default tilt mode supports both slam tilt and plumb-bob tilt detection, either or both tags may be used.
303+
See: [Tilt](../game_logic/tilt/index.md)
304+
305+
* `tilt_warning` - This is added to a plumb-bob style tilt switch.
306+
* `slam_tilt` - This is added to a slam tilt type switch.
307+
308+
##### High Score Mode
309+
310+
(*tag support new in MPF 0.80*)
311+
312+
The built-in [high_score mode](../game_logic/high_scores/index.md) in MPF 0.80 and high_score slide in GMC allow players
313+
to select letters and submit their high score via use of an [MPFTextInput](../gmc/reference/mpf-text-input.md) in Godot.
314+
315+
* `left_flipper` and `right_flipper` - These tags are reused by the high score text input to move
316+
the highlighted item left or right
317+
* `start` - The start tag is reused by the high score mode to select the highlighted item
318+
319+
##### Service Mode
320+
321+
The Service Mode code included with MPF is intended for four-button service doors
322+
and has support for coin door detection and other features. The way this works is
323+
through a variety of tags, including the re-use of some existing tags.
324+
See: [Service Mode](../game_logic/service_mode.md)
325+
291326
* `service_esc`, `service_down`, `service_up`, and `service_enter` - When using the builtin
292327
Service Mode, you will want to tag four different switches with these tags so the
293-
operator can use the interface without keyboard or mouse access. See: [Service Mode](../game_logic/service_mode.md)
294-
* `service_door_open` - This is used for the coin door switch to manage the service mode. See: [Service Mode](../game_logic/service_mode.md)
295-
* `tilt_warning` - This is added to a plumb-bob style tilt switch. See: [Tilt](../game_logic/tilt/index.md)
296-
* `slam_tilt` - This is added to a slam tilt type switch. See: [Tilt](../game_logic/tilt/index.md)
328+
operator can use the interface without keyboard or mouse access.
329+
* `service_door_open` or `service_door_closed` - Service mode will hook into
330+
the open or closed detection behavior of your coin door switch if you include
331+
one of these tags. Only one is necessary, but both are available depending on
332+
whether your switch is normally open or normally closed.
333+
* `start`, `left_flipper`, and `right_flipper` - Service mode will reuse these three tags
334+
that you likely already had defined for other machine features. (See section above.)
335+
297336

298337
## Monitorable Properties
299338

docs/gmc/reference/mpf-text-input.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,22 @@ If no settings are provided, the `character_appearance` will be applied to the s
8585

8686
## Events and MPF Integration
8787

88-
To control the on-screen keyboard from the pinball machine, an `event_player` must be setup that sends the event *"text_input"* with an appropriate `action` value (one of "left", "right", or "select").
88+
The MPFTextInput included in the default [high_score mode](../../game_logic/modes/high_score.md) has event controls already defined.
89+
These included event_player bindings use the standard flipper and start tags to control the input. If you are adding an MPFTextInput on your own
90+
to some other slide, or if you want to add more buttons to control the selected items on the high score slide,
91+
you will need to create a way to post *`text_input`* events with the appropriate `action` value.
92+
93+
For example, to allow more switches to control the on-screen keyboard, you could define an `event_player` that sends the event *"text_input"* with one of the three supported `action` values ("left", "right", or "select").
8994

9095
``` yaml
9196
event_player:
92-
s_flipper_left_active:
97+
s_my_additional_left_control_active:
9398
text_input:
9499
action: left
95-
s_flipper_right_active:
100+
s_my_additional_right_control_active:
96101
text_input:
97102
action: right
98-
s_start_button_active:
103+
s_another_select_button_active:
99104
text_input:
100105
action: select
101106
```

0 commit comments

Comments
 (0)