GetText

string GetText(string description, [int input], [bool returnBlank]) string GetText(int index, [int input], [bool returnBlank])

Parameters

description: The name/description of the action you want to get the text for. index: The index number of the action you want to get the text for. input: Which input you want to get the text for. returnBlank: Whether or not "None" should return an empty string. Defaults to false.

Description

Returns the text of the input used for the action. This is useful for making custom UIs.

Possible valid values for input are 0, 1, and 2.

  • Passing in 0 will return the description of the action.

  • Passing in 1 will return the name of the primary input assigned to the action.

  • Passing in 2 will return the name of the secondary input assigned to the action.

Note that input is optional, and if omitted will default to 0 if you use the index as the first parameter of GetText(). It will default to 1 if you use the description as the first parameter of GetText().

If no input is assigned to the action (as may often be the case with secondary inputs), then GetText() will return "None" by default, or it will return an empty string if returnBlank is true.

See the Making a Custom GUI Menu section for more details on how and why you might want to use GetText().

Example

Last updated