Index

SetUnitUIText

SetUnitUIText(<-unit <-slot <-text)

Description

Sets the string UI text 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 text.
For the Label and Button widgets the text is what is shown on the widget.
For the Flip and Choice widget, the text is the label and the value is controlled by the state.
To change the text for the options in a choice widget, see SetUnitUIOptions.

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

:NOTE:
Many formats are supported in the UI text such as <color> though they will only work if closed.
Line break formats are one of the few which will fail. To create a line break, add a line break via pressing ENTER to create a new line (see 2nd example) or concat LF (3rd example).
<br>, \n, and CR will fail to create a line break.

Examples

SetUnitUIText(self 0 "<color=#FFFF00>Sample Colored Text</color>")
SetUnitUIText(self 0 "Sample Text
New line text
Third line text")
SetUnitUIText(self 0 Concat3("Sample Text" LF "New line text"))

Index