This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:setunituitext [2022/10/25 12:41] – Formatting note and line breaking method provided Vertu | 4rpl:commands:setunituitext [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== Description ===== | ===== 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. | + | 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. | + | 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 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.\\ | 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 [[4rpl: | ||
\\ | \\ | ||
Note that this call only works on custom units. | Note that this call only works on custom units. | ||
:NOTE:\\ | :NOTE:\\ | ||
- | All formats | + | Many formats |
- | To create a line break, add a line break via pressing ENTER to create a new line (see 2nd example). <br> and [[4rpl: | + | 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 [[4rpl: |
+ | <br>, \n, and [[4rpl: | ||
===== Examples ===== | ===== Examples ===== | ||
<code 4rpl> | <code 4rpl> | ||
- | SetUnitUIText(self 0 " | + | SetUnitUIText(self 0 "< |
</ | </ | ||
<code 4rpl> | <code 4rpl> | ||
Line 29: | Line 31: | ||
New line text | New line text | ||
Third line text") | Third line text") | ||
+ | </ | ||
+ | <code 4rpl> | ||
+ | SetUnitUIText(self 0 Concat3(" | ||
</ | </ | ||
< | < | ||