Index

GetUnitUIState

GetUnitUIState(<-unit <-slot) ->state

Description

Gets the integer UI state for a given UI control slot. Custom units can have UI configuration widgets. These are configured in the CPack manager. Each widget occupies a slot, 0-7. Each widget also has a state. For the Label and Button widgets the state is always '0'. For the FlipButton widget, the state is 0 or 1. For the Choice widget the state is 0-N based on the number of choice items configured.

Note that this call only works on custom units. If used on a built in unit, it will return 0.

Examples

#:_UICALLBACK is called on any script (if present) whenever a UI widget is changed.
:_UICALLBACK
   #The _DATA is an int that points to the slot that was just changed
   GetUnitUIState(self <-_DATA) ->slotState
   printallsp("UICALLBACK: " <-slotState)

Index