47 if (value !=
nullptr && node->
super ==
nullptr) {
56 behaviour->
name =
"func";
97 return (dummy !=
nullptr && dummy->
parent ==
nullptr);
106 if (node->
super ==
nullptr) {
112 Com_Printf(
"UI_ParseNodeBody: Command name for confunc '%s' already registered\n",
UI_GetPath(node));
142 if (userData && userData == node)
174 behaviour->
name =
"confunc";
259 behaviour->
name =
"cvarlistener";
Share stuff between the different cgame implementations.
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
Callback every time the parent window is opened (pushed into the active window stack).
void onWindowClosed(uiNode_t *node) override
Callback every time the parent window is closed (pop from the active window stack).
void clone(uiNode_t const *source, uiNode_t *clone) override
void deleteNode(uiNode_t *node) override
Cleanup tasks on removing a console function.
void onLoaded(uiNode_t *node) override
Call after the script initialized the node.
void onWindowClosed(uiNode_t *node)
Callback every time the parent window is closed (pop from the active window stack).
void deleteNode(uiNode_t *node)
void clone(uiNode_t const *source, uiNode_t *clone)
void onWindowOpened(uiNode_t *node, linkedList_t *params)
void onLoaded(uiNode_t *node)
Call after the script initialized the node.
virtual void deleteNode(uiNode_t *node)
virtual void clone(uiNode_t const *source, uiNode_t *clone)
bool Cmd_Exists(const char *cmdName)
Checks whether a function exists already.
void Cmd_RemoveCommand(const char *cmdName)
Removes a command from script interface.
void Cmd_AddUserdata(const char *cmdName, void *userdata)
Adds userdata to the console command.
void * Cmd_GetUserdata(const char *cmdName)
Fetches the userdata for a console command.
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
void * Cmd_Userdata(void)
Return the userdata of the called command.
void Com_Printf(const char *const fmt,...)
cvarChangeListener_t * Cvar_RegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Registers a listener that is executed each time a cvar changed its value.
void Cvar_UnRegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Unregisters a cvar change listener.
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
linkedList_t * LIST_GetPointer(linkedList_t *list, const void *data)
Searches for the first occurrence of a given pointer.
void LIST_AddString(linkedList_t **listDest, const char *data)
Adds an string to a new or to an already existing linked list. The string is copied here.
void LIST_AddPointer(linkedList_t **listDest, void *data)
Adds just a pointer to a new or to an already existing linked list.
bool LIST_Remove(linkedList_t **list, const void *data)
bool LIST_IsEmpty(const linkedList_t *list)
Checks whether the given list is empty.
QGL_EXTERN GLsizei const GLvoid * data
T & Com_GetValue(void *const object, value_t const *const value)
Header for lua script functions.
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
cvarChangeListener_t * changeListener
struct cvarChangeListener_s * next
cvarChangeListenerFunc_t exec
Atomic element to store UI scripts The parser use this atom to translate script action into many tree...
node behaviour, how a node work
Contain the context of the calling of a function.
Atomic structure used to define most of the UI.
uiBehaviour_t * behaviour
struct uiAction_s * onClick
void UI_ExecuteEventActionsEx(uiNode_t *source, const uiAction_t *firstAction, linkedList_t *params)
void UI_RemoveListener(uiNode_t *node, const value_t *property, uiNode_t *functionNode)
Remove a function callback from a node event. There can be more than on listener.
void UI_AddListener(uiNode_t *node, const value_t *property, const uiNode_t *functionNode)
Add a callback of a function into a node event. There can be more than on listener.
void UI_ExecuteConFuncActions(uiNode_t *source, const uiAction_t *firstAction)
allow to inject command param into cmd of confunc command
const value_t * UI_GetPropertyFromBehaviour(const uiBehaviour_t *behaviour, const char *name)
Get a property from a behaviour or his inheritance It use a dichotomic search.
const struct value_s * UI_RegisterNodeMethod(uiBehaviour_t *behaviour, const char *name, uiNodeMethod_t function)
Register a node method to a behaviour.
bool UI_ExecuteLuaConFunc(uiNode_t *node, LUA_FUNCTION fcn)
Executes a lua based confunc node.
Basic lua initialization for the ui.
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
bool UI_NodeInstanceOf(const uiNode_t *node, const char *behaviourName)
Check the node inheritance.
SharedPtr< uiNode > UINodePtr
static bool UI_ConFuncIsVirtual(const uiNode_t *const node)
Checks whether the given node is a virtual confunc that can be overridden from inheriting nodes.
void UI_RegisterNullNode(uiBehaviour_t *behaviour)
static void UI_ConfuncCommand_f(void)
Callback to execute a confunc.
static void UI_CvarListenerNodeCallback(const char *cvarName, const char *oldValue, const char *newValue, void *data)
static void UI_CvarListenerNodeForceBind(uiNode_t *node, const uiCallContext_t *context)
void UI_RegisterCvarFuncNode(uiBehaviour_t *behaviour)
void UI_RegisterFuncNode(uiBehaviour_t *behaviour)
void UI_RegisterConFuncNode(uiBehaviour_t *behaviour)
static void UI_CvarListenerNodeBind(uiNode_t *node)
Callback every time the parent window is opened (pushed into the active window stack).
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.