Controls container
From TrainzOnline
(Difference between revisions)
(→event) |
(→default-keys) |
||
Line 32: | Line 32: | ||
:Type: text | :Type: text | ||
:Desc: A comma separated list of the default keys to map to this control. Use "null" if no default keys are to be set, if multiple keys are required separate the keys with a space, e.g. "shift n". | :Desc: A comma separated list of the default keys to map to this control. Use "null" if no default keys are to be set, if multiple keys are required separate the keys with a space, e.g. "shift n". | ||
+ | :To note : default-keys are only available for built-in objects (source : Mr Windwalker himself !). For customized controlset, the hotkey should be defined via Start Trainz\Menu\Settings\Control Settings | ||
====context==== | ====context==== |
Revision as of 00:00, 7 April 2017
The controls container is a top-level config.txt file entry used by controlset assets.
The controls container is a list of control subcontainers with no standalone tags. Each control subcontainer uses the following format.
Contents |
Supported Tags
Each control subcontainer supports the following tags. Each tag is shown here with its default value.
name-token "" desc-token "" event "" default-keys "" context "" reassignable 1 trigger-on-up 0 trigger-on-down 1 trigger-on-held 1
name-token
- Type: text
- Desc: The name of a string table entry with the user visible name of the control in it. This string table entry will be used in the Trainz user interface to refer to the control. It should be very short.
desc-token
- Type: text
- Desc: The name of a string table entry with the user visible description of the control in it. This string table entry will be used in the Trainz user interface to give detail to the user about the control. It should be fairly short. Optional.
event
- Type: text
- Desc: The name of the event to trigger when the control is triggered. A script message of the format ("ControlSet", <event>) will be posted to any linked library or interior asset (library/interior assets can specify a control set using the "controlset" tag). If the 'trigger-on-up' tag is set to true 'Message.minor' will be set to "<event>-up" when the key is released.
default-keys
- Type: text
- Desc: A comma separated list of the default keys to map to this control. Use "null" if no default keys are to be set, if multiple keys are required separate the keys with a space, e.g. "shift n".
- To note : default-keys are only available for built-in objects (source : Mr Windwalker himself !). For customized controlset, the hotkey should be defined via Start Trainz\Menu\Settings\Control Settings
context
- Type: text
- Desc: A semicolon separated list of contexts under which the control should be active, e.g. "surveyor;driver".
- Possible values: menu, surveyor, surveyor-topology, surveyor-paint, surveyor-objects, surveyor-track, surveyor-trains, surveyor-tools, surveyor-layers, driver, driver-cab, driver-cab-steam, driver-dcc, railyard
reassignable
- Type: bool
- Desc: Whether the control supports player reassignment in the options menus.
trigger-on-up
- Type: bool
- Desc: Whether the control event should trigger on key up.
trigger-on-down
- Type: bool
- Desc: Whether the control event should trigger on key down.
trigger-on-held
- Type: bool
- Desc: Whether the control event should repeatedly trigger while a key remains held.
Example controls container
See controlset.