User Tools

Site Tools


4rpl:commands:setunituioptions

This is an old revision of the document!


Index

SetUnitUIOptions

SetUnitUIOptions(<-unit <-slot <-optionsList)

Description

Sets the options 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. For the Label and Button widgets the options have no effect.
For the Flip and Choice widget, the options are the values shown in the ui widget.

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

:WARNING: Changes set by this API do not persist between saves. You will have to apply this API in :Gameloaded to prevent errors.
Theorized erros are:

  • Flip widgets for the unit using this API will change states visually but not internally. When you have a flip widget as “ON/OFF” and its currently “OFF” (state 1), when this API is used, it will still say “OFF” but is actually “ON” (state 0).
  • Other choice widgets that are not set via this API, get wiped. Example: Choice: “1,2,3,4,5” is in widget 3 in the CPACK settings, widget 2, choice, is set by this API. After gameload, that widget becomes: “”.

:NOTE: Advanced investigation not done on this.

Examples

   SetUnitUIOptions(self 0 ListN("Larry" "Moe" "Curly" 3))

Index

4rpl/commands/setunituioptions.1724531749.txt.gz · Last modified: 2024/08/24 16:35 by Vertu