Event Properties
This is the full reference for all event properties and the options available on them.
The name
attribute is omitted here for brevity but still required on all properties
(except Text
and Icon
), as described in Logic.
Picker
<Picker mode="All" />
Allows the player to pick an object on the map.
mode
(PickMode) (required): What objects can be picked by the player. Can beEntity
,Zone
,All
, orNone
.
TextInput
<TextInput title="Some Text" maxChars="8" default="test" />
A simple text input field.
title
(String) (required): Title to display next to the text field.maxChars
(Integer) (optional): How many chars to allow in the text field. Default is 6default
(String) (optional): Default text to display in the text field. Default is empty.
C#: Modding.EventProperty.TextInput
Access the entered text using the Text
property.
Text
can also be set to a new value.
NumberInput
<NumberInput
title="Some Number" maxChars="5"
prefix="$" suffix="k"
decimals="3" maxDecimals="3"
splitThousands="false" negativeNumbers="false"
maxValue="20" minValue="5" />
A simple number input field that supports numbers with or without decimals.
title
(String) (required): Title to display next to the number field.maxChars
(Integer) (optional): How many chars to allow in number field. Default is 6prefix
(String) (optional): A prefix to always display in front of the entered number. Default is empty.suffix
(String) (optional): A suffix to always display behind the entered number. Default is empty.decimals
(Integer) (optional): How many decimal places to display by default. Default is 2.maxDecimals
(Integer) (optional): How many decimal places to allow maximally. Default is 2.splitThousands
(Boolean) (optional): Whether to display a character to split thousands. Default is false.negativeNumbers
(Boolean) (optional): Whether to allow negative numbers. Default is true.maxValue
(Float) (optional): Largest value that may be entered. Default is +Infinity (i.e. no limit).minValue
(Float) (optional): Smallest value that may be entered. Default is -Infinity (i.e. no limit).
C#: Modding.EventProperty.NumberInput
Access the entered number using the Value
property.
Value
can also be set to a new value.
Choice
<Choice default="1">
<Option index="0">Destroy</Option>
<Option index="1">Deactivate</Option>
</Choice>
Allows the player to choose one of multiple options.
default
(Integer) (optional): Index of the option that should be selected by default. Default is 0.
Option
child elements:
index
(Integer) (optional): If oneOption
element has an index specified, all options in the sameChoice
are also required to have it. In the absence ofindex
attributes, the indices are determined by order. Options are displayed in the order in which they are listed, but they are saved using the indices. Manually specifying the indices allows preserving backwards-compatibility when adding new options or reordering them.
C#: Modding.EventProperty.Choice
A little care is required accessing the state of a Choice
property:
It exposes two relevant properties: CurrentIndex
and Options
.
CurrentIndex
is only an index into the Options
array, it does not correspond to the
indices specified using the index
attributes!
Options
is an array of Choice.Option
objects that represent each possible value.
Each Option
has a Text
and an Index
property. These are the indices from the XML
declaration.
Toggle
<Toggle default="true">
<Icon name="some-icon-texture-name" />
</Toggle>
A simple on-off toggle with an icon.
default
(Boolean) (optional): Default value of the toggle. Default is false.Icon
(Texture) (required): What texture to display on the toggle. See Common Elements on how to useTexture
elements.
C#: Modding.EventProperty.Toggle
Access the state of the toggle using the Value
property.
Value
can also be set to a new value.
Text
Text fontSize="0.3">Some Text:</Text>
Displays some text in the properties window. Not editable by the player and not passed to the callback.
The name
attribute can be omitted here because it is impossible to interact with a Text
.
fontSize
(Float) (optional): Size of the text. Default is 0.15
C#: Modding.EventProperty.Text
Not exposed through the callbacks, not possible to interact with.
Icon
<Icon> <Icon name="some-icon-texture-name" /> </Icon>
Displays an icon in the properties window. Not editable by the player and not passed to the callback.
The name
attribute can be omitted here because it is impossible to interact with an Icon
.
Icon
(Texture) (required): What texture to display. See Common Elements on how to useTexture
elements.
C#: Modding.EventProperty.Icon
Not exposed through the callbacks, not possible to interact with.