UI elements
UI elements are engine CUI bindings exposed to Lua. XRF uses them from runtime UI classes and initializes most controls
from XML generated by src/engine/forms.
Use the XRF X-Ray 16 SDK as the API reference for exact methods. This page gives the practical map of common classes.
XML initialization
CScriptXmlInit loads XML and creates controls from node selectors.
Common methods include:
ParseFile(path);ParseShTexInfo(path);InitWindow(selector, index, window);InitStatic(selector, parent);InitTextWnd(selector, parent);Init3tButton(selector, parent);InitCheck(selector, parent);InitComboBox(selector, parent);InitEditBox(selector, parent);InitListBox(selector, parent);InitScrollView(selector, parent);InitTab(selector, parent);InitTrackBar(selector, parent).
Call ParseFile() before using Init* helpers. Controls created with a parent are attached to that parent by the
engine binding.
Window base classes
| Class | Use |
|---|---|
CUIWindow | Base window rectangle, visibility, enable state, child attachment, and positioning. |
CUIDialogWnd | Dialog window that can be shown, hidden, and attached to a dialog holder. |
CUIScriptWnd | Script-driven dialog window with callbacks, keyboard handling, child registration, and typed lookup helpers. |
Use CUIScriptWnd for custom script windows that need callbacks or registered child controls.
Static and text controls
| Class | Use |
|---|---|
CUIStatic | Static image, texture, animation, or simple visual element. |
CUITextWnd | Text window with text color, alignment, string-table text, and sizing helpers. |
CUILines | Text lines object used by text-capable controls. |
CUISleepStatic | Sleep/static overlay variant used by engine UI. |
Use SetTextST(...) when the text should come from translations.
Buttons and inputs
| Class | Use |
|---|---|
CUIButton | Base button class. |
CUI3tButton | Common three-state button used by menus and dialogs. |
CUICheckButton | Checkbox-style button with checked state. |
CUICustomEdit | Base edit control with text and focus capture. |
CUIEditBox | Edit box with texture initialization. |
CUICustomSpin | Base spin control. |
CUISpinFlt | Float spin control. |
CUISpinNum | Integer spin control. |
CUISpinText | Text spin control. |
CUITrackBar | Slider/track bar with integer or float values. |
For settings screens, prefer the existing option window patterns under src/engine/core/ui/menu/options.
Lists and tabs
| Class | Use |
|---|---|
CUIListBox | Scrollable list box with list-box items. |
CUIListBoxItem | Item for CUIListBox. |
CUIListBoxItemMsgChain | Message-chain list item variant. |
CUIListWnd | Engine list window that owns added list items. |
CUIListItem | Generic list item. |
CUIScrollView | Scroll view container. |
CUITabControl | Tab container with id and index activation. |
CUITabButton | Button used by tab controls. |
Ids and visual indices are not the same for combo boxes, tabs, and lists. Use ids for stable logic and indices for visual order.
Frames, maps, and message windows
| Class | Use |
|---|---|
CUIFrameWindow | Framed panel. |
CUIFrameLineWnd | Repeating frame line. |
CUIComboBox | Dropdown list with item ids. |
CUIMessageBox | Message box static variant. |
CUIMessageBoxEx | Dialog-window message box variant. |
CUIProgressBar | Progress indicator. |
CUIPropertiesBox | Context/properties menu. |
CUIMapInfo | Map metadata control. |
CUIMapList | Multiplayer map list control. |
CUIMMShniaga | Main-menu animated/menu control. |
CServerList | Multiplayer server list control. |
Lifetime and callbacks
Parent-owned controls are adopted by the engine UI tree. After attaching a child or adding an item to a list, treat the parent/list as owning its lifetime.
For CUIScriptWnd, register child controls before adding callbacks or using typed lookup helpers. Callback names depend
on the registered window name, so keep XML node names and registration names aligned.