Class: MockCUIListWnd
Mock generic list window.
Remarks
Item storage is real so that add/remove/selection behaviour can be asserted through the list state rather than through call arguments only. Note that unlike CUIListBox, selection getters return indexes, not items.
Extends
Implements
CUIListWnd
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
CUIListWnd.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockCUIListWnd(): MockCUIListWnd;Returns
MockCUIListWnd
Inherited from
Methods
GetHeight()
GetHeight(): number;Returns
number
Window height.
Implementation of
CUIListWnd.GetHeightInherited from
GetWidth()
GetWidth(): number;Returns
number
Window width.
Implementation of
CUIListWnd.GetWidthInherited from
OnKeyboard()
OnKeyboard(): boolean;Returns
boolean
Inherited from
Show()
Show(isShown: boolean): void;Show or hide the window.
Parameters
| Parameter | Type |
|---|---|
isShown | boolean |
Returns
void
Remarks
Visibility does not attach, detach, enable, or disable the window.
Implementation of
CUIListWnd.ShowInherited from
create()
static create(): MockCUIListWnd;Returns
MockCUIListWnd
Overrides
mock()
static mock(): CUIListWnd;Returns
CUIListWnd
Overrides
Properties
ActivateList
ActivateList: Mock<(flag: boolean) => void>;Activate or deactivate the list.
Param
flag
New active state.
Implementation of
CUIListWnd.ActivateListAddItem
AddItem: Mock<(item: CUIListItem) => boolean>;Add an item and transfer it to the list.
Remarks
The Lua binding adopts item; the list owns it after a successful add.
Param
item
Item to add.
Returns
Whether the item was added.
Implementation of
CUIListWnd.AddItemAttachChild
AttachChild: Mock<(window: CUIWindow) => void>;Attach a child window.
Remarks
The Lua binding adopts child; after attachment, treat the parent as owning its lifetime.
Param
child
Child window.
Implementation of
CUIListWnd.AttachChildInherited from
children
children: CUIWindow[] = [];Inherited from
DetachChild
DetachChild: Mock<(window: CUIWindow) => void>;Detach a child window.
Remarks
Detaching removes the parent relation. It does not reinitialize the window or attach it elsewhere.
Param
child
Child window.
Implementation of
CUIListWnd.DetachChildInherited from
Enable
Enable: Mock<(isEnabled: boolean) => void>;Enable or disable interaction.
Remarks
Enabled state and visibility are separate. Hidden controls can still be enabled.
Param
is_enabled
Whether the window should be enabled.
Implementation of
CUIListWnd.EnableInherited from
EnableScrollBar
EnableScrollBar: Mock<(enable: boolean) => void>;Enable or disable scrollbar.
Param
enable
Whether scrollbar should be enabled.
Implementation of
CUIListWnd.EnableScrollBarfocusedIndex
focusedIndex: number = -1;focusReceiveTime
focusReceiveTime: number = 0;Inherited from
MockCUIWindow.focusReceiveTime
FocusReceiveTime
FocusReceiveTime: Mock<() => number>;Returns
Level time when this window received focus.
Implementation of
CUIListWnd.FocusReceiveTimeInherited from
MockCUIWindow.FocusReceiveTime
GetAbsoluteRect
GetAbsoluteRect: Mock<() => Frect>;Returns
Window rectangle in screen coordinates.
Implementation of
CUIListWnd.GetAbsoluteRectInherited from
GetFocusedItem
GetFocusedItem: Mock<() => number>;Returns
Focused item index.
Implementation of
CUIListWnd.GetFocusedItemGetFont
GetFont: Mock<() => CGameFont>;Get the font assigned to this window.
Remarks
Text controls need a font assigned before drawing custom text reliably.
Returns
Font assigned to this window.
Implementation of
CUIListWnd.GetFontInherited from
GetItem
GetItem: Mock<(index: number) => CUIListItem>;Get an item by index.
Param
index
Item index.
Returns
List item.
Implementation of
CUIListWnd.GetItemGetItemPos
GetItemPos: Mock<(item: CUIListItem) => number>;Get item index.
Param
item
List item.
Returns
Item index.
Implementation of
CUIListWnd.GetItemPosGetMouseX
GetMouseX: Mock<() => number>;Get cursor X coordinate stored on this window.
Since
OpenXRay 2026-01-01, e3b0e3c5, PR #2028
Source
src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseX binding.
Returns
Current cursor X coordinate.
Implementation of
CUIListWnd.GetMouseXInherited from
GetMouseY
GetMouseY: Mock<() => number>;Get cursor Y coordinate stored on this window.
Since
OpenXRay 2026-01-01, e3b0e3c5, PR #2028
Source
src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseY binding.
Returns
Current cursor Y coordinate.
Implementation of
CUIListWnd.GetMouseYInherited from
GetSelectedItem
GetSelectedItem: Mock<() => number>;Returns
Selected item index.
Implementation of
CUIListWnd.GetSelectedItemGetSize
GetSize: Mock<() => number>;Returns
Number of items.
Implementation of
CUIListWnd.GetSizeGetVertFlip
GetVertFlip: Mock<() => boolean>;Returns
Whether vertical flip is enabled.
Implementation of
CUIListWnd.GetVertFlipGetWndPos
GetWndPos: Mock<() => vector2>;Returns
Window position relative to its parent.
Implementation of
CUIListWnd.GetWndPosInherited from
Init
Init: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Initialize window rectangle.
Param
frect
Window rectangle.
Implementation of
CUIListWnd.InitInherited from
isActive
isActive: boolean = false;isAutoDelete
isAutoDelete: boolean = false;Inherited from
IsAutoDelete
IsAutoDelete: Mock<() => boolean>;Returns
Whether the engine owns and deletes this window with its parent.
Implementation of
CUIListWnd.IsAutoDeleteInherited from
IsCursorOverWindow
IsCursorOverWindow: Mock<() => boolean>;Returns
Whether the UI cursor is currently over this window.
Implementation of
CUIListWnd.IsCursorOverWindowInherited from
MockCUIWindow.IsCursorOverWindow
isEnabled
isEnabled: boolean = false;Inherited from
IsEnabled
IsEnabled: Mock<() => boolean>;Returns
Whether the window accepts interaction.
Implementation of
CUIListWnd.IsEnabledInherited from
IsListActive
IsListActive: Mock<() => boolean>;Returns
Whether the list is active.
Implementation of
CUIListWnd.IsListActiveisPostProcessMode
isPostProcessMode: boolean = false;Inherited from
MockCUIWindow.isPostProcessMode
isScrollBarEnabled
isScrollBarEnabled: boolean = false;IsScrollBarEnabled
IsScrollBarEnabled: Mock<() => boolean>;Returns
Whether scrollbar is enabled.
Implementation of
CUIListWnd.IsScrollBarEnabledisShown
isShown: boolean = false;Inherited from
IsShown
IsShown: Mock<() => boolean>;Returns
Whether the window is visible.
Implementation of
CUIListWnd.IsShownInherited from
isVertFlip
isVertFlip: boolean = false;itemHeight
itemHeight: number = 0;items
items: CUIListItem[] = [];mouseX
mouseX: number = 0;Inherited from
mouseY
mouseY: number = 0;Inherited from
RemoveAll
RemoveAll: Mock<() => void>;Remove all items.
Implementation of
CUIListWnd.RemoveAllRemoveItem
RemoveItem: Mock<(index: number) => void>;Remove an item by index.
Param
index
Item index.
Implementation of
CUIListWnd.RemoveItemResetFocusCapture
ResetFocusCapture: Mock<() => void>;Release focus capture.
Implementation of
CUIListWnd.ResetFocusCaptureResetPPMode
ResetPPMode: Mock<() => void>;Disable post-process mode for this window.
Remarks
Pair with CUIWindow.SetPPMode when a window no longer needs post-process rendering.
Implementation of
CUIListWnd.ResetPPModeInherited from
ScrollToBegin
ScrollToBegin: Mock<UnknownFunction>;Scroll to the beginning.
Implementation of
CUIListWnd.ScrollToBeginScrollToEnd
ScrollToEnd: Mock<UnknownFunction>;Scroll to the end.
Implementation of
CUIListWnd.ScrollToEndScrollToPos
ScrollToPos: Mock<UnknownFunction>;Scroll to a list position.
Param
position
Scroll position.
Implementation of
CUIListWnd.ScrollToPosselectedIndex
selectedIndex: number = -1;SetAutoDelete
SetAutoDelete: Mock<(isAutoDelete: boolean) => void>;Set whether the parent owns this child window.
Remarks
Use this for script-created windows that are attached to a parent and should be cleaned up with the UI tree.
Param
auto_delete
Whether the engine should delete the child automatically.
Implementation of
CUIListWnd.SetAutoDeleteInherited from
SetFocusedItem
SetFocusedItem: Mock<(index: number) => void>;Set focused item index.
Param
index
Item index.
Implementation of
CUIListWnd.SetFocusedItemSetFont
SetFont: Mock<(font: CGameFont) => void>;Set the font used by this window.
Param
font
Font object.
Implementation of
CUIListWnd.SetFontInherited from
SetHeight
SetHeight: Mock<(height: number) => void>;Set window height.
Param
height
New height.
Implementation of
CUIListWnd.SetHeightInherited from
SetItemHeight
SetItemHeight: Mock<(height: number) => void>;Set list item height.
Param
height
Item height.
Implementation of
CUIListWnd.SetItemHeightSetPPMode
SetPPMode: Mock<() => void>;Enable post-process mode for this window.
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.
Implementation of
CUIListWnd.SetPPModeInherited from
SetTextColor
SetTextColor: Mock<(color: number) => void>;Set text color for list items.
Param
color
ARGB color.
Implementation of
CUIListWnd.SetTextColorSetVertFlip
SetVertFlip: Mock<(flip: boolean) => void>;Flip list direction vertically.
Param
flip
Whether vertical flip is enabled.
Implementation of
CUIListWnd.SetVertFlipSetWidth
SetWidth: Mock<(width: number) => void>;Set window width.
Param
width
New width.
Implementation of
CUIListWnd.SetWidthInherited from
SetWindowName
SetWindowName: Mock<(name: string) => void>;Set debug/window name.
Param
name
Window name.
Implementation of
CUIListWnd.SetWindowNameInherited from
SetWndPos
SetWndPos: Mock<(positionOrX: number | vector2, y?: number) => void>;Set window position.
Param
vector2
New position.
Implementation of
CUIListWnd.SetWndPosInherited from
SetWndRect
SetWndRect: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Set window rectangle.
Param
rect
New rectangle.
Implementation of
CUIListWnd.SetWndRectInherited from
SetWndSize
SetWndSize: Mock<(sizeOrWidth: number | vector2, height?: number) => void>;Set window size.
Param
vector2
New size.
Implementation of
CUIListWnd.SetWndSizeInherited from
ShowSelectedItem
ShowSelectedItem: Mock<UnknownFunction>;Scroll the selected item into view.
Param
show
Whether selected item should be shown.
Implementation of
CUIListWnd.ShowSelectedItemtextColor
textColor: number = 0;windowFont
windowFont: CGameFont | null = null;Inherited from
windowName
windowName: string | null = null;Inherited from
WindowName
WindowName: Mock<() => string>;Returns
Window name.
Implementation of
CUIListWnd.WindowNameInherited from
windowPosition
windowPosition: vector2;Inherited from
windowRect
windowRect: Frect | null = null;Inherited from
windowSize
windowSize: vector2;