Class: UIStyleManager
UI style manager binding.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Source
C++ class UIStyleManager
Custom Constructor
UIStyleManager
Remarks
Use GetUIStyleManager() to access the engine singleton. Style changes may require UI reload to affect existing windows. Available styles are discovered from UI style folders at startup.
Methods
DefaultStyleIsSet()
DefaultStyleIsSet(): boolean;Check whether the default UI style is active.
Returns
boolean
Whether the default style is set.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
GetAllStyles()
GetAllStyles(): LuaIterable<token>;Iterate over available UI styles.
Returns
LuaIterable<token>
Style tokens.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Remarks
The returned value is a Lua iterator over engine style tokens. The default style is always present.
GetCurrentStyleId()
GetCurrentStyleId(): number;Get the active UI style id.
Returns
number
Current style id.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
GetCurrentStyleName()
GetCurrentStyleName(): string;Get the active UI style name.
Returns
string
Current style name.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
ResetUI()
ResetUI(): void;Reset cached UI style data.
Returns
void
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Remarks
Runs the engine UI reset sequence. It does not change the current style id by itself.
SetStyle()
Call Signature
SetStyle(name: string, reload_ui?: boolean): boolean;Switch to a UI style by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Style name. |
reload_ui? | boolean | Whether to reload UI after switching. |
Returns
boolean
Whether the style was applied.
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Remarks
Pass reload_ui to run the engine UI reset sequence after switching. Unknown names return false.
Call Signature
SetStyle(id: number, reload_ui?: boolean): void;Switch to a UI style by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Style id. |
reload_ui? | boolean | Whether to reload UI after switching. |
Returns
void
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Deprecated
Use UIStyleManager.SetupStyle; the engine binding accepts names in SetStyle.
SetupStyle()
SetupStyle(id: number): void;Switch to a UI style by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Style id. |
Returns
void
Since
OpenXRay 2023-03-31, 8c4f1500, PR #1114
Remarks
Use an id from GetAllStyles. Unknown ids are accepted here, but later style-name lookup can fail native verification.