Quake II RTX doxygen  1.0 dev
ui.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2006 Andrey Nazarov
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #include "ui.h"
20 #include "client/input.h"
21 #include "../client.h"
22 #include "common/prompt.h"
23 
25 
27 
28 cvar_t *ui_debug;
29 static cvar_t *ui_open;
30 static cvar_t *ui_scale;
31 
32 // ===========================================================================
33 
34 /*
35 =================
36 UI_PushMenu
37 =================
38 */
40 {
41  int i, j;
42 
43  if (!menu) {
44  return;
45  }
46 
47  // if this menu is already present, drop back to that level
48  // to avoid stacking menus by hotkeys
49  for (i = 0; i < uis.menuDepth; i++) {
50  if (uis.layers[i] == menu) {
51  break;
52  }
53  }
54 
55  if (i == uis.menuDepth) {
56  if (uis.menuDepth >= MAX_MENU_DEPTH) {
57  Com_EPrintf("UI_PushMenu: MAX_MENU_DEPTH exceeded\n");
58  return;
59  }
60  uis.layers[uis.menuDepth++] = menu;
61  } else {
62  for (j = i; j < uis.menuDepth; j++) {
63  UI_PopMenu();
64  }
65  uis.menuDepth = i + 1;
66  }
67 
68  if (menu->push && !menu->push(menu)) {
69  uis.menuDepth--;
70  return;
71  }
72 
73  Menu_Init(menu);
74 
75  Key_SetDest((Key_GetDest() & ~KEY_CONSOLE) | KEY_MENU);
76 
77  Con_Close(qtrue);
78 
79  if (!uis.activeMenu) {
80  // opening menu moves cursor to the nice location
81  IN_WarpMouse(menu->mins[0] / uis.scale, menu->mins[1] / uis.scale);
82 
83  uis.mouseCoords[0] = menu->mins[0];
84  uis.mouseCoords[1] = menu->mins[1];
85 
86  uis.entersound = qtrue;
87  }
88 
89  uis.activeMenu = menu;
90 
91  UI_DoHitTest();
92 
93  if (menu->expose) {
94  menu->expose(menu);
95  }
96 }
97 
98 static void UI_Resize(void)
99 {
100  int i;
101 
103  uis.width = r_config.width * uis.scale;
104  uis.height = r_config.height * uis.scale;
105 
106  for (i = 0; i < uis.menuDepth; i++) {
107  Menu_Init(uis.layers[i]);
108  }
109 
110  //CL_WarpMouse(0, 0);
111 }
112 
113 
114 /*
115 =================
116 UI_ForceMenuOff
117 =================
118 */
119 void UI_ForceMenuOff(void)
120 {
121  menuFrameWork_t *menu;
122  int i;
123 
124  for (i = 0; i < uis.menuDepth; i++) {
125  menu = uis.layers[i];
126  if (menu->pop) {
127  menu->pop(menu);
128  }
129  }
130 
131  Key_SetDest(Key_GetDest() & ~KEY_MENU);
132  uis.menuDepth = 0;
133  uis.activeMenu = NULL;
134  uis.mouseTracker = NULL;
135  uis.transparent = qfalse;
136 }
137 
138 /*
139 =================
140 UI_PopMenu
141 =================
142 */
143 void UI_PopMenu(void)
144 {
145  menuFrameWork_t *menu;
146 
147  if (uis.menuDepth < 1)
148  Com_Error(ERR_FATAL, "UI_PopMenu: depth < 1");
149 
150  menu = uis.layers[--uis.menuDepth];
151  if (menu->pop) {
152  menu->pop(menu);
153  }
154 
155  if (!uis.menuDepth) {
156  UI_ForceMenuOff();
157 
158  // Save the config file if the user closes the menu while in-game
159  if (cls.state >= ca_active) {
160  CL_WriteConfig();
161  }
162 
163  return;
164  }
165 
167  uis.mouseTracker = NULL;
168 
169  UI_DoHitTest();
170 }
171 
172 /*
173 =================
174 UI_IsTransparent
175 =================
176 */
177 qboolean UI_IsTransparent(void)
178 {
179  if (!(Key_GetDest() & KEY_MENU)) {
180  return qtrue;
181  }
182 
183  if (!uis.activeMenu) {
184  return qtrue;
185  }
186 
187  return uis.activeMenu->transparent;
188 }
189 
190 menuFrameWork_t *UI_FindMenu(const char *name)
191 {
192  menuFrameWork_t *menu;
193 
194  LIST_FOR_EACH(menuFrameWork_t, menu, &ui_menus, entry) {
195  if (!strcmp(menu->name, name)) {
196  return menu;
197  }
198  }
199 
200  return NULL;
201 }
202 
203 /*
204 =================
205 UI_OpenMenu
206 =================
207 */
208 void UI_OpenMenu(uiMenu_t type)
209 {
210  menuFrameWork_t *menu = NULL;
211 
212  if (!uis.initialized) {
213  return;
214  }
215 
216  // close any existing menus
217  UI_ForceMenuOff();
218 
219  switch (type) {
220  case UIMENU_DEFAULT:
221  if (ui_open->integer) {
222  menu = UI_FindMenu("main");
223  }
224  break;
225  case UIMENU_MAIN:
226  menu = UI_FindMenu("main");
227  break;
228  case UIMENU_GAME:
229  menu = UI_FindMenu("game");
230  if (!menu) {
231  menu = UI_FindMenu("main");
232  }
233  break;
234  case UIMENU_NONE:
235  break;
236  default:
237  Com_Error(ERR_FATAL, "UI_OpenMenu: bad menu");
238  break;
239  }
240 
241  UI_PushMenu(menu);
242 }
243 
244 //=============================================================================
245 
246 /*
247 =================
248 UI_FormatColumns
249 =================
250 */
251 void *UI_FormatColumns(int extrasize, ...)
252 {
253  va_list argptr;
254  char *buffer, *p;
255  int i, j;
256  size_t total = 0;
257  char *strings[MAX_COLUMNS];
258  size_t lengths[MAX_COLUMNS];
259 
260  va_start(argptr, extrasize);
261  for (i = 0; i < MAX_COLUMNS; i++) {
262  if ((p = va_arg(argptr, char *)) == NULL) {
263  break;
264  }
265  strings[i] = p;
266  total += lengths[i] = strlen(p) + 1;
267  }
268  va_end(argptr);
269 
270  buffer = UI_Malloc(extrasize + total + 1);
271  p = buffer + extrasize;
272  for (j = 0; j < i; j++) {
273  memcpy(p, strings[j], lengths[j]);
274  p += lengths[j];
275  }
276  *p = 0;
277 
278  return buffer;
279 }
280 
281 char *UI_GetColumn(char *s, int n)
282 {
283  int i;
284 
285  for (i = 0; i < n && *s; i++) {
286  s += strlen(s) + 1;
287  }
288 
289  return s;
290 }
291 
292 /*
293 =================
294 UI_CursorInRect
295 =================
296 */
297 qboolean UI_CursorInRect(vrect_t *rect)
298 {
299  if (uis.mouseCoords[0] < rect->x) {
300  return qfalse;
301  }
302  if (uis.mouseCoords[0] >= rect->x + rect->width) {
303  return qfalse;
304  }
305  if (uis.mouseCoords[1] < rect->y) {
306  return qfalse;
307  }
308  if (uis.mouseCoords[1] >= rect->y + rect->height) {
309  return qfalse;
310  }
311  return qtrue;
312 }
313 
314 void UI_DrawString(int x, int y, int flags, const char *string)
315 {
316  if ((flags & UI_CENTER) == UI_CENTER) {
317  x -= strlen(string) * CHAR_WIDTH / 2;
318  } else if (flags & UI_RIGHT) {
319  x -= strlen(string) * CHAR_WIDTH;
320  }
321 
322  R_DrawString(x, y, flags, MAX_STRING_CHARS, string, uis.fontHandle);
323 }
324 
325 void UI_DrawChar(int x, int y, int flags, int ch)
326 {
327  R_DrawChar(x, y, flags, ch, uis.fontHandle);
328 }
329 
330 void UI_StringDimensions(vrect_t *rc, int flags, const char *string)
331 {
332  rc->height = CHAR_HEIGHT;
333  rc->width = CHAR_WIDTH * strlen(string);
334 
335  if ((flags & UI_CENTER) == UI_CENTER) {
336  rc->x -= rc->width / 2;
337  } else if (flags & UI_RIGHT) {
338  rc->x -= rc->width;
339  }
340 }
341 
342 void UI_DrawRect8(const vrect_t *rc, int border, int c)
343 {
344  R_DrawFill8(rc->x, rc->y, border, rc->height, c); // left
345  R_DrawFill8(rc->x + rc->width - border, rc->y, border, rc->height, c); // right
346  R_DrawFill8(rc->x + border, rc->y, rc->width - border * 2, border, c); // top
347  R_DrawFill8(rc->x + border, rc->y + rc->height - border, rc->width - border * 2, border, c); // bottom
348 }
349 
350 #if 0
351 void UI_DrawRect32(const vrect_t *rc, int border, uint32_t color)
352 {
353  R_DrawFill32(rc->x, rc->y, border, rc->height, color); // left
354  R_DrawFill32(rc->x + rc->width - border, rc->y, border, rc->height, color); // right
355  R_DrawFill32(rc->x + border, rc->y, rc->width - border * 2, border, color); // top
356  R_DrawFill32(rc->x + border, rc->y + rc->height - border, rc->width - border * 2, border, color); // bottom
357 }
358 #endif
359 
360 //=============================================================================
361 /* Menu Subsystem */
362 
363 /*
364 =================
365 UI_DoHitTest
366 =================
367 */
368 qboolean UI_DoHitTest(void)
369 {
370  menuCommon_t *item;
371 
372  if (!uis.activeMenu) {
373  return qfalse;
374  }
375 
376  if (uis.mouseTracker) {
377  item = uis.mouseTracker;
378  } else {
379  if (!(item = Menu_HitTest(uis.activeMenu))) {
380  return qfalse;
381  }
382  }
383 
384  if (!UI_IsItemSelectable(item)) {
385  return qfalse;
386  }
387 
388  Menu_MouseMove(item);
389 
390  if (item->flags & QMF_HASFOCUS) {
391  return qfalse;
392  }
393 
394  Menu_SetFocus(item);
395 
396  return qtrue;
397 }
398 
399 /*
400 =================
401 UI_MouseEvent
402 =================
403 */
404 void UI_MouseEvent(int x, int y)
405 {
406  clamp(x, 0, r_config.width - 1);
407  clamp(y, 0, r_config.height - 1);
408 
409  uis.mouseCoords[0] = Q_rint(x * uis.scale);
410  uis.mouseCoords[1] = Q_rint(y * uis.scale);
411 
412  UI_DoHitTest();
413 }
414 
415 /*
416 =================
417 UI_Draw
418 =================
419 */
420 void UI_Draw(int realtime)
421 {
422  int i;
423 
424  uis.realtime = realtime;
425 
426  if (!(Key_GetDest() & KEY_MENU)) {
427  return;
428  }
429 
430  if (!uis.activeMenu) {
431  return;
432  }
433 
434  R_ClearColor();
436 
437  if (1) {
438  // draw top menu
439  if (uis.activeMenu->draw) {
441  } else {
443  }
444  } else {
445  // draw all layers
446  for (i = 0; i < uis.menuDepth; i++) {
447  if (uis.layers[i]->draw) {
448  uis.layers[i]->draw(uis.layers[i]);
449  } else {
450  Menu_Draw(uis.layers[i]);
451  }
452  }
453  }
454 
455  // draw custom cursor in fullscreen mode
456  if (r_config.flags & QVF_FULLSCREEN) {
459  }
460 
461  if (ui_debug->integer) {
462  UI_DrawString(uis.width - 4, 4, UI_RIGHT,
463  va("%3i %3i", uis.mouseCoords[0], uis.mouseCoords[1]));
464  }
465 
466  // delay playing the enter sound until after the
467  // menu has been drawn, to avoid delay while
468  // caching images
469  if (uis.entersound) {
470  uis.entersound = qfalse;
471  S_StartLocalSound("misc/menu1.wav");
472  }
473 
474  R_ClearColor();
475  R_SetScale(1.0f);
476 }
477 
479 {
480  switch (sound) {
481  case QMS_IN:
482  S_StartLocalSound("misc/menu1.wav");
483  break;
484  case QMS_MOVE:
485  S_StartLocalSound("misc/menu2.wav");
486  break;
487  case QMS_OUT:
488  S_StartLocalSound("misc/menu3.wav");
489  break;
490  case QMS_BEEP:
491  S_StartLocalSound("misc/talk1.wav");
492  break;
493  default:
494  break;
495  }
496 }
497 
498 /*
499 =================
500 UI_KeyEvent
501 =================
502 */
503 void UI_KeyEvent(int key, qboolean down)
504 {
505  menuSound_t sound;
506 
507  if (!uis.activeMenu) {
508  return;
509  }
510 
511  if (!down) {
512  if (key == K_MOUSE1) {
513  uis.mouseTracker = NULL;
514  }
515  return;
516  }
517 
518  sound = Menu_Keydown(uis.activeMenu, key);
519 
520  UI_StartSound(sound);
521 }
522 
523 /*
524 =================
525 UI_CharEvent
526 =================
527 */
528 void UI_CharEvent(int key)
529 {
530  menuCommon_t *item;
531  menuSound_t sound;
532 
533  if (!uis.activeMenu) {
534  return;
535  }
536 
537  if ((item = Menu_ItemAtCursor(uis.activeMenu)) == NULL ||
538  (sound = Menu_CharEvent(item, key)) == QMS_NOTHANDLED) {
539  return;
540  }
541 
542  UI_StartSound(sound);
543 }
544 
545 static void UI_Menu_g(genctx_t *ctx)
546 {
547  menuFrameWork_t *menu;
548 
549  LIST_FOR_EACH(menuFrameWork_t, menu, &ui_menus, entry) {
550  if (!Prompt_AddMatch(ctx, menu->name)) {
551  break;
552  }
553  }
554 }
555 
556 static void UI_PushMenu_c(genctx_t *ctx, int argnum)
557 {
558  if (argnum == 1) {
559  UI_Menu_g(ctx);
560  }
561 }
562 
563 static void UI_PushMenu_f(void)
564 {
565  menuFrameWork_t *menu;
566  char *s;
567 
568  if (Cmd_Argc() < 2) {
569  Com_Printf("Usage: %s <menu>\n", Cmd_Argv(0));
570  return;
571  }
572  s = Cmd_Argv(1);
573  menu = UI_FindMenu(s);
574  if (menu) {
575  UI_PushMenu(menu);
576  } else {
577  Com_Printf("No such menu: %s\n", s);
578  }
579 }
580 
581 static void UI_PopMenu_f(void)
582 {
583  if (uis.activeMenu) {
584  UI_PopMenu();
585  }
586 }
587 
588 
589 static const cmdreg_t c_ui[] = {
590  { "forcemenuoff", UI_ForceMenuOff },
591  { "pushmenu", UI_PushMenu_f, UI_PushMenu_c },
592  { "popmenu", UI_PopMenu_f },
593 
594  { NULL, NULL }
595 };
596 
597 static void ui_scale_changed(cvar_t *self)
598 {
599  UI_Resize();
600 }
601 
602 void UI_ModeChanged(void)
603 {
604  ui_scale = Cvar_Get("ui_scale", "2", 0);
605  ui_scale->changed = ui_scale_changed;
606  UI_Resize();
607 }
608 
609 static void UI_FreeMenus(void)
610 {
611  menuFrameWork_t *menu, *next;
612 
613  LIST_FOR_EACH_SAFE(menuFrameWork_t, menu, next, &ui_menus, entry) {
614  if (menu->free) {
615  menu->free(menu);
616  }
617  }
618  List_Init(&ui_menus);
619 }
620 
621 
622 /*
623 =================
624 UI_Init
625 =================
626 */
627 void UI_Init(void)
628 {
629  char buffer[MAX_QPATH];
630  int i;
631 
633 
634  ui_debug = Cvar_Get("ui_debug", "0", 0);
635  ui_open = Cvar_Get("ui_open", "1", 0);
636 
637  UI_ModeChanged();
638 
639  uis.fontHandle = R_RegisterFont("conchars");
640  uis.cursorHandle = R_RegisterPic("ch1");
642 
643  for (i = 0; i < NUM_CURSOR_FRAMES; i++) {
644  Q_snprintf(buffer, sizeof(buffer), "m_cursor%d", i);
645  uis.bitmapCursors[i] = R_RegisterPic(buffer);
646  }
647 
648  uis.color.background.u32 = MakeColor(0, 0, 0, 255);
649  uis.color.normal.u32 = MakeColor(15, 128, 235, 100);
650  uis.color.active.u32 = MakeColor(15, 128, 235, 100);
651  uis.color.selection.u32 = MakeColor(15, 128, 235, 100);
652  uis.color.disabled.u32 = MakeColor(127, 127, 127, 255);
653 
654  strcpy(uis.weaponModel, "w_railgun.md2");
655 
656  // load custom menus
657  UI_LoadScript();
658 
659  // load built-in menus
661  M_Menu_Servers();
662  M_Menu_Demos();
663 
664  Com_DPrintf("Registered %d menus.\n", List_Count(&ui_menus));
665 
666  uis.initialized = qtrue;
667 }
668 
669 /*
670 =================
671 UI_Shutdown
672 =================
673 */
674 void UI_Shutdown(void)
675 {
676  if (!uis.initialized) {
677  return;
678  }
679  UI_ForceMenuOff();
680 
681  ui_scale->changed = NULL;
682 
684 
685  UI_FreeMenus();
686 
688 
689  memset(&uis, 0, sizeof(uis));
690 
691  Z_LeakTest(TAG_UI);
692 }
693 
694 
ui.h
menuCommon_s
Definition: ui.h:140
uiStatic_s::transparent
qboolean transparent
Definition: ui.h:301
ui_scale_changed
static void ui_scale_changed(cvar_t *self)
Definition: ui.c:597
uiStatic_s::fontHandle
qhandle_t fontHandle
Definition: ui.h:307
QMS_NOTHANDLED
@ QMS_NOTHANDLED
Definition: ui.h:68
menuFrameWork_s::mins
int mins[2]
Definition: ui.h:114
uiStatic_s::mouseTracker
menuCommon_t * mouseTracker
Definition: ui.h:297
UI_MouseEvent
void UI_MouseEvent(int x, int y)
Definition: ui.c:404
menuFrameWork_s::name
char * name
Definition: ui.h:101
LIST_DECL
LIST_DECL(ui_menus)
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
ui_open
static cvar_t * ui_open
Definition: ui.c:29
Key_SetDest
void Key_SetDest(keydest_t dest)
Definition: keys.c:178
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
Z_LeakTest
void Z_LeakTest(memtag_t tag)
Definition: zone.c:120
R_ClearColor
void(* R_ClearColor)(void)
Definition: refresh.c:410
menuFrameWork_s::free
void(* free)(struct menuFrameWork_s *)
Definition: ui.h:136
menuFrameWork_s::push
qboolean(* push)(struct menuFrameWork_s *)
Definition: ui.h:131
uiStatic_s::height
int height
Definition: ui.h:292
menuFrameWork_s::expose
void(* expose)(struct menuFrameWork_s *)
Definition: ui.h:133
Menu_CharEvent
menuSound_t Menu_CharEvent(menuCommon_t *item, int key)
Definition: menu.c:2376
uiStatic_s::initialized
qboolean initialized
Definition: ui.h:290
ca_active
@ ca_active
Definition: client.h:340
client_static_s::state
connstate_t state
Definition: client.h:375
UI_Init
void UI_Init(void)
Definition: ui.c:627
UI_DrawChar
void UI_DrawChar(int x, int y, int flags, int ch)
Definition: ui.c:325
UI_FreeMenus
static void UI_FreeMenus(void)
Definition: ui.c:609
R_DrawFill8
void(* R_DrawFill8)(int x, int y, int w, int h, int c)
Definition: refresh.c:422
R_ClampScale
float R_ClampScale(cvar_t *var)
Definition: refresh.c:440
UI_PopMenu_f
static void UI_PopMenu_f(void)
Definition: ui.c:581
CL_WriteConfig
void CL_WriteConfig(void)
Definition: main.c:2391
UI_GetColumn
char * UI_GetColumn(char *s, int n)
Definition: ui.c:281
menuFrameWork_s
Definition: ui.h:98
Menu_SetFocus
void Menu_SetFocus(menuCommon_t *focus)
Definition: menu.c:2057
M_Menu_PlayerConfig
void M_Menu_PlayerConfig(void)
Definition: playerconfig.c:322
UI_FormatColumns
void * UI_FormatColumns(int extrasize,...)
Definition: ui.c:251
UI_Malloc
#define UI_Malloc(s)
Definition: ui.h:33
Cmd_Deregister
void Cmd_Deregister(const cmdreg_t *reg)
Definition: cmd.c:1580
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:899
M_Menu_Demos
void M_Menu_Demos(void)
Definition: demos.c:636
UI_PushMenu_c
static void UI_PushMenu_c(genctx_t *ctx, int argnum)
Definition: ui.c:556
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:889
Prompt_AddMatch
qboolean Prompt_AddMatch(genctx_t *ctx, const char *s)
Definition: prompt.c:149
uiStatic_s
Definition: ui.h:289
Menu_HitTest
menuCommon_t * Menu_HitTest(menuFrameWork_t *menu)
Definition: menu.c:2480
uiStatic_s::bitmapCursors
qhandle_t bitmapCursors[NUM_CURSOR_FRAMES]
Definition: ui.h:311
UI_PopMenu
void UI_PopMenu(void)
Definition: ui.c:143
UI_DoHitTest
qboolean UI_DoHitTest(void)
Definition: ui.c:368
Menu_Keydown
menuSound_t Menu_Keydown(menuFrameWork_t *menu, int key)
Definition: menu.c:2452
QMS_MOVE
@ QMS_MOVE
Definition: ui.h:71
uis
uiStatic_t uis
Definition: ui.c:24
UI_IsTransparent
qboolean UI_IsTransparent(void)
Definition: ui.c:177
UI_Menu_g
static void UI_Menu_g(genctx_t *ctx)
Definition: ui.c:545
uiStatic_s::scale
float scale
Definition: ui.h:293
Com_Error
void Com_Error(error_type_t type, const char *fmt,...)
Definition: g_main.c:258
QMF_HASFOCUS
#define QMF_HASFOCUS
Definition: ui.h:62
uiStatic_s::layers
menuFrameWork_t * layers[MAX_MENU_DEPTH]
Definition: ui.h:295
ui_debug
cvar_t * ui_debug
Definition: ui.c:28
UI_StartSound
void UI_StartSound(menuSound_t sound)
Definition: ui.c:478
Menu_Draw
void Menu_Draw(menuFrameWork_t *menu)
Definition: menu.c:2196
va
char * va(const char *format,...)
Definition: shared.c:429
UI_StringDimensions
void UI_StringDimensions(vrect_t *rc, int flags, const char *string)
Definition: ui.c:330
uiStatic_s::entersound
qboolean entersound
Definition: ui.h:299
R_DrawPic
void(* R_DrawPic)(int x, int y, qhandle_t pic)
Definition: refresh.c:419
uiStatic_s::cursorHandle
qhandle_t cursorHandle
Definition: ui.h:308
IN_WarpMouse
void IN_WarpMouse(int x, int y)
Definition: input.c:161
uiStatic_s::weaponModel
char weaponModel[32]
Definition: ui.h:304
Cmd_Register
void Cmd_Register(const cmdreg_t *reg)
Definition: cmd.c:1572
QMS_OUT
@ QMS_OUT
Definition: ui.h:72
UI_DrawString
void UI_DrawString(int x, int y, int flags, const char *string)
Definition: ui.c:314
Menu_MouseMove
menuSound_t Menu_MouseMove(menuCommon_t *item)
Definition: menu.c:2386
M_Menu_Servers
void M_Menu_Servers(void)
Definition: servers.c:1073
R_DrawString
int(* R_DrawString)(int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font)
Definition: refresh.c:417
uiStatic_s::activeMenu
menuFrameWork_t * activeMenu
Definition: ui.h:296
menuSound_t
menuSound_t
Definition: ui.h:67
Con_Close
void Con_Close(qboolean force)
Definition: console.c:124
UI_DrawRect8
void UI_DrawRect8(const vrect_t *rc, int border, int c)
Definition: ui.c:342
UI_CharEvent
void UI_CharEvent(int key)
Definition: ui.c:528
uiStatic_s::menuDepth
int menuDepth
Definition: ui.h:294
R_DrawFill32
void(* R_DrawFill32)(int x, int y, int w, int h, uint32_t color)
Definition: refresh.c:423
UI_Draw
void UI_Draw(int realtime)
Definition: ui.c:420
UI_Shutdown
void UI_Shutdown(void)
Definition: ui.c:674
ui_menus
list_t ui_menus
UI_OpenMenu
void UI_OpenMenu(uiMenu_t type)
Definition: ui.c:208
UI_ModeChanged
void UI_ModeChanged(void)
Definition: ui.c:602
UI_ForceMenuOff
void UI_ForceMenuOff(void)
Definition: ui.c:119
QMS_BEEP
@ QMS_BEEP
Definition: ui.h:73
UI_LoadScript
void UI_LoadScript(void)
Definition: script.c:789
uiStatic_s::selection
color_t selection
Definition: ui.h:317
S_StartLocalSound
void S_StartLocalSound(const char *sound)
Definition: main.c:911
cls
client_static_t cls
Definition: main.c:98
c
statCounters_t c
Definition: main.c:30
uiStatic_s::color
struct uiStatic_s::@9 color
menuCommon_s::flags
int flags
Definition: ui.h:152
R_GetPicSize
qboolean R_GetPicSize(int *w, int *h, qhandle_t pic)
Definition: images.c:1289
uiStatic_s::disabled
color_t disabled
Definition: ui.h:318
uiStatic_s::mouseCoords
int mouseCoords[2]
Definition: ui.h:298
Key_GetDest
keydest_t Key_GetDest(void)
Definition: keys.c:168
uiStatic_s::normal
color_t normal
Definition: ui.h:315
UI_Resize
static void UI_Resize(void)
Definition: ui.c:98
MAX_COLUMNS
#define MAX_COLUMNS
Definition: ui.h:185
uiStatic_s::width
int width
Definition: ui.h:292
uiStatic_s::background
color_t background
Definition: ui.h:314
uiStatic_s::active
color_t active
Definition: ui.h:316
uiStatic_s::realtime
int realtime
Definition: ui.h:291
UI_FindMenu
menuFrameWork_t * UI_FindMenu(const char *name)
Definition: ui.c:190
R_SetScale
void(* R_SetScale)(float scale)
Definition: refresh.c:415
UI_CursorInRect
qboolean UI_CursorInRect(vrect_t *rect)
Definition: ui.c:297
QMS_IN
@ QMS_IN
Definition: ui.h:70
UI_IsItemSelectable
#define UI_IsItemSelectable(item)
Definition: ui.h:85
uiStatic_s::cursorWidth
int cursorWidth
Definition: ui.h:309
ui_scale
static cvar_t * ui_scale
Definition: ui.c:30
NUM_CURSOR_FRAMES
#define NUM_CURSOR_FRAMES
Definition: ui.h:287
R_DrawChar
void(* R_DrawChar)(int x, int y, int flags, int ch, qhandle_t font)
Definition: refresh.c:416
UI_PushMenu_f
static void UI_PushMenu_f(void)
Definition: ui.c:563
menuFrameWork_s::draw
void(* draw)(struct menuFrameWork_s *)
Definition: ui.h:134
color
static vec4_t color
Definition: mesh.c:33
PlayerModel_Free
void PlayerModel_Free(void)
Definition: playermodels.c:186
Menu_ItemAtCursor
menuCommon_t * Menu_ItemAtCursor(menuFrameWork_t *m)
Definition: menu.c:2042
uiStatic_s::cursorHeight
int cursorHeight
Definition: ui.h:309
UI_KeyEvent
void UI_KeyEvent(int key, qboolean down)
Definition: ui.c:503
menuFrameWork_s::pop
void(* pop)(struct menuFrameWork_s *)
Definition: ui.h:132
menuFrameWork_s::transparent
qboolean transparent
Definition: ui.h:107
r_config
refcfg_t r_config
Definition: refresh.c:401
MAX_MENU_DEPTH
#define MAX_MENU_DEPTH
Definition: ui.h:281
UI_PushMenu
void UI_PushMenu(menuFrameWork_t *menu)
Definition: ui.c:39
c_ui
static const cmdreg_t c_ui[]
Definition: ui.c:589
Menu_Init
void Menu_Init(menuFrameWork_t *menu)
Definition: menu.c:1817