Hardware-controls-list container

From TrainzOnline
Revision as of 16:11, 22 November 2017 by Pw3r (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The hardware-controls-list container is a config.txt file entry used by the controls tag in the controller-device-list container for tni-controls-plugin assets. It provides the specification for an individual control on a hardware device (e.g. the throttle lever on a RailDriver device).

Contents

Supported Tags

The hardware-controls-list container is a list of hardware-control subcontainers with no standalone tags. Each hardware-control subcontainer supports the following tags.

 name-token
 desc-token
 type

name-token

Type: string
Desc: The id of a string-table entry for the localised name of the control. This string table entry will be used in the Trainz UI to refer to the control. It should be very short (i.e. one or two words).

desc-token

Type: string
Desc: The id of a string-table entry for the localised description of the control. This string table entry will be used in the Trainz UI to give detail to the player about the control. It should be fairly short (i.e. one short sentence), and is best omitted for anything other than complex controls.

type

Type: hardware-control-type (hardware-control-types.txt)
Desc: Specifies the 'type' of this control, as follows:
  • lever- A single axis lever control, like a RailDriver throttle, or some kind of slider.
  • button - A button control, which will send input events for pressed, released and held, identically to a key on a keyboard.
  • switch- A switch control, this is identical to a button except it has no 'held' behaviour.

Note that all of these controls support analog input in the range of 0 to 1. Controls with two or more dimensions of movement may be specified by using multiple controls. For example, a joystick/thumbstick can be represented as two levers, one for each axis. See the TNIControls documentation for more information about control input.

Example container

See tni-controls-plugin.

Categories

Personal tools