Skip to content

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 ​

ts
new CScriptXmlInit(): CScriptXmlInit;

Create an XML initializer.

Returns ​

CScriptXmlInit

Methods ​

Init3tButton() ​

ts
Init3tButton(selector: string, parent: Nillable<CUIWindow>): CUI3tButton;

Create and initialize a three-state button from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUI3tButton

Created button.

Remarks ​

When parent is provided, the created control is marked for parent-owned deletion.


InitAnimStatic() ​

ts
InitAnimStatic(selector: string, parent: Nillable<CUIWindow>): CUIStatic;

Create and initialize an animated static from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIStatic

Created static control.

Remarks ​

When parent is provided, the created control is marked for parent-owned deletion.


InitAutoStaticGroup() ​

ts
InitAutoStaticGroup(selector: string, parent: CUIWindow): void;

Initialize a group of auto-created static controls under an existing window.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentCUIWindowParent 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() ​

ts
InitButton(selector: string, parent: Nillable<CUIWindow>): CUIButton;

Create and initialize a button from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIButton

Created button.

Remarks ​

The created button is marked for auto-delete by the native binding.


InitCDkey() ​

ts
InitCDkey(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;

Create and initialize a CD key edit box from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIEditBox

Created edit box.

Remarks ​

Assigns CD-key callbacks and applies the current option value after initialization.


InitCheck() ​

ts
InitCheck(selector: string, parent: Nillable<CUIWindow>): CUICheckButton;

Create and initialize a check button from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUICheckButton

Created check button.


InitComboBox() ​

ts
InitComboBox(selector: string, parent: Nillable<CUIWindow>): CUIComboBox;

Create and initialize a combo box from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIComboBox

Created combo box.


InitEditBox() ​

ts
InitEditBox(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;

Create and initialize an edit box from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIEditBox

Created edit box.


InitFrame() ​

ts
InitFrame(selector: string, parent: Nillable<CUIWindow>): CUIFrameWindow;

Create and initialize a frame window from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIFrameWindow

Created frame window.


InitFrameLine() ​

ts
InitFrameLine(selector: string, parent: Nillable<CUIWindow>): CUIFrameLineWnd;

Create and initialize a frame line from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIFrameLineWnd

Created frame line.


InitHint() ​

ts
InitHint(selector: string, parent: Nillable<CUIWindow>): UIHint;

Create and initialize a hint window from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

UIHint

Created hint window.


InitKeyBinding() ​

ts
InitKeyBinding(selector: string, parent: Nillable<CUIWindow>): CUIWindow;

Create and initialize a key binding control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIWindow

Created key binding window.


InitLabel() ​

ts
InitLabel(selector: string, parent: Nillable<CUIWindow>): CUIStatic;

Create and initialize a label from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIStatic

Created label static.


InitList() ​

ts
InitList(selector: string, parent: Nillable<CUIWindow>): CUIListWnd;

Create and initialize a list window from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIListWnd

Created list window.

Remarks ​

When parent is provided, the created control is marked for parent-owned deletion.


InitListBox() ​

ts
InitListBox<T>(selector: string, parent: Nillable<CUIWindow>): CUIListBox<T>;

Create and initialize a list box from XML.

Type Parameters ​

Type ParameterDefault type
T extends CUIListBoxItemCUIListBoxItem

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<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() ​

ts
InitMapInfo(selector: string, parent: Nillable<CUIWindow>): CUIMapInfo;

Create and initialize a map info control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIMapInfo

Created map info control.

Remarks ​

Initializes both the base window rect and the map-info content area from the XML node.


InitMapList() ​

ts
InitMapList(selector: string, parent: Nillable<CUIWindow>): CUIMapList;

Create and initialize a map list control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIMapList

Created map list control.


InitMMShniaga() ​

ts
InitMMShniaga(selector: string, parent: Nillable<CUIWindow>): CUIMMShniaga;

Create and initialize a main-menu shniaga control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIMMShniaga

Created main-menu shniaga control.


InitMPPlayerName() ​

ts
InitMPPlayerName(selector: string, parent: Nillable<CUIWindow>): CUIEditBox;

Create and initialize a multiplayer player-name edit box from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIEditBox

Created edit box.


InitProgressBar() ​

ts
InitProgressBar(selector: string, parent: Nillable<CUIWindow>): CUIProgressBar;

Create and initialize a progress bar from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIProgressBar

Created progress bar.


InitScrollView() ​

ts
InitScrollView(selector: string, parent: Nillable<CUIWindow>): CUIScrollView;

Create and initialize a scroll view from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIScrollView

Created scroll view.

Remarks ​

Child controls created under this parent are added through AddWindow().


InitServerList() ​

ts
InitServerList(selector: string, parent: Nillable<CUIWindow>): CServerList;

Create and initialize a server list from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CServerList

Created server list.


InitSleepStatic() ​

ts
InitSleepStatic(selector: string, parent: Nillable<CUIWindow>): CUISleepStatic;

Create and initialize a sleep static from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUISleepStatic

Created sleep static.


InitSpinFlt() ​

ts
InitSpinFlt(selector: string, parent: Nillable<CUIWindow>): CUISpinFlt;

Create and initialize a float spin control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUISpinFlt

Created spin control.


InitSpinNum() ​

ts
InitSpinNum(selector: string, parent: Nillable<CUIWindow>): CUISpinNum;

Create and initialize an integer spin control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUISpinNum

Created spin control.


InitSpinText() ​

ts
InitSpinText(selector: string, parent: Nillable<CUIWindow>): CUISpinText;

Create and initialize a text spin control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUISpinText

Created spin control.


InitStatic() ​

ts
InitStatic(selector: string, parent: Nillable<CUIWindow>): CUIStatic;

Create and initialize a static control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIStatic

Created static control.

Remarks ​

InitLabel() is bound to the same native initializer as this method.


InitTab() ​

ts
InitTab(selector: string, parent: Nillable<CUIWindow>): CUITabControl;

Create and initialize a tab control from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUITabControl

Created tab control.


InitTextWnd() ​

ts
InitTextWnd(selector: string, parent: Nillable<CUIWindow>): CUITextWnd;

Create and initialize a text window from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUITextWnd

Created text window.


InitTrackBar() ​

ts
InitTrackBar(selector: string, parent: Nillable<CUIWindow>): CUITrackBar;

Create and initialize a track bar from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUITrackBar

Created track bar.


InitVerList() ​

ts
InitVerList(selector: string, parent: Nillable<CUIWindow>): CUIVersionList;

Create and initialize a version list from XML.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
parentNillable<CUIWindow>Optional parent window.

Returns ​

CUIVersionList

Created version list.


InitWindow() ​

ts
InitWindow(
   selector: string, 
   index: number, 
   parent: Nillable<CUIWindow>): void;

Initialize a window already created by script.

Parameters ​

ParameterTypeDescription
selectorstringXML node path.
indexnumberXML node index.
parentNillable<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() ​

ts
ParseFile(path: string): void;

Load a UI XML file from the configured UI paths.

Parameters ​

ParameterTypeDescription
pathstringXML file path.

Returns ​

void

Remarks ​

Paths are resolved through the engine config/UI path stack, including the active and default UI paths.


ParseShTexInfo() ​

ts
ParseShTexInfo(path: string): void;

Load shared texture metadata from an XML file.

Parameters ​

ParameterTypeDescription
pathstringXML file path.

Returns ​

void

Remarks ​

Missing files are ignored by the native loader. Duplicate texture ids from this file replace existing entries.