Class: CUIScriptWnd
UI binding for CUIScriptWnd.
Source
C++ class CUIScriptWnd : CUIDialogWnd,DLL_Pure
Custom Constructor
CUIScriptWnd
Remarks
Register child controls before adding callbacks or using typed lookup helpers.
Extends
Constructors
Constructor
new CUIScriptWnd(): CUIScriptWnd;Create a script-driven dialog window.
Returns
CUIScriptWnd
Overrides
Methods
AddCallback()
AddCallback(
name: string,
event: number,
cb: (this: void) => void,
source?: CUIWindow): void;Register a named UI callback.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Control name. |
event | number | UI event id. |
cb | (this: void) => void | Callback function. |
source? | CUIWindow | Optional callback owner. |
Returns
void
Remarks
The callback is matched by control name and event. Register the target control first so its window name and message target are set on this script window.
AttachChild()
AttachChild(child: CUIWindow): void;Attach a child window.
Parameters
| Parameter | Type | Description |
|---|---|---|
child | CUIWindow | Child window. |
Returns
void
Remarks
The Lua binding adopts child; after attachment, treat the parent as owning its lifetime.
Inherited from
DetachChild()
DetachChild(child: CUIWindow): void;Detach a child window.
Parameters
| Parameter | Type | Description |
|---|---|---|
child | CUIWindow | Child window. |
Returns
void
Remarks
Detaching removes the parent relation. It does not reinitialize the window or attach it elsewhere.
Inherited from
Dispatch()
Dispatch(command: number, parameter: number): boolean;Dispatch a UI command.
Parameters
| Parameter | Type | Description |
|---|---|---|
command | number | Command id. |
parameter | number | Command parameter. |
Returns
boolean
Whether the command was handled.
Remarks
Used for dialog command routing. Return true only when the command was handled.
Enable()
Enable(is_enabled: boolean): void;Enable or disable interaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether the window should be enabled. |
Returns
void
Remarks
Enabled state and visibility are separate. Hidden controls can still be enabled.
Inherited from
FocusReceiveTime()
FocusReceiveTime(): number;Returns
number
Level time when this window received focus.
Inherited from
GetAbsoluteRect()
GetAbsoluteRect(): Frect;Returns
Window rectangle in screen coordinates.
Inherited from
GetDialogWnd()
GetDialogWnd(id: string): Nullable<CUIDialogWnd>;Find a dialog window by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIDialogWnd>
Control instance, or null when not found or not matching.
GetEditBox()
GetEditBox(id: string): Nullable<CUIEditBox>;Find an edit box by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIEditBox>
Control instance, or null when not found or not matching.
GetFont()
GetFont(): CGameFont;Get the font assigned to this window.
Returns
Font assigned to this window.
Remarks
Text controls need a font assigned before drawing custom text reliably.
Inherited from
GetFrameLineWnd()
GetFrameLineWnd(id: string): Nullable<CUIFrameLineWnd>;Find a frame line by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIFrameLineWnd>
Control instance, or null when not found or not matching.
GetFrameWindow()
GetFrameWindow(id: string): Nullable<CUIFrameWindow>;Find a frame window by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIFrameWindow>
Control instance, or null when not found or not matching.
GetHeight()
GetHeight(): number;Returns
number
Window height.
Inherited from
GetHolder()
GetHolder(): CDialogHolder;Get the dialog holder.
Returns
Dialog holder.
Remarks
The holder is available only after the dialog is assigned to one by the owning UI flow.
Inherited from
GetListBox()
GetListBox(id: string): Nullable<CUIListBox<CUIListBoxItem>>;Find a list box by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIListBox<CUIListBoxItem>>
Control instance, or null when not found or not matching.
GetListWnd()
GetListWnd(id: string): Nullable<CUIListWnd>;Find a list window by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIListWnd>
Control instance, or null when not found or not matching.
GetMouseX()
GetMouseX(): number;Get cursor X coordinate stored on this window.
Returns
number
Current cursor X coordinate.
Since
OpenXRay 2026-01-01, e3b0e3c5, PR #2028
Source
src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseX binding.
Inherited from
GetMouseY()
GetMouseY(): number;Get cursor Y coordinate stored on this window.
Returns
number
Current cursor Y coordinate.
Since
OpenXRay 2026-01-01, e3b0e3c5, PR #2028
Source
src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseY binding.
Inherited from
GetProgressBar()
GetProgressBar(id: string): Nullable<CUIProgressBar>;Find a progress bar by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIProgressBar>
Control instance, or null when not found or not matching.
GetStatic()
GetStatic(id: string): Nullable<CUIStatic>;Find a static control by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUIStatic>
Control instance, or null when not found or not matching.
GetTabControl()
GetTabControl(id: string): Nullable<CUITabControl>;Find a tab control by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Window id. |
Returns
Nullable<CUITabControl>
Control instance, or null when not found or not matching.
GetWidth()
GetWidth(): number;Returns
number
Window width.
Inherited from
GetWndPos()
GetWndPos(): vector2;Returns
Window position relative to its parent.
Inherited from
HideDialog()
HideDialog(): void;Hide the dialog.
Returns
void
Inherited from
Init()
Call Signature
Init(frect: Frect): void;Initialize window rectangle.
Parameters
| Parameter | Type | Description |
|---|---|---|
frect | Frect | Window rectangle. |
Returns
void
Inherited from
Call Signature
Init(
x1: number,
y1: number,
x2: number,
y2: number): void;Initialize window rectangle.
Parameters
| Parameter | Type | Description |
|---|---|---|
x1 | number | X position. |
y1 | number | Y position. |
x2 | number | Width. |
y2 | number | Height. |
Returns
void
Remarks
Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.
Inherited from
IsAutoDelete()
IsAutoDelete(): boolean;Returns
boolean
Whether the engine owns and deletes this window with its parent.
Inherited from
IsCursorOverWindow()
IsCursorOverWindow(): boolean;Returns
boolean
Whether the UI cursor is currently over this window.
Inherited from
CUIDialogWnd.IsCursorOverWindow
IsEnabled()
IsEnabled(): boolean;Returns
boolean
Whether the window accepts interaction.
Inherited from
IsShown()
IsShown(): boolean;Returns
boolean
Whether the window is visible.
Inherited from
Load()
Load(value: string): boolean;Load a UI section or XML resource.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | Resource or section name. |
Returns
boolean
Whether the load succeeded.
Remarks
The base CUIScriptWnd binding accepts the value but always reports success. Real loading is usually done by XML helper code before controls are registered.
OnKeyboard()
OnKeyboard(key: TXR_DIK_key, event: TXR_ui_event): boolean;Handle keyboard input.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | TXR_DIK_key | DIK key code. |
event | TXR_ui_event | UI keyboard event. |
Returns
boolean
Whether the event was handled.
Remarks
Called by the dialog holder/input stack. Return true only when the script window handled the key.
Register()
Register(window: CUIWindow, name?: string): void;Register a child window for lookup and callbacks.
Parameters
| Parameter | Type | Description |
|---|---|---|
window | CUIWindow | Child window. |
name? | string | Optional registration name. |
Returns
void
Remarks
Registration sets this script window as the child's message target. When name is provided, it also replaces the child's window name used by callback matching and typed lookup.
ResetPPMode()
ResetPPMode(): void;Disable post-process mode for this window.
Returns
void
Remarks
Pair with CUIWindow.SetPPMode when a window no longer needs post-process rendering.
Inherited from
SetAutoDelete()
SetAutoDelete(auto_delete: boolean): void;Set whether the parent owns this child window.
Parameters
| Parameter | Type | Description |
|---|---|---|
auto_delete | boolean | Whether the engine should delete the child automatically. |
Returns
void
Remarks
Use this for script-created windows that are attached to a parent and should be cleaned up with the UI tree.
Inherited from
SetFont()
SetFont(font: CGameFont): void;Set the font used by this window.
Parameters
| Parameter | Type | Description |
|---|---|---|
font | CGameFont | Font object. |
Returns
void
Inherited from
SetHeight()
SetHeight(height: number): void;Set window height.
Parameters
| Parameter | Type | Description |
|---|---|---|
height | number | New height. |
Returns
void
Inherited from
SetHolder()
SetHolder(holder: CDialogHolder): void;Assign a dialog holder.
Parameters
| Parameter | Type | Description |
|---|---|---|
holder | CDialogHolder | Dialog holder. |
Returns
void
Inherited from
SetPPMode()
SetPPMode(): void;Enable post-process mode for this window.
Returns
void
Remarks
Use for windows meant to be drawn through the post-process UI path, and reset it when the window returns to normal UI rendering.
Inherited from
SetWidth()
SetWidth(width: number): void;Set window width.
Parameters
| Parameter | Type | Description |
|---|---|---|
width | number | New width. |
Returns
void
Inherited from
SetWindowName()
SetWindowName(name: string): void;Set debug/window name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Window name. |
Returns
void
Inherited from
SetWndPos()
Call Signature
SetWndPos(vector2: vector2): void;Set window position.
Parameters
| Parameter | Type | Description |
|---|---|---|
vector2 | vector2 | New position. |
Returns
void
Inherited from
Call Signature
SetWndPos(x1: number, y1: number): void;Set window position.
Parameters
| Parameter | Type | Description |
|---|---|---|
x1 | number | X position. |
y1 | number | Y position. |
Returns
void
Inherited from
SetWndRect()
Call Signature
SetWndRect(rect: Frect): void;Set window rectangle.
Parameters
| Parameter | Type | Description |
|---|---|---|
rect | Frect | New rectangle. |
Returns
void
Inherited from
Call Signature
SetWndRect(
x1: number,
y1: number,
x2: number,
y2: number): void;Set window rectangle.
Parameters
| Parameter | Type | Description |
|---|---|---|
x1 | number | X position. |
y1 | number | Y position. |
x2 | number | Width. |
y2 | number | Height. |
Returns
void
Remarks
Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.
Inherited from
SetWndSize()
Call Signature
SetWndSize(vector2: vector2): void;Set window size.
Parameters
| Parameter | Type | Description |
|---|---|---|
vector2 | vector2 | New size. |
Returns
void
Inherited from
Call Signature
SetWndSize(width: number, height: number): void;Set window size.
Parameters
| Parameter | Type | Description |
|---|---|---|
width | number | New width. |
height | number | New height. |
Returns
void
Inherited from
Show()
Show(show: boolean): void;Show or hide the window.
Parameters
| Parameter | Type | Description |
|---|---|---|
show | boolean | Whether the window should be visible. |
Returns
void
Remarks
Visibility does not attach, detach, enable, or disable the window.
Inherited from
ShowDialog()
ShowDialog(show: boolean): void;Show or hide the dialog.
Parameters
| Parameter | Type | Description |
|---|---|---|
show | boolean | Whether the dialog should be visible. |
Returns
void
Inherited from
Update()
Update(): void;Update the script window.
Returns
void
WindowName()
WindowName(): string;Returns
string
Window name.
Inherited from
Properties
__name
readonly __name: string;LuaBind instance constructor name.
Inherited from
__name
readonly static __name: string;LuaBind class constructor name.