User Tools

Site Tools


4rpl:commands:getunituistate

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

4rpl/commands/getunituistate.txt · Last modified: 2021/01/24 14:48 by Sanian