26 #include "../ui_main.h"
27 #include "../ui_internal.h"
28 #include "../ui_parse.h"
29 #include "../ui_draw.h"
30 #include "../ui_data.h"
31 #include "../ui_lua.h"
36 #include "../../../common/scripts_lua.h"
38 #define EXTRADATA_TYPE abstractOptionExtraData_t
39 #define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
54 option = option->
next;
62 Com_Printf(
"UI_AbstractOptionGetCurrentValue: node [%s] doesn't have a valid cvar assigned\n",
UI_GetPath(node));
77 const char* cvarName = &
EXTRADATA(node).cvar[6];
89 EXTRADATA(node).lua_onViewChange = LUA_NOREF;
102 option = option->
next;
127 option = option->
next;
195 EXTRADATA(node).scrollY.set(-1, size, -1);
199 EXTRADATA(node).scrollY.set(-1, -1, size);
213 behaviour->
name =
"abstractoption";
int getCellHeight(uiNode_t *node) override
Return size of the cell, which is the size (in virtual "pixel") which represents 1 in the scroll valu...
void UI_Validate(uiNode_t *node)
Validate a node tree.
int UI_AbstractOption_GetDataId(uiNode_t *node)
int getCellWidth(uiNode_t *node) override
Return size of the cell, which is the size (in virtual "pixel") which represents 1 in the scroll valu...
void UI_SortOptions(uiNode_t **first)
Sort options by alphabet.
struct uiAction_s * onChange
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
int UI_AbstractOption_Scroll_ViewSize(uiNode_t *node)
bool UI_Node_IsOptionContainer(uiNode_t const *node)
const char * UI_AbstractOption_GetCurrentValue(uiNode_t *node)
uiBehaviour_t * behaviour
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
void Com_Printf(const char *const fmt,...)
uiNode_t * UI_GetOption(int dataId)
void UI_RegisterAbstractOptionNode(uiBehaviour_t *behaviour)
void UI_AbstractOption_SortOptions(uiNode_t *node)
Sort options by alphabet.
int UI_GetDataVersion(int textId)
void initNode(uiNode_t *node) override
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
int UI_GetDataIDByName(const char *name)
Return a dataId by name.
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags, const char *desc)
Init or return a cvar.
SharedPtr< uiNode > UINodePtr
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
#define UI_EXTRADATA(NODE, TYPE)
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
void UI_AbstractOption_SetCurrentValue(uiNode_t *node, const char *value)
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
void UI_AbstractOption_Scroll_SetFullSize(uiNode_t *node, int size)
void UI_AbstractOption_SetBackgroundByName(uiNode_t *node, const char *name)
Atomic structure used to define most of the UI.
void UI_AbstractOption_Scroll_SetCurrent(uiNode_t *node, int pos)
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_AbstractOption_Scroll_SetViewSize(uiNode_t *node, int size)
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
int UI_AbstractOption_Scroll_Current(uiNode_t *node)
virtual void initNode(uiNode_t *node)
int UI_AbstractOption_GetCount(uiNode_t *node)
node behaviour, how a node work
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void UI_AbstractOption_SetDataIdByName(uiNode_t *node, const char *name)
const char * UI_AbstractOption_GetCvar(uiNode_t *node)
int UI_AbstractOption_Scroll_FullSize(uiNode_t *node)
void UI_AbstractOption_SetDataId(uiNode_t *node, int id)
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.
const uiBehaviour_t * ui_optionBehaviour
QGL_EXTERN int GLboolean GLfloat * v
uiNode_t * UI_AbstractOption_GetFirstOption(uiNode_t *node)
Return the first option of the node.
void UI_AbstractOption_SetCvar(uiNode_t *node, const char *name)