25 #include "../../cl_shared.h"
26 #include "../ui_nodes.h"
27 #include "../ui_parse.h"
28 #include "../ui_actions.h"
29 #include "../ui_behaviour.h"
30 #include "../ui_lua.h"
35 #include "../../../common/scripts_lua.h"
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";
void UI_RegisterFuncNode(uiBehaviour_t *behaviour)
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
bool UI_ExecuteLuaConFunc(uiNode_t *node, LUA_FUNCTION fcn)
Executes a lua based confunc node.
cvarChangeListener_t * Cvar_RegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Registers a listener that is executed each time a cvar changed its value.
void Cmd_RemoveCommand(const char *cmdName)
Removes a command from script interface.
bool UI_NodeInstanceOf(const uiNode_t *node, const char *behaviourName)
Check the node inheritance.
void Cvar_UnRegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Unregisters a cvar change listener.
static void UI_CvarListenerNodeBind(uiNode_t *node)
Callback every time the parent window is opened (pushed into the active window stack) ...
void onLoaded(uiNode_t *node) override
Call after the script initialized the node.
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
uiBehaviour_t * behaviour
void deleteNode(uiNode_t *node)
void UI_RegisterNullNode(uiBehaviour_t *behaviour)
void Com_Printf(const char *const fmt,...)
virtual void clone(uiNode_t const *source, uiNode_t *clone)
struct uiAction_s * onClick
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.
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
void onLoaded(uiNode_t *node)
Call after the script initialized the node.
void * Cmd_Userdata(void)
Return the userdata of the called command.
cvarChangeListenerFunc_t exec
bool LIST_Remove(linkedList_t **list, const void *data)
void * Cmd_GetUserdata(const char *cmdName)
Fetches the userdata for a console command.
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...
bool Cmd_Exists(const char *cmdName)
Checks whether a function exists already.
void UI_ExecuteEventActionsEx(uiNode_t *source, const uiAction_t *firstAction, linkedList_t *params)
SharedPtr< uiNode > UINodePtr
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.
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.
static void UI_CvarListenerNodeForceBind(uiNode_t *node, const uiCallContext_t *context)
static void UI_ConfuncCommand_f(void)
Callback to execute a confunc.
Atomic structure used to define most of the UI.
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
Callback every time the parent window is opened (pushed into the active window stack) ...
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_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void deleteNode(uiNode_t *node) override
Cleanup tasks on removing a console function.
void onWindowClosed(uiNode_t *node)
Callback every time the parent window is closed (pop from the active window stack) ...
Contain the context of the calling of a function.
void Cmd_AddUserdata(const char *cmdName, void *userdata)
Adds userdata to the console command.
void UI_ExecuteConFuncActions(uiNode_t *source, const uiAction_t *firstAction)
allow to inject command param into cmd of confunc command
cvarChangeListener_t * changeListener
node behaviour, how a node work
void UI_RegisterCvarFuncNode(uiBehaviour_t *behaviour)
void clone(uiNode_t const *source, uiNode_t *clone) override
void onWindowClosed(uiNode_t *node) override
Callback every time the parent window is closed (pop from the active window stack) ...
linkedList_t * LIST_GetPointer(linkedList_t *list, const void *data)
Searches for the first occurrence of a given pointer.
static void UI_CvarListenerNodeCallback(const char *cvarName, const char *oldValue, const char *newValue, void *data)
virtual void deleteNode(uiNode_t *node)
void clone(uiNode_t const *source, uiNode_t *clone)
GLsizei const GLvoid * data
struct cvarChangeListener_s * next
bool LIST_IsEmpty(const linkedList_t *list)
Checks whether the given list is empty.
void UI_RegisterConFuncNode(uiBehaviour_t *behaviour)
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. ...
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
Atomic element to store UI scripts The parser use this atom to translate script action into many tree...
void onWindowOpened(uiNode_t *node, linkedList_t *params)
void LIST_AddPointer(linkedList_t **listDest, void *data)
Adds just a pointer to a new or to an already existing linked list.
const struct value_s * UI_RegisterNodeMethod(uiBehaviour_t *behaviour, const char *name, uiNodeMethod_t function)
Register a node method to a behaviour.