Controls container
From TrainzOnline
(Difference between revisions)
(→event) |
(→event) |
||
Line 27: | Line 27: | ||
====event==== | ====event==== | ||
:Type: text | :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 [[KIND Library|library]] or [[KIND Interior|interior]] (library/interior assets can specify a control set using the "controlset" tag). | + | :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 [[KIND Library|library]] or [[KIND Interior|interior]] asset (library/interior assets can specify a control set using the "controlset" tag). If trigger-on-up is specified Message.minor will be set to "<event>-up" when the key is released. |
====default-keys==== | ====default-keys==== |
Revision as of 15:27, 19 October 2011
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 trigger-on-up is specified 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".
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.