Class: CScriptXmlInit
XML UI initialization helper.
Source
C++ class CScriptXmlInit
Custom Constructor
CScriptXmlInit
Remarks
Call ParseFile() before Init* helpers. Created controls are attached to parent when it is provided; scroll views receive them through AddWindow(), other windows through AttachChild(). Controls created without a parent are not attached by this helper.
Constructors
Constructor
new CScriptXmlInit(): CScriptXmlInit;Create an XML initializer.
Returns
CScriptXmlInit
Methods
Init3tButton()
Init3tButton(selector: string, parent: Nillable<CUIWindow>): CUI3tButton;Create and initialize a three-state button from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created button.
Remarks
When parent is provided, the created control is marked for parent-owned deletion.
InitAnimStatic()
InitAnimStatic(selector: string, parent: Nillable<CUIWindow>): CUIStatic;Create and initialize an animated static from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created static control.
Remarks
When parent is provided, the created control is marked for parent-owned deletion.
InitAutoStaticGroup()
InitAutoStaticGroup(selector: string, parent: CUIWindow): void;Initialize a group of auto-created static controls under an existing window.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | CUIWindow | Parent window. |
Returns
void
Remarks
Reads static child definitions from the selected XML node and attaches them to parent. Requires a non-null parent window.
InitButton()
InitButton(selector: string, parent: Nillable<CUIWindow>): CUIButton;Create and initialize a button from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created button.
Remarks
The created button is marked for auto-delete by the native binding.
InitCDkey()
InitCDkey(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;Create and initialize a CD key edit box from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created edit box.
Remarks
Assigns CD-key callbacks and applies the current option value after initialization.
InitCheck()
InitCheck(selector: string, parent: Nillable<CUIWindow>): CUICheckButton;Create and initialize a check button from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created check button.
InitComboBox()
InitComboBox(selector: string, parent: Nillable<CUIWindow>): CUIComboBox;Create and initialize a combo box from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created combo box.
InitEditBox()
InitEditBox(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;Create and initialize an edit box from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created edit box.
InitFrame()
InitFrame(selector: string, parent: Nillable<CUIWindow>): CUIFrameWindow;Create and initialize a frame window from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created frame window.
InitFrameLine()
InitFrameLine(selector: string, parent: Nillable<CUIWindow>): CUIFrameLineWnd;Create and initialize a frame line from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created frame line.
InitHint()
InitHint(selector: string, parent: Nillable<CUIWindow>): UIHint;Create and initialize a hint window from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created hint window.
InitKeyBinding()
InitKeyBinding(selector: string, parent: Nillable<CUIWindow>): CUIWindow;Create and initialize a key binding control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created key binding window.
InitLabel()
InitLabel(selector: string, parent: Nillable<CUIWindow>): CUIStatic;Create and initialize a label from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created label static.
InitList()
InitList(selector: string, parent: Nillable<CUIWindow>): CUIListWnd;Create and initialize a list window from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created list window.
Remarks
When parent is provided, the created control is marked for parent-owned deletion.
InitListBox()
InitListBox<T>(selector: string, parent: Nillable<CUIWindow>): CUIListBox<T>;Create and initialize a list box from XML.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends CUIListBoxItem | CUIListBoxItem |
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
CUIListBox<T>
Created list box.
Remarks
When parent is provided, the created control is marked for parent-owned deletion.
InitMapInfo()
InitMapInfo(selector: string, parent: Nillable<CUIWindow>): CUIMapInfo;Create and initialize a map info control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created map info control.
Remarks
Initializes both the base window rect and the map-info content area from the XML node.
InitMapList()
InitMapList(selector: string, parent: Nillable<CUIWindow>): CUIMapList;Create and initialize a map list control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created map list control.
InitMMShniaga()
InitMMShniaga(selector: string, parent: Nillable<CUIWindow>): CUIMMShniaga;Create and initialize a main-menu shniaga control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created main-menu shniaga control.
InitMPPlayerName()
InitMPPlayerName(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;Create and initialize a multiplayer player-name edit box from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created edit box.
InitProgressBar()
InitProgressBar(selector: string, parent: Nillable<CUIWindow>): CUIProgressBar;Create and initialize a progress bar from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created progress bar.
InitScrollView()
InitScrollView(selector: string, parent: Nillable<CUIWindow>): CUIScrollView;Create and initialize a scroll view from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created scroll view.
Remarks
Child controls created under this parent are added through AddWindow().
InitServerList()
InitServerList(selector: string, parent: Nillable<CUIWindow>): CServerList;Create and initialize a server list from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created server list.
InitSleepStatic()
InitSleepStatic(selector: string, parent: Nillable<CUIWindow>): CUISleepStatic;Create and initialize a sleep static from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created sleep static.
InitSpinFlt()
InitSpinFlt(selector: string, parent: Nillable<CUIWindow>): CUISpinFlt;Create and initialize a float spin control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created spin control.
InitSpinNum()
InitSpinNum(selector: string, parent: Nillable<CUIWindow>): CUISpinNum;Create and initialize an integer spin control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created spin control.
InitSpinText()
InitSpinText(selector: string, parent: Nillable<CUIWindow>): CUISpinText;Create and initialize a text spin control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created spin control.
InitStatic()
InitStatic(selector: string, parent: Nillable<CUIWindow>): CUIStatic;Create and initialize a static control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created static control.
Remarks
InitLabel() is bound to the same native initializer as this method.
InitTab()
InitTab(selector: string, parent: Nillable<CUIWindow>): CUITabControl;Create and initialize a tab control from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created tab control.
InitTextWnd()
InitTextWnd(selector: string, parent: Nillable<CUIWindow>): CUITextWnd;Create and initialize a text window from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created text window.
InitTrackBar()
InitTrackBar(selector: string, parent: Nillable<CUIWindow>): CUITrackBar;Create and initialize a track bar from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created track bar.
InitVerList()
InitVerList(selector: string, parent: Nillable<CUIWindow>): CUIVersionList;Create and initialize a version list from XML.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
parent | Nillable<CUIWindow> | Optional parent window. |
Returns
Created version list.
InitWindow()
InitWindow(
selector: string,
index: number,
parent: Nillable<CUIWindow>): void;Initialize a window already created by script.
Parameters
| Parameter | Type | Description |
|---|---|---|
selector | string | XML node path. |
index | number | XML node index. |
parent | Nillable<CUIWindow> | Window to initialize. |
Returns
void
Remarks
This does not create a child window. It applies XML properties to the passed window and does not attach it to a parent.
ParseFile()
ParseFile(path: string): void;Load a UI XML file from the configured UI paths.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | XML file path. |
Returns
void
Remarks
Paths are resolved through the engine config/UI path stack, including the active and default UI paths.
ParseShTexInfo()
ParseShTexInfo(path: string): void;Load shared texture metadata from an XML file.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | XML file path. |
Returns
void
Remarks
Missing files are ignored by the native loader. Duplicate texture ids from this file replace existing entries.