UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_window.cpp
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#include "../ui_main.h"
27#include "../ui_parse.h"
28#include "../ui_font.h"
29#include "../ui_nodes.h"
30#include "../ui_internal.h"
31#include "../ui_render.h"
32#include "../ui_sprite.h"
33#include "../ui_lua.h"
34#include "ui_node_window.h"
35#include "ui_node_panel.h"
37
38#include "../../client.h" /* gettext _() */
40
41#define EXTRADATA_TYPE windowExtraData_t
42#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
43#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
44
45#define TOP_HEIGHT 30
46
47static const int CONTROLS_IMAGE_DIMENSIONS = 16;
48static const int CONTROLS_PADDING = 8;
49
50static const vec4_t modalBackground = {0, 0, 0, 0.6};
51static const vec4_t anamorphicBorder = {0, 0, 0, 1};
52
53static const char* WINDOW_FONT_BIG = "f_big";
54
55static const char* WINDOW_CLOSE_BUTTON_NAME = "close_window_button";
56static const char* WINDOW_DRAG_BUTTON_NAME = "move_window_button";
57
61void UI_Window_SetBackgroundByName (uiNode_t* node, const char* name) {
63 UI_EXTRADATA(node, windowExtraData_t).background = sprite;
64}
65
70uiNode_t* UI_WindowNodeGetIndexedChild (uiNode_t* const node, const char* childName)
71{
72 unsigned int hash = Com_HashKey(childName, INDEXEDCHILD_HASH_SIZE);
73 for (node_index_t* a = EXTRADATA(node).index_hash[hash]; a; a = a->hash_next) {
74 if (Q_streq(childName, a->node->name)) {
75 return a->node;
76 }
77 }
78 return nullptr;
79}
80
84bool UI_WindowNodeAddIndexedNode (uiNode_t* const node, uiNode_t* const child)
85{
86 node_index_t* a;
87 unsigned int hash = Com_HashKey(child->name, INDEXEDCHILD_HASH_SIZE);
88 for (a = EXTRADATA(node).index_hash[hash]; a; a = a->hash_next) {
89 if (Q_streq(child->name, a->node->name)) {
91 break;
92 }
93 }
94
95 if (!a) {
97 a->next = EXTRADATA(node).index;
98 a->hash_next = EXTRADATA(node).index_hash[hash];
99 EXTRADATA(node).index_hash[hash] = a;
100 EXTRADATA(node).index = a;
101 }
102
103 return false;
104}
105
109bool UI_WindowNodeRemoveIndexedNode (uiNode_t* const node, uiNode_t* const child)
110{
112 return false;
113}
114
118bool UI_WindowIsFullScreen (const uiNode_t* const node)
119{
120 assert(UI_NodeInstanceOf(node, "window"));
121 return EXTRADATACONST(node).isFullScreen;
122}
123
125{
126 const char* text;
127 vec2_t pos;
128 const char* font = UI_GetFontFromNode(node);
129
130 UI_GetNodeAbsPos(node, pos);
131
132 /* black border for anamorphic mode */
135 if (UI_WindowIsFullScreen(node)) {
136 /* top */
137 if (pos[1] != 0)
138 UI_DrawFill(0, 0, viddef.virtualWidth, pos[1], anamorphicBorder);
139 /* left-right */
140 if (pos[0] != 0)
141 UI_DrawFill(0, pos[1], pos[0], node->box.size[1], anamorphicBorder);
142 if (pos[0] + node->box.size[0] < viddef.virtualWidth) {
143 const int width = viddef.virtualWidth - (pos[0] + node->box.size[0]);
144 UI_DrawFill(viddef.virtualWidth - width, pos[1], width, node->box.size[1], anamorphicBorder);
145 }
146 /* bottom */
147 if (pos[1] + node->box.size[1] < viddef.virtualHeight) {
148 const int height = viddef.virtualHeight - (pos[1] + node->box.size[1]);
149 UI_DrawFill(0, viddef.virtualHeight - height, viddef.virtualWidth, height, anamorphicBorder);
150 }
151 }
152
153 /* hide background if window is modal */
154 if (EXTRADATA(node).modal && ui_global.windowStack[ui_global.windowStackPos - 1] == node)
155 UI_DrawFill(0, 0, viddef.virtualWidth, viddef.virtualHeight, modalBackground);
156
157 if (EXTRADATA(node).background) {
158 UI_DrawSpriteInBox(false, EXTRADATA(node).background, SPRITE_STATUS_NORMAL, pos[0], pos[1], node->box.size[0], node->box.size[1]);
159 }
160
161 /* draw the title */
162 text = UI_GetReferenceString(node, node->text);
163 if (text)
164 UI_DrawStringInBox(font, ALIGN_CC, pos[0] + node->padding, pos[1] + node->padding, node->box.size[0] - node->padding - node->padding, TOP_HEIGHT + 10 - node->padding - node->padding, text);
165}
166
169 EXTRADATA(node).lua_onWindowOpened = LUA_NOREF;
170 EXTRADATA(node).lua_onWindowClosed = LUA_NOREF;
171 EXTRADATA(node).lua_onWindowActivate = LUA_NOREF;
172 EXTRADATA(node).lua_onScriptLoaded = LUA_NOREF;
173}
174
180{
181 uiNode::deleteNode(node);
182 UI_RemoveWindow(node);
183}
184
186{
187 if (!node->invalidated)
188 return;
189
190 /* use a the space */
191 if (EXTRADATA(node).fill) {
192 if (node->box.size[0] != viddef.virtualWidth) {
193 node->box.size[0] = viddef.virtualWidth;
194 }
195 if (node->box.size[1] != viddef.virtualHeight) {
196 node->box.size[1] = viddef.virtualHeight;
197 }
198 }
199
200 /* move fullscreen window on the center of the screen */
201 if (UI_WindowIsFullScreen(node)) {
202 node->box.pos[0] = (int) ((viddef.virtualWidth - node->box.size[0]) / 2);
203 node->box.pos[1] = (int) ((viddef.virtualHeight - node->box.size[1]) / 2);
204 }
205
206 /* reposition the close button */
207 if (EXTRADATA(node).closeButton) {
209 control->box.pos[0] = node->box.size[0] - CONTROLS_PADDING - control->box.size[0];
210 }
211 /* resize the dragw button */
212 if (EXTRADATA(node).dragButton) {
214 control->box.size[0] = node->box.size[0];
215 }
216
218
219 if (EXTRADATA(node).starLayout) {
220 UI_StarLayout(node);
221 }
222
223 /* super */
225}
226
231{
232 uiLocatedNode::onWindowOpened(node, nullptr);
233
234 /* script callback */
235 if (EXTRADATA(node).onWindowOpened) {
237 }
238 if (EXTRADATA(node).lua_onWindowOpened != LUA_NOREF) {
239 UI_ExecuteLuaEventScript_ParamList(node, EXTRADATA(node).lua_onWindowOpened, params);
240 }
241
242 UI_Invalidate(node);
243}
244
249{
251
252 /* script callback */
253 if (EXTRADATA(node).onWindowClosed) {
255 }
256 if (EXTRADATA(node).lua_onWindowClosed != LUA_NOREF) {
257 UI_ExecuteLuaEventScript(node, EXTRADATA(node).lua_onWindowClosed);
258 }
259}
260
265{
267
268 /* script callback */
269 if (EXTRADATA(node).onWindowActivate) {
271 }
272 if (EXTRADATA(node).lua_onWindowActivate != LUA_NOREF) {
273 UI_ExecuteLuaEventScript(node, EXTRADATA(node).lua_onWindowActivate);
274 }
275}
276
279
280 /* check for fullscreen window */
281 if (EXTRADATA(node).fill) {
282 node->box.size[0] = viddef.virtualWidth;
283 node->box.size[1] = viddef.virtualHeight;
284 }
286}
287
292{
293 if (EXTRADATA(node).fill) {
294 node->box.size[0] = viddef.virtualWidth;
295 node->box.size[1] = viddef.virtualHeight;
296 } else {
297 node->box.size[0] = VID_NORM_WIDTH;
298 node->box.size[1] = VID_NORM_HEIGHT;
299 }
300 node->font = const_cast<char*>(WINDOW_FONT_BIG);
301 node->padding = 5;
302}
303
308void UI_Window_SetCloseButton (uiNode_t* node, bool value) {
309 if (value) {
310 uiNode_t* control = UI_AllocNode(WINDOW_CLOSE_BUTTON_NAME, "button", node->dynamic);
311 const int positionFromRight = CONTROLS_PADDING;
312 static const char* closeCommand = "ui_close <path:root>;";
313
314 control->root = node;
315 UI_NodeSetProperty(control, UI_GetPropertyFromBehaviour(control->behaviour, "icon"), "icons/system_close");
317 control->box.size[0] = CONTROLS_IMAGE_DIMENSIONS;
318 control->box.size[1] = CONTROLS_IMAGE_DIMENSIONS;
319 control->box.pos[0] = node->box.size[0] - positionFromRight - control->box.size[0];
320 control->box.pos[1] = CONTROLS_PADDING;
321 control->tooltip = _("Close the window");
322 control->onClick = UI_AllocStaticCommandAction(closeCommand);
323 UI_AppendNode(node, control);
324 }
325 else {
326 // drop the close node
328 if (control) {
329 UI_RemoveNode (node, control);
330 }
331 }
332 EXTRADATA(node).closeButton = value;
333}
334
338void UI_Window_SetDragButton (uiNode_t* node, bool value) {
339 if (value) {
340 // create the drag node
341 uiNode_t* control = UI_AllocNode(WINDOW_DRAG_BUTTON_NAME, "controls", node->dynamic);
342 control->root = node;
343 control->box.size[0] = node->box.size[0];
344 control->box.size[1] = TOP_HEIGHT;
345 control->box.pos[0] = 0;
346 control->box.pos[1] = 0;
347 control->tooltip = _("Drag to move window");
348 /* if there is a close button already on this windown, then insert the drag button before the close
349 button; this is needed so the drag button is "below" the close button; if we don't do this, the
350 drag button recieves input events for the close button first making the close button no longer
351 working */
353 if (close != nullptr) {
354 // get the previous node of close
355 close = UI_GetPrevNode(close);
356 UI_InsertNode(node, close, control);
357 }
358 else {
359 UI_AppendNode(node, control);
360 }
361 }
362 else {
363 // drop the drag node
365 if (control) {
366 UI_RemoveNode (node, control);
367 }
368 }
369 EXTRADATA(node).dragButton = value;
370}
371
376{
377 /* note: the order here is important, first the drag button, then the close button otherwise the drag button
378 will be over the close button and the close button will no longer recieve input events */
379 UI_Window_SetDragButton(node, EXTRADATA(node).dragButton);
380 UI_Window_SetCloseButton (node, EXTRADATA(node).closeButton);
382
383 if (EXTRADATA(node).starLayout)
384 UI_Invalidate(node);
385}
386
392 EXTRADATA(node).isFullScreen = (node->box.size[0] >= VID_NORM_WIDTH) && (node->box.size[1] >= VID_NORM_HEIGHT);
393}
394
396{
398 /* clean up index */
399 EXTRADATA(clone).index = nullptr;
400 OBJZERO(EXTRADATA(clone).index_hash);
401}
402
409{
410 if (Vector2Empty(EXTRADATA(node).noticePos))
411 return nullptr;
412 return EXTRADATA(node).noticePos;
413}
414
420bool UI_WindowIsDropDown(uiNode_t const* const node)
421{
422 return EXTRADATACONST(node).dropdown;
423}
424
430bool UI_WindowIsModal(uiNode_t const* const node)
431{
432 return EXTRADATACONST(node).modal;
433}
434
443{
444 assert(UI_NodeInstanceOf(node, "window"));
445 binding->next = EXTRADATA(node).keyList;
446 EXTRADATA(node).keyList = binding;
447}
448
450
457uiKeyBinding_t* UI_WindowNodeGetKeyBinding (uiNode_t const* const node, unsigned int key)
458{
459 uiKeyBinding_t* binding = EXTRADATACONST(node).keyList;
460 assert(UI_NodeInstanceOf(node, "window"));
461 while (binding) {
462 if (binding->key == key)
463 break;
464 binding = binding->next;
465 }
466 return binding;
467}
468
469void uiWindowNode::setFill (uiNode_t* node, bool value) {
470 UI_EXTRADATA(node, windowExtraData_t).fill = value;
471 onSizeChanged(node);
472}
473
475{
476 behaviour->name = "window";
477 behaviour->manager = UINodePtr(new uiWindowNode());
478 behaviour->extraDataSize = sizeof(EXTRADATA_TYPE);
479 behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiWindowNode_t *");
480
481 /* In windows where notify messages appear (like e.g. the video options window when you have to restart the game until
482 * the settings take effects) you can define the position of those messages with this option. */
483 UI_RegisterExtradataNodeProperty(behaviour, "noticepos", V_POS, windowExtraData_t, noticePos);
484 /* Create subnode allowing to move the window when we click on the header. Updating this attribute at runtime will change nothing. */
485 UI_RegisterExtradataNodeProperty(behaviour, "dragbutton", V_BOOL, windowExtraData_t, dragButton);
486 /* Add a button on the top right the window to close it. Updating this attribute at runtime will change nothing. */
487 UI_RegisterExtradataNodeProperty(behaviour, "closebutton", V_BOOL, windowExtraData_t, closeButton);
488 /* If true, the user can't select something outside the modal window. He must first close the window. */
489 UI_RegisterExtradataNodeProperty(behaviour, "modal", V_BOOL, windowExtraData_t, modal);
490 /* If true, the window will be closed if the user clicks outside of the window. */
491 UI_RegisterExtradataNodeProperty(behaviour, "dropdown", V_BOOL, windowExtraData_t, dropdown);
492 /* If true, the user can't use ''ESC'' key to close the window. */
493 UI_RegisterExtradataNodeProperty(behaviour, "preventtypingescape", V_BOOL, windowExtraData_t, preventTypingEscape);
494 /* If true, the window is filled according to the widescreen. */
496 /* If true, the window content position is updated according to the "star" layout when the window size change.
497 * @todo Need more documentation.
498 */
499 UI_RegisterExtradataNodeProperty(behaviour, "starlayout", V_BOOL, windowExtraData_t, starLayout);
500
501 /* Invoked when the window is added to the rendering stack. */
502 UI_RegisterExtradataNodeProperty(behaviour, "onWindowOpened", V_UI_ACTION, windowExtraData_t, onWindowOpened);
503 /* Invoked when the window is removed from the rendering stack. */
504 UI_RegisterExtradataNodeProperty(behaviour, "onWindowClosed", V_UI_ACTION, windowExtraData_t, onWindowClosed);
505 /* Called when a windows gets active again after some other window was popped from the stack. */
506 UI_RegisterExtradataNodeProperty(behaviour, "onWindowActivate", V_UI_ACTION, windowExtraData_t, onWindowActivate);
507 /* Invoked after all UI scripts are loaded. */
508 UI_RegisterExtradataNodeProperty(behaviour, "onScriptLoaded", V_UI_ACTION, windowExtraData_t, onScriptLoaded);
509
510 /* Sprite used to display the background */
511 UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background);
512}
unsigned int key
Definition cl_input.cpp:64
#define VID_NORM_WIDTH
Definition cl_renderer.h:40
#define VID_NORM_HEIGHT
Definition cl_renderer.h:41
#define _(String)
Definition cl_shared.h:44
viddef_t viddef
Definition cl_video.cpp:34
virtual void doLayout(uiNode_t *node)
Call to update the node layout. This common code revalidates the node tree.
virtual void onWindowClosed(uiNode_t *node)
virtual void onWindowOpened(uiNode_t *node, linkedList_t *params)
virtual void deleteNode(uiNode_t *node)
virtual void onWindowActivate(uiNode_t *node)
virtual void clone(uiNode_t const *source, uiNode_t *clone)
virtual void initNode(uiNode_t *node)
void onWindowClosed(uiNode_t *node) override
Called when we close the node on the screen.
void deleteNode(uiNode_t *node) override
Actions to do on deleting the node.
void setFill(uiNode_t *node, bool value)
void onLoading(uiNode_t *node) override
Called at the begin of the load from script.
void clone(uiNode_t const *source, uiNode_t *clone) override
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
Called when we init the node on the screen.
void onSizeChanged(uiNode_t *node) override
Callback stub.
void onWindowActivate(uiNode_t *node) override
Called when a windows gets active again after some other window was popped from the stack.
void onLoaded(uiNode_t *node) override
Called at the end of the load from script.
void initNode(uiNode_t *node) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
void draw(uiNode_t *node) override
Primary header for client.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define Mem_PoolAllocType(type, pool)
Definition mem.h:43
static wrapCache_t * hash[MAX_WRAP_HASH]
Definition r_font.cpp:86
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
@ ALIGN_CC
Definition scripts.h:94
@ V_BOOL
Definition scripts.h:50
@ V_POS
Definition scripts.h:55
Header for lua script functions.
#define Q_streq(a, b)
Definition shared.h:136
#define OBJZERO(obj)
Definition shared.h:178
unsigned int Com_HashKey(const char *name, int hashsize)
returns hash key for a string
Definition shared.cpp:336
struct node_index_s * next
uiNode_t * node
struct node_index_s * hash_next
node behaviour, how a node work
const char * name
void * lua_SWIG_typeinfo
UINodePtr manager
intptr_t extraDataSize
vec2_t size
Definition ui_nodes.h:52
vec2_t pos
Definition ui_nodes.h:51
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
char * tooltip
Definition ui_nodes.h:99
char * text
Definition ui_nodes.h:121
bool invalidated
Definition ui_nodes.h:104
uiBehaviour_t * behaviour
Definition ui_nodes.h:83
char * font
Definition ui_nodes.h:122
bool dynamic
Definition ui_nodes.h:85
uiBox_t box
Definition ui_nodes.h:96
char name[MAX_VAR]
Definition ui_nodes.h:82
int padding
Definition ui_nodes.h:109
struct uiAction_s * onClick
Definition ui_nodes.h:135
uiNode_t * root
Definition ui_nodes.h:93
extradata for the window node
float vec_t
Definition ufotypes.h:37
vec_t vec4_t[4]
Definition ufotypes.h:40
vec_t vec2_t[2]
Definition ufotypes.h:38
void UI_ExecuteEventActionsEx(uiNode_t *source, const uiAction_t *firstAction, linkedList_t *params)
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
uiAction_t * UI_AllocStaticCommandAction(const char *command)
Allocate and initialize a command action.
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.
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
Definition ui_font.cpp:145
Internal data use by the UI package.
memPool_t * ui_sysPool
Definition ui_main.cpp:42
uiGlobal_t ui_global
Definition ui_main.cpp:38
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
Definition ui_lua.cpp:71
bool UI_ExecuteLuaEventScript_ParamList(uiNode_t *node, LUA_EVENT event, linkedList_t *params)
Executes a lua event handler with string parameter list.
Definition ui_lua.cpp:91
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.
Definition ui_node.cpp:453
uiNode_t * UI_GetPrevNode(const uiNode_t *node)
Returns the previous node based on the order of nodes in the parent.
Definition ui_node.cpp:733
void UI_InsertNode(uiNode_t *const parent, uiNode_t *prevNode, uiNode_t *newNode)
Insert a node next another one into a node. If prevNode is nullptr add the node on the head of the wi...
Definition ui_node.cpp:764
uiNode_t * UI_RemoveNode(uiNode_t *const node, uiNode_t *child)
Remove a node from a parent node.
Definition ui_node.cpp:802
void UI_Invalidate(uiNode_t *node)
Invalidate a node and all his parent to request a layout update.
Definition ui_node.cpp:1065
uiNode_t * UI_FindNode(const uiNode_t *node, const char *name)
Recursive searches for a child node by name in the entire subtree.
Definition ui_node.cpp:745
void UI_AppendNode(uiNode_t *const parent, uiNode_t *newNode)
add a node at the end of the node child
Definition ui_node.cpp:868
void UI_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
Definition ui_node.cpp:526
bool UI_NodeSetProperty(uiNode_t *node, const value_t *property, const char *value)
Set node property.
Definition ui_node.cpp:902
SharedPtr< uiNode > UINodePtr
#define EXTRADATA_TYPE
#define EXTRADATA(node)
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
static const char * WINDOW_CLOSE_BUTTON_NAME
void UI_RegisterWindowNode(uiBehaviour_t *behaviour)
bool UI_WindowIsModal(uiNode_t const *const node)
True if the window is a modal.
static const int CONTROLS_IMAGE_DIMENSIONS
static const char * WINDOW_FONT_BIG
void UI_Window_SetBackgroundByName(uiNode_t *node, const char *name)
set background sprite
static const int CONTROLS_PADDING
void UI_Window_FlagFullscreen(uiNode_t *node)
If the node size equals the full screen size, flag the node as isFullscreen, so it is displayed prope...
void UI_WindowNodeRegisterKeyBinding(uiNode_t *node, uiKeyBinding_t *binding)
Add a key binding to a window node. Window node store key bindings for his node child.
void UI_Window_SetCloseButton(uiNode_t *node, bool value)
Create/remove close button on window.
uiKeyBinding_t * UI_WindowNodeGetKeyBinding(uiNode_t const *const node, unsigned int key)
Search a a key binding from a window node. Window node store key bindings for his node child.
bool UI_WindowIsFullScreen(const uiNode_t *const node)
Check if a window is fullscreen or not.
bool UI_WindowIsDropDown(uiNode_t const *const node)
True if the window is a drop down.
vec_t * UI_WindowNodeGetNoticePosition(uiNode_t *node)
Get the noticePosition from a window node.
#define EXTRADATA(node)
static const char * WINDOW_DRAG_BUTTON_NAME
static const vec4_t modalBackground
const uiKeyBinding_t * binding
static const vec4_t anamorphicBorder
bool UI_WindowNodeAddIndexedNode(uiNode_t *const node, uiNode_t *const child)
Add a node to the child index.
uiNode_t * UI_WindowNodeGetIndexedChild(uiNode_t *const node, const char *childName)
Get a node from child index.
#define EXTRADATACONST(node)
#define TOP_HEIGHT
void UI_Window_SetDragButton(uiNode_t *node, bool value)
Create/remove drag button.
bool UI_WindowNodeRemoveIndexedNode(uiNode_t *const node, uiNode_t *const child)
Remove a node from the child index.
#define INDEXEDCHILD_HASH_SIZE
void UI_Window_FlagFullscreen(uiNode_t *node)
If the node size equals the full screen size, flag the node as isFullscreen, so it is displayed prope...
void UI_Window_SetCloseButton(uiNode_t *node, bool value)
Create/remove close button on window.
bool UI_WindowIsFullScreen(uiNode_t const *window)
Check if a window is fullscreen or not.
void UI_Window_SetDragButton(uiNode_t *node, bool value)
Create/remove drag button.
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
Definition ui_nodes.cpp:381
#define UI_EXTRADATA(NODE, TYPE)
Definition ui_nodes.h:185
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
#define V_UI_SPRITEREF
Definition ui_parse.h:56
#define V_UI_ACTION
Definition ui_parse.h:54
int UI_DrawStringInBox(const char *fontID, align_t align, int x, int y, int width, int height, const char *text, longlines_t method)
draw a line into a bounding box
void UI_DrawFill(int x, int y, int w, int h, const vec4_t color)
Fills a box of pixels with a single color.
Definition ui_render.cpp:37
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.
@ SPRITE_STATUS_NORMAL
Definition ui_sprite.h:33
void UI_RemoveWindow(uiNode_t *window)
Removes a window from the list of all windows.
#define Vector2Empty(a)
Definition vector.h:74