Plan for platform-specific button names

Jump to: navigation, search

This is not yet a fully-formed plan, it is just some ideas.

It would be really nice if there was a way for text boxes and strings to refer to the name of a control button in a generic way that could display differently depending on what platform the game is being played on.

Text insert codes[edit]

We could use codes like ${B0} ${B1} to insert the appropriate button name into text boxes and strings.

This is Not Button Remapping[edit]

This is not button remapping, and a plan for button remapping might need to handle this issue differently.

A Simple Plan[edit]

Perhaps it is safest to think of this purely in terms of platform-specific text-strings, and to avoid even thinking about button mapping and scancodes.

Imagine a reload lump like this:

  • buttonnames - parent node
    • code int - zero or more nodes. the value is the id code id number
      • keyboard string - default string value for this code on Mac/Windows/Linux and anything that doesn't fit into another category
      • ouya string - if this node is present it contains the string used if the platform is ouya. We do NOT make this generic to all consoles because other consoles name their buttons differently.

These codes can be inserted into text boxes with something like ${B0} ${B1} ${B2} and so-on.

The game author can be presented with an editor for these codes, and it is up to them to decide what they mean in the context of their own game. Game authors who don't care about cross-platform stuff, or don't have any tutorial text in their game do not need to bother with them. They will be pre-filled with reasonable defaults

platform detection plotscript[edit]

I have never really wanted a platform detection plotscripting command, and would prefer to avoid adding one, but any mechanism for platform-specific text strings could be easily hacked into a platform detection script. I dislike spit-and-duct-tape platform detection even more strongly than I dislike a standard official supported platform detection command, so if any part of this plan is implemented, it might be best to just expose the platform-detection mechanism to plotscripting. This provides a chance to make it uniform and simple, and provides a good place to put documentation warning people to play carefully with it

See Also[edit]