UFO: Alien Invasion
|
#include "../../common/scripts.h"
Go to the source code of this file.
Macros | |
#define | V_UI_MASK 0x8F00 |
#define | V_UI 0x8000 |
#define | V_NOT_UI 0 |
#define | V_UI_ACTION (V_UI + 0) |
#define | V_UI_EXCLUDERECT (V_UI + 1) |
#define | V_UI_SPRITEREF (V_UI + 3) |
#define | V_UI_IF (V_UI + 4) |
#define | V_UI_DATAID (V_UI + 5) |
#define | V_UI_CVAR (V_UI + 0x0100) |
#define | V_UI_REF (V_UI + 0x0200) |
#define | V_UI_NODEMETHOD (V_UI + 0x0400) |
#define | V_UI_NODEMETHOD_LUA (V_UI + 0x0800) |
#define | V_UI_ALIGN V_INT |
#define | V_CVAR_OR_FLOAT (V_UI_CVAR + V_FLOAT) |
#define | V_CVAR_OR_STRING (V_UI_CVAR + V_STRING) |
#define | V_CVAR_OR_LONGSTRING (V_UI_CVAR + V_LONGSTRING) |
#define | V_REF_OF_STRING (V_UI_REF + V_STRING) |
Functions | |
bool | UI_ParseWindow (const char *type, const char *name, const char **text) |
Parse a window. More... | |
bool | UI_ParseComponent (const char *type, const char *name, const char **text) |
Parse a component. More... | |
bool | UI_ParseSprite (const char *name, const char **text) |
bool | UI_ParseUIModel (const char *name, const char **text) |
parses the models.ufo and all files where UI models (menu_model) are defined More... | |
float | UI_GetReferenceFloat (uiNode_t const *node, const void *ref) |
Returns the value of the reference variable. More... | |
const char * | UI_GetReferenceString (uiNode_t const *node, const char *ref) __attribute__((warn_unused_result)) |
const value_t * | UI_FindPropertyByName (const value_t *propertyList, const char *name) __attribute__((warn_unused_result)) |
Find a value_t by name into a array of value_t. More... | |
char * | UI_AllocStaticString (const char *string, int size) __attribute__((warn_unused_result)) |
Allocate a string into the UI static memory. More... | |
float * | UI_AllocStaticFloat (int count) __attribute__((warn_unused_result)) |
Allocate a float into the UI static memory. More... | |
vec4_t * | UI_AllocStaticColor (int count) __attribute__((warn_unused_result)) |
Allocate a color into the UI static memory. More... | |
struct uiAction_s * | UI_AllocStaticAction (void) __attribute__((warn_unused_result)) |
Allocate an action. More... | |
bool | UI_InitRawActionValue (struct uiAction_s *action, uiNode_t *node, const struct value_s *property, const char *string) |
bool | UI_TokenIsReserved (const char *name) |
bool | UI_TokenIsName (const char *name, bool isQuoted) |
Definition at line 68 of file ui_parse.h.
Referenced by UI_GetFloatFromNodeProperty(), UI_GetStringFromNodeProperty(), UI_NodeSetProperty(), and UI_RegisterAbstractValueNode().
#define V_CVAR_OR_LONGSTRING (V_UI_CVAR + V_LONGSTRING) |
Definition at line 70 of file ui_parse.h.
Referenced by UI_GetStringFromNodeProperty(), UI_NodeSetProperty(), UI_RegisterAbstractNode(), and UI_RegisterNodePropertyPosSize_().
Definition at line 69 of file ui_parse.h.
Referenced by UI_GetFloatFromNodeProperty(), UI_GetStringFromNodeProperty(), UI_NodeSetProperty(), UI_RegisterAbstractNode(), UI_RegisterImageNode(), UI_RegisterModelNode(), UI_RegisterNodePropertyPosSize_(), UI_RegisterRadioButtonNode(), UI_RegisterSequenceNode(), UI_RegisterTBarNode(), UI_RegisterTextNode(), UI_RegisterTextureNode(), UI_RegisterVideoNode(), and UI_RegisterVScrollbarNode().
#define V_NOT_UI 0 |
Definition at line 53 of file ui_parse.h.
Referenced by UI_GetStringFromNodeProperty(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().
Definition at line 71 of file ui_parse.h.
#define V_UI 0x8000 |
bit identity an UI type
Definition at line 52 of file ui_parse.h.
Referenced by UI_NodeSetProperty(), and UI_ParseProperty().
#define V_UI_ACTION (V_UI + 0) |
Identify an action type into the value_t structure
Definition at line 54 of file ui_parse.h.
Referenced by uiFuncNode::onLoaded(), UI_AddListener_f(), UI_ExecuteCallAction(), UI_NodeSetPropertyFromRAW(), UI_ParseProperty(), UI_ParseSetAction(), UI_RegisterAbstractNode(), UI_RegisterAbstractOptionNode(), UI_RegisterAbstractScrollableNode(), UI_RegisterBaseInventoryNode(), UI_RegisterContainerNode(), UI_RegisterSequenceNode(), UI_RegisterTextEntryNode(), UI_RegisterTimerNode(), UI_RegisterVideoNode(), UI_RegisterWindowNode(), and UI_RemoveListener_f().
#define V_UI_ALIGN V_INT |
Definition at line 65 of file ui_parse.h.
Referenced by UI_RegisterAbstractNode().
#define V_UI_CVAR (V_UI + 0x0100) |
Property is a CVAR string (mix this flag with base type, see bellow)
Definition at line 59 of file ui_parse.h.
Referenced by UI_DeleteNode(), UI_GetFloatFromNodeProperty(), UI_GetStringFromNodeProperty(), UI_InitRawActionValue(), UI_NodeSetProperty(), UI_NodeSetPropertyFromActionValue(), UI_NodeSetPropertyFromRAW(), UI_ParseProperty(), UI_RegisterAbstractOptionNode(), and UI_RegisterRadioButtonNode().
#define V_UI_DATAID (V_UI + 5) |
Definition at line 58 of file ui_parse.h.
Referenced by UI_ParseProperty(), UI_RegisterAbstractOptionNode(), and UI_RegisterTextNode().
#define V_UI_EXCLUDERECT (V_UI + 1) |
Identify a special attribute, use special parse function
Definition at line 55 of file ui_parse.h.
Referenced by UI_ParseProperty(), and UI_RegisterAbstractNode().
#define V_UI_IF (V_UI + 4) |
Identify a special attribute, use special parse function
Definition at line 57 of file ui_parse.h.
Referenced by UI_ParseProperty(), and UI_RegisterAbstractNode().
#define V_UI_MASK 0x8F00 |
Mask for all UI bits
Definition at line 51 of file ui_parse.h.
Referenced by UI_DeleteNode(), UI_GetFloatFromNodeProperty(), UI_GetStringFromNodeProperty(), UI_InitRawActionValue(), UI_NodeSetProperty(), UI_NodeSetPropertyFromActionValue(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().
#define V_UI_NODEMETHOD (V_UI + 0x0400) |
Property is a function
Definition at line 61 of file ui_parse.h.
Referenced by UI_ExecuteCallAction(), UI_InitializeNodeBehaviour(), UI_KeyPressedInWindow(), UI_RegisterNodeMethod(), and UI_SetKeyBindingEx().
#define V_UI_NODEMETHOD_LUA (V_UI + 0x0800) |
Properti is a lua based function
Definition at line 62 of file ui_parse.h.
Referenced by UI_ExecuteCallAction(), and UI_GetPropertyOrLuaMethod().
#define V_UI_REF (V_UI + 0x0200) |
Property is a ref into a value (mix this flag with base type, see bellow)
Definition at line 60 of file ui_parse.h.
Referenced by UI_ParseProperty().
#define V_UI_SPRITEREF (V_UI + 3) |
Identify a special attribute, use special parse function
Definition at line 56 of file ui_parse.h.
Referenced by UI_InitRawActionValue(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), UI_ParseProperty(), UI_RegisterButtonNode(), UI_RegisterCheckBoxNode(), UI_RegisterOptionListNode(), UI_RegisterOptionNode(), UI_RegisterOptionTreeNode(), UI_RegisterPanelNode(), UI_RegisterRadioButtonNode(), UI_RegisterSpinnerNode(), UI_RegisterTextEntryNode(), and UI_RegisterWindowNode().
struct uiAction_s* UI_AllocStaticAction | ( | void | ) |
Allocate an action.
Definition at line 221 of file ui_parse.cpp.
References uiGlobal_s::actions, Com_Error(), ERR_FATAL, uiGlobal_s::numActions, ui_global, and UI_MAX_ACTIONS.
Referenced by UI_AllocStaticCommandAction(), UI_ParseActionList(), UI_ParseExpression(), UI_ParseSetAction(), and UI_ParseValueExpression().
Allocate a color into the UI static memory.
[in] | count | number of element need to allocate |
Definition at line 187 of file ui_parse.cpp.
References Com_Error(), count, ERR_FATAL, and UI_AllocHunkMemory().
float* UI_AllocStaticFloat | ( | int | count | ) |
Allocate a float into the UI static memory.
[in] | count | number of element need to allocate |
Definition at line 171 of file ui_parse.cpp.
References Com_Error(), count, ERR_FATAL, and UI_AllocHunkMemory().
Referenced by UI_CloneCvarOrFloat(), and UI_InitCvarOrFloat().
char* UI_AllocStaticString | ( | const char * | string, |
int | size | ||
) |
Allocate a string into the UI static memory.
[in] | string | Use to initialize the string |
[in] | size | request a fixed memory size, if 0 the string size is used |
Definition at line 204 of file ui_parse.cpp.
References Com_Error(), ERR_FATAL, Q_strncpyz(), and UI_AllocHunkMemory().
Referenced by uiModelNode::clone(), uiModelNode::doLayout(), UI_AutoGenerateSprite(), UI_InitRawActionValue(), UI_ParseActionList(), UI_ParseSetAction(), and UI_ParseValueExpression().
Find a value_t by name into a array of value_t.
[in] | propertyList | Array of value_t, with null termination |
[in] | name | Property name we search |
Definition at line 154 of file ui_parse.cpp.
References Q_strcasecmp, and value_s::string.
Referenced by UI_MaterialEditorChangeValue_f(), UI_ParseSprite(), and UI_ParseUIModel().
Returns the value of the reference variable.
Definition at line 1434 of file ui_parse.cpp.
References Cvar_GetValue(), and Q_strstart().
Referenced by uiAbstractValueNode::decValue(), uiAbstractValueNode::getDelta(), uiAbstractValueNode::getMax(), uiAbstractValueNode::getMin(), uiAbstractValueNode::getValue(), uiAbstractValueNode::incValue(), uiRadioButtonNode::onActivate(), uiAbstractValueNode::setDelta(), uiAbstractValueNode::setMax(), uiAbstractValueNode::setMin(), uiAbstractValueNode::setValue(), UI_GetStringFromNodeProperty(), and UI_RadioButtonNodeIsSelected().
const char* UI_GetReferenceString | ( | const uiNode_t *const | node, |
const char * | ref | ||
) |
Definition at line 1406 of file ui_parse.cpp.
References CL_Translate(), Com_MacroExpandString(), and Sys_Error().
Referenced by uiStringNode::draw(), uiVScrollbarNode::draw(), uiSelectBoxNode::draw(), uiTextureNode::draw(), uiItemNode::draw(), uiTBarNode::draw(), uiButtonNode::draw(), uiTextNode::draw(), uiRadioButtonNode::draw(), uiModelNode::draw(), uiTextEntryNode::draw(), uiImageNode::draw(), uiWindowNode::draw(), uiSelectBoxNode::drawOverWindow(), uiStringNode::drawTooltip(), UI_AbstractOption_GetCurrentValue(), UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), UI_GetFontFromNode(), UI_GetStringFromNodeProperty(), UI_RadioButtonNodeIsSelected(), UI_TextNodeGenerateLineSplit(), and UI_Tooltip().
bool UI_InitRawActionValue | ( | struct uiAction_s * | action, |
uiNode_t * | node, | ||
const struct value_s * | property, | ||
const char * | string | ||
) |
bool UI_ParseComponent | ( | const char * | type, |
const char * | name, | ||
const char ** | text | ||
) |
Parse a component.
Definition at line 1261 of file ui_parse.cpp.
References Com_EParse(), Com_Error(), Com_Printf(), ERR_FATAL, uiBehaviour_t::name, Q_streq, UI_AllocNode(), UI_CloneNode(), UI_GetComponent(), UI_GetNodeBehaviour(), UI_InsertComponent(), UI_Node_Loaded(), UI_ParseNodeBody(), UI_TokenIsName(), and UI_TokenIsReserved().
Referenced by CL_ParseClientData(), and UI_Restart_f().
bool UI_ParseSprite | ( | const char * | name, |
const char ** | text | ||
) |
Definition at line 1213 of file ui_parse.cpp.
References Com_Parse(), Com_Printf(), uiSprite_t::name, UI_AllocStaticSprite(), UI_FindPropertyByName(), UI_ParseProperty(), and ui_spriteProperties.
Referenced by CL_ParseClientData(), and UI_Restart_f().
bool UI_ParseUIModel | ( | const char * | name, |
const char ** | text | ||
) |
parses the models.ufo and all files where UI models (menu_model) are defined
Definition at line 1134 of file ui_parse.cpp.
References uiModel_s::color, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), DEBUG_CLIENT, i, uiModel_s::id, Mem_PoolStrDup, Mem_PoolStrDupTo, uiGlobal_s::models, uiModel_s::next, uiGlobal_s::numModels, OBJZERO, value_s::ofs, Q_streq, value_s::size, value_s::string, Sys_Error(), value_s::type, UI_FindPropertyByName(), UI_GetUIModel(), ui_global, UI_MAX_MODELS, ui_sysPool, v, V_HUNK_STRING, V_NULL, and Vector4Set.
Referenced by CL_ParseClientData(), and UI_Restart_f().
bool UI_ParseWindow | ( | const char * | type, |
const char * | name, | ||
const char ** | text | ||
) |
Parse a window.
Definition at line 1336 of file ui_parse.cpp.
References Com_Error(), Com_GetType(), Com_Parse(), Com_Printf(), ERR_FATAL, i, uiNode_t::name, uiGlobal_s::numWindows, Q_streq, uiNode_t::root, Sys_Error(), TT_QUOTED_WORD, UI_AllocNode(), UI_CloneNode(), UI_GetWindow(), ui_global, UI_InsertWindow(), UI_MAX_WINDOWS, UI_Node_Loaded(), UI_ParseNodeBody(), UI_TokenIsName(), UI_TokenIsReserved(), and uiGlobal_s::windows.
Referenced by CL_ParseClientData(), and UI_Restart_f().
bool UI_TokenIsName | ( | const char * | name, |
bool | isQuoted | ||
) |
Definition at line 126 of file ui_parse.cpp.
Referenced by UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().
bool UI_TokenIsReserved | ( | const char * | name | ) |
Definition at line 82 of file ui_parse.cpp.
References Q_streq, and reservedTokens.
Referenced by UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().