Skip to content

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()

ts
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()

ts
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()

ts
GetCurrentStyleId(): number;

Get the active UI style id.

Returns

number

Current style id.

Since

OpenXRay 2023-03-31, 8c4f1500, PR #1114


GetCurrentStyleName()

ts
GetCurrentStyleName(): string;

Get the active UI style name.

Returns

string

Current style name.

Since

OpenXRay 2023-03-31, 8c4f1500, PR #1114


ResetUI()

ts
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

ts
SetStyle(name: string, reload_ui?: boolean): boolean;

Switch to a UI style by name.

Parameters
ParameterTypeDescription
namestringStyle name.
reload_ui?booleanWhether 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

ts
SetStyle(id: number, reload_ui?: boolean): void;

Switch to a UI style by id.

Parameters
ParameterTypeDescription
idnumberStyle id.
reload_ui?booleanWhether 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()

ts
SetupStyle(id: number): void;

Switch to a UI style by id.

Parameters

ParameterTypeDescription
idnumberStyle 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.