-
Notifications
You must be signed in to change notification settings - Fork 126
Scripting: UI API Reference
Victor Luchits edited this page Jan 9, 2018
·
1 revision
typedef enum
{
EVENT_PHASE_UNKNOWN = 0x0,
EVENT_PHASE_CAPTURE = 0x1,
EVENT_PHASE_TARGET = 0x2,
EVENT_PHASE_BUBBLE = 0x3,
} eEventPhase;
typedef enum
{
KI_ESCAPE = 0x51,
KI_0 = 0x2,
KI_1 = 0x3,
KI_2 = 0x4,
KI_3 = 0x5,
KI_4 = 0x6,
KI_5 = 0x7,
KI_6 = 0x8,
KI_7 = 0x9,
KI_8 = 0xa,
KI_9 = 0xb,
} eInputKey;
typedef enum
{
IN_DEVICE_KEYBOARD = 0x1,
IN_DEVICE_MOUSE = 0x2,
IN_DEVICE_JOYSTICK = 0x4,
IN_DEVICE_TOUCHSCREEN = 0x8,
IN_DEVICE_SOFTKEYBOARD = 0x10,
} eInputDeviceMask;
typedef enum
{
DROP_REASON_CONNFAILED = 0x0,
DROP_REASON_CONNTERMINATED = 0x1,
DROP_REASON_CONNERROR = 0x2,
} eDropReason;
typedef enum
{
DROP_TYPE_GENERAL = 0x0,
DROP_TYPE_PASSWORD = 0x1,
DROP_TYPE_NORECONNECT = 0x2,
DROP_TYPE_TOTAL = 0x3,
} eDropType;
typedef enum
{
DOWNLOADTYPE_NONE = 0x0,
DOWNLOADTYPE_SERVER = 0x1,
DOWNLOADTYPE_WEB = 0x2,
} eDownloadType;
typedef enum
{
MM_LOGIN_STATE_LOGGED_OUT = 0x0,
MM_LOGIN_STATE_IN_PROGRESS = 0x1,
MM_LOGIN_STATE_LOGGED_IN = 0x2,
} eMatchmakerState;
Window window;
Game game;
Matchmaker matchmaker;
Console console;
const String@ TranslateString(const String&in);
const String@ _T(const String&in);
const String@ GetUserLanguage();
DataSource@ getDataSource(const String&in);
ServerBrowser& get_serverBrowser();
class URL
{
public:
/* object properties */
/* object behaviors */
~URL();
URL();
URL(const String&in);
URL(const URL&in);
/* object methods */
URL& opAssign(const URL&in);
String@ getURL() const;
bool setURL(const String&in);
String@ getSchema() const;
bool setSchema(const String&in);
String@ getLogin() const;
bool setLogin(const String&in);
String@ getPassword() const;
bool setPassword(const String&in);
String@ getHost() const;
bool setHost(const String&in);
uint getPort() const;
bool setPort(uint);
String@ getPath() const;
bool setPath(const String&in);
bool prefixPath(const String&in);
String@ getFileName() const;
bool setFileName(const String&in);
String@ getFullFileName() const;
String@ getFileExtension() const;
bool setFileExtension(const String&in);
Dictionary@ getParameters() const;
void setParameter(const String&in, const String&in);
void clearParameters();
String@ getQueryString() const;
};
class Event
{
public:
/* object properties */
/* object behaviors */
/* object methods */
String@ getType();
Element@ getTarget();
String@ getParameter(const String&in, const String&in);
int getParameter(const String&in, int);
uint getParameter(const String&in, uint);
float getParameter(const String&in, float);
bool getParameter(const String&in, bool);
Dictionary@ getParameters();
int getPhase();
void stopPropagation();
};
class EventListener
{
public:
/* object properties */
/* object behaviors */
/* object methods */
};
class Element
{
public:
/* object properties */
const String@ tagName;
String@ id;
const ElementDocument@ ownerDocument;
/* object behaviors */
ElementDocument@ _beh_11_();
ElementDataGrid@ _beh_11_();
ElementDataGridRow@ _beh_11_();
ElementForm@ _beh_11_();
ElementFormControl@ _beh_11_();
ElementFormControlDataSelect@ _beh_11_();
ElementTabSet@ _beh_11_();
ElementImage@ _beh_11_();
ElementOptionsForm@ _beh_11_();
/* object methods */
bool setProp(const String&in, const String&in);
String@ getProp(const String&in);
float resolveProp(const String&in, float);
void removeProp(const String&in);
Element@ css(const String&in, const String&in);
String@ css(const String&in);
void setClass(const String&in, bool);
bool hasClass(const String&in);
void setClasses(const String&in);
String@ getClasses();
Element@ addClass(const String&in);
Element@ removeClass(const String&in);
Element@ toggleClass(const String&in);
void toggleClass(const String&in, bool);
void togglePseudo(const String&in, bool);
bool hasPseudo(const String&in);
Element@ setAttr(const String&in, const String&in);
Element@ setAttr(const String&in, int);
Element@ setAttr(const String&in, float);
String@ getAttr(const String&in, const String&in);
int getAttr(const String&in, int);
int getAttr(const String&in, uint);
int getAttr(const String&in, float);
bool hasAttr(const String&in);
void removeAttr(const String&in);
int numAttr() const;
Element@ getParent();
Element@ getNextSibling();
Element@ getPrevSibling();
Element@ firstChild();
Element@ lastChild();
uint getNumChildren(bool includeNonDomElements = false);
Element@ getChild(uint);
String@ getInnerRML() const;
void setInnerRML(const String&in);
bool focus();
void unfocus();
void click();
void addChild(Element@ el, bool dom_element = true);
void insertChild(Element@, Element@);
void removeChild(Element@);
bool hasChildren() const;
Element@ clone();
Element@ getElementById(const String&in);
Element@[]@ getElementsByTagName(const String&in);
Element@[]@ getElementsByClassName(const String&in);
void addEventListener(const String&inout event, DOMEventListenerCallback@ callback);
void removeEventListener(const String&in, EventListener@);
float clientLeft();
float clientTop();
float clientHeight();
float clientWidth();
Element@ offsetParent();
float offsetLeft();
float offsetTop();
float offsetHeight();
float offsetWidth();
float scrollLeft();
void scrollLeft(float);
float scrollTop();
void scrollTop(float);
float scrollHeight();
float scrollWidth();
float absLeft();
float absTop();
};
class ElementDocument
{
public:
/* object properties */
const URL URL;
const String@ title;
const Element@ body;
/* object behaviors */
Element@ _beh_11_();
/* object methods */
};
class ElementDataGrid
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
/* object methods */
ElementDataGridRow@ getRow(uint);
uint getNumRows() const;
String@[]@ getFields(int) const;
Element@ getColumnHeader(int);
uint getNumColumns() const;
void setDataSource(const String&in);
};
class ElementDataGridRow
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
/* object methods */
ElementDataGrid@ getParentGrid();
uint getIndex();
};
class ElementForm
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
/* object methods */
void submit();
};
class ElementFormControl
{
public:
/* object properties */
String@ name;
String@ value;
const bool submitted;
bool disabled;
/* object behaviors */
Element@ _beh_11_();
ElementFormControlDataSelect@ _beh_11_();
/* object methods */
};
class ElementFormControlDataSelect
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
ElementFormControl@ _beh_11_();
/* object methods */
void setDataSource(const String&in);
int getSelection();
void setSelection(int);
int getNumOptions();
void addOption(const String&inout rml, const String&inout value, int before = - 1, bool selectable = true);
void removeOption(int);
void removeAllOptions();
void spin(int);
};
class ElementTabSet
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
/* object methods */
void setTab(int, const String&in);
void setTab(int, Element@);
void setPanel(int, const String&in);
void setPanel(int, Element@);
void removeTab(int);
int getNumTabs() const;
void setActiveTab(int);
int getActiveTab() const;
};
class ElementImage
{
public:
/* object properties */
const float width;
const float height;
/* object behaviors */
Element@ _beh_11_();
/* object methods */
};
class Window
{
public:
/* object properties */
const ElementDocument@ document;
String@ location;
const int64 time;
const bool drawBackground;
const int width;
const int height;
const float pixelRatio;
const int connectCount;
const uint supportedInputDevices;
const bool browserAvailable;
const String@ osName;
/* object behaviors */
/* object methods */
ElementDocument@ open(const String&in);
void close(int code = 0);
void modal(const String&inout location, int defaultCode = - 1);
int getModalValue() const;
void preload(const String&in);
uint history_size() const;
void history_back() const;
void startLocalSound(String&in sound, float volume = 1.0) const;
void startBackgroundTrack(String&in intro, String&in loop, bool stopIfPlaying = true) const;
void stopBackgroundTrack() const;
int setTimeout(TimerCallback@, uint);
int setInterval(TimerCallback@, uint);
int setTimeout(TimerCallback2@, uint, any&in);
int setInterval(TimerCallback2@, uint, any&in);
void clearTimeout(int);
void clearInterval(int);
void flash(uint);
void showSoftKeyboard(bool);
};
class ElementOptionsForm
{
public:
/* object properties */
/* object behaviors */
Element@ _beh_11_();
/* object methods */
void restoreOptions();
void storeOptions();
void applyOptions();
};
class ServerBrowser
{
public:
/* object properties */
/* object behaviors */
/* object methods */
void fullUpdate();
void refresh();
bool isUpdating();
void stopUpdate();
bool addFavorite(const String&in);
bool removeFavorite(const String&in);
void sortByField(const String&in);
int64 getLastActiveTime();
uint getUpdateId();
};
class DataSource
{
public:
/* object properties */
const String@ name;
/* object behaviors */
/* object methods */
int numRows(const String&in) const;
String@ getField(const String&in, int, const String&in) const;
int findRow(const String&inout table, const String&inout field, const String&inout value, int start = 0) const;
};
class DemoInfo
{
public:
/* object properties */
const bool isPlaying;
const bool isPaused;
const uint time;
const String@ name;
/* object behaviors */
~DemoInfo();
DemoInfo();
DemoInfo(const String&in);
DemoInfo(const DemoInfo&in);
/* object methods */
DemoInfo& opAssign(const DemoInfo&in);
void play() const;
void stop() const;
void pause() const;
void jump(uint) const;
String@ getMeta(const String&in) const;
};
class DownloadInfo
{
public:
/* object properties */
const float percent;
const int speed;
const int type;
const const String@ name;
/* object behaviors */
~DownloadInfo();
DownloadInfo();
DownloadInfo(const DownloadInfo&in);
/* object methods */
DownloadInfo& opAssign(const DownloadInfo&in);
};
class Game
{
public:
/* object properties */
const DemoInfo demo;
const String@ name;
const String@ version;
const String@ revision;
const int playerNum;
const int clientState;
const int serverState;
const String@ serverName;
const String@ rejectMessage;
const DownloadInfo download;
const bool isTV;
/* object behaviors */
/* object methods */
String@ configString(int) const;
String@ cs(int) const;
void exec(const String&in) const;
void execAppend(const String&in) const;
void execInsert(const String&in) const;
};
class Matchmaker
{
public:
/* object properties */
const int state;
const String@ lastError;
const String@ user;
/* object behaviors */
/* object methods */
bool login(const String&in, const String&in);
bool logout();
String@ profileURL(bool) const;
String@ baseWebURL() const;
void addEventListener(const String&inout event, MMEventListenerCallback@ callback);
void removeEventListener(const String&inout event, MMEventListenerCallback@ callback);
};
class Console
{
public:
/* object properties */
/* object behaviors */
/* object methods */
void log(const String&in) const;
void debug(const String&in) const;
void warn(const String&in) const;
void error(const String&in) const;
void trace() const;
void assert(bool) const;
};