Quake II RTX doxygen  1.0 dev
ui.h File Reference
#include "shared/shared.h"
#include "shared/list.h"
#include "common/cmd.h"
#include "common/common.h"
#include "common/cvar.h"
#include "common/field.h"
#include "common/zone.h"
#include "client/keys.h"
#include "client/sound/sound.h"
#include "client/client.h"
#include "client/ui.h"
#include "refresh/refresh.h"

Go to the source code of this file.

Classes

struct  menuCondition_s
 
struct  menuFrameWork_s
 
struct  menuCommon_s
 
struct  menuField_s
 
struct  menuSlider_s
 
struct  menuListColumn_s
 
struct  menuList_s
 
struct  menuSpinControl_s
 
struct  menuAction_s
 
struct  menuSeparator_s
 
struct  menuStatic_s
 
struct  menuBitmap_s
 
struct  menuKeybind_s
 
struct  playerModelInfo_s
 
struct  uiStatic_s
 

Macros

#define UI_Malloc(s)   Z_TagMalloc(s, TAG_UI)
 
#define UI_Mallocz(s)   Z_TagMallocz(s, TAG_UI)
 
#define UI_CopyString(s)   Z_TagCopyString(s, TAG_UI)
 
#define MAXMENUITEMS   64
 
#define QMF_LEFT_JUSTIFY   0x00000001
 
#define QMF_GRAYED   0x00000002
 
#define QMF_NUMBERSONLY   0x00000004
 
#define QMF_HASFOCUS   0x00000008
 
#define QMF_HIDDEN   0x00000010
 
#define QMF_DISABLED   0x00000020
 
#define QMF_CUSTOM_COLOR   0x00000040
 
#define RCOLUMN_OFFSET   (CHAR_WIDTH * 2)
 
#define LCOLUMN_OFFSET   -RCOLUMN_OFFSET
 
#define GENERIC_SPACING(x)   ((x) + (x) / 4)
 
#define MENU_SPACING   GENERIC_SPACING(CHAR_HEIGHT)
 
#define DOUBLE_CLICK_DELAY   300
 
#define UI_IsItemSelectable(item)
 
#define SLIDER_RANGE   10
 
#define MAX_COLUMNS   8
 
#define MLIST_SPACING   GENERIC_SPACING(CHAR_HEIGHT)
 
#define MLIST_BORDER_WIDTH   1
 
#define MLIST_SCROLLBAR_WIDTH   GENERIC_SPACING(CHAR_WIDTH)
 
#define MLIST_PRESTEP   3
 
#define MLIST_PADDING   (MLIST_PRESTEP*2)
 
#define MLF_HEADER   0x00000001
 
#define MLF_SCROLLBAR   0x00000002
 
#define MLF_COLOR   0x00000004
 
#define MAX_PLAYERMODELS   1024
 
#define MAX_MENU_DEPTH   8
 
#define CURSOR_WIDTH   32
 
#define CURSOR_OFFSET   25
 
#define NUM_CURSOR_FRAMES   15
 

Typedefs

typedef void(* confirmAction_t) (qboolean)
 
typedef struct menuCondition_s menuCondition_t
 
typedef struct menuFrameWork_s menuFrameWork_t
 
typedef struct menuCommon_s menuCommon_t
 
typedef struct menuField_s menuField_t
 
typedef struct menuSlider_s menuSlider_t
 
typedef struct menuListColumn_s menuListColumn_t
 
typedef struct menuList_s menuList_t
 
typedef struct menuSpinControl_s menuSpinControl_t
 
typedef struct menuAction_s menuAction_t
 
typedef struct menuSeparator_s menuSeparator_t
 
typedef struct menuStatic_s menuStatic_t
 
typedef struct menuBitmap_s menuBitmap_t
 
typedef struct menuKeybind_s menuKeybind_t
 
typedef struct playerModelInfo_s playerModelInfo_t
 
typedef struct uiStatic_s uiStatic_t
 

Enumerations

enum  menuType_t {
  MTYPE_BAD, MTYPE_SLIDER, MTYPE_LIST, MTYPE_ACTION,
  MTYPE_SPINCONTROL, MTYPE_SEPARATOR, MTYPE_FIELD, MTYPE_BITFIELD,
  MTYPE_PAIRS, MTYPE_STRINGS, MTYPE_VALUES, MTYPE_TOGGLE,
  MTYPE_STATIC, MTYPE_KEYBIND, MTYPE_BITMAP, MTYPE_SAVEGAME,
  MTYPE_LOADGAME
}
 
enum  menuSound_t {
  QMS_NOTHANDLED, QMS_SILENT, QMS_IN, QMS_MOVE,
  QMS_OUT, QMS_BEEP
}
 

Functions

void PlayerModel_Load (void)
 
void PlayerModel_Free (void)
 
void UI_PushMenu (menuFrameWork_t *menu)
 
void UI_ForceMenuOff (void)
 
void UI_PopMenu (void)
 
void UI_StartSound (menuSound_t sound)
 
qboolean UI_DoHitTest (void)
 
qboolean UI_CursorInRect (vrect_t *rect)
 
voidUI_FormatColumns (int extrasize,...) q_sentinel
 
char * UI_GetColumn (char *s, int n)
 
void UI_DrawString (int x, int y, int flags, const char *string)
 
void UI_DrawChar (int x, int y, int flags, int ch)
 
void UI_DrawRect8 (const vrect_t *rect, int border, int c)
 
void UI_StringDimensions (vrect_t *rc, int flags, const char *string)
 
void UI_LoadScript (void)
 
menuFrameWork_tUI_FindMenu (const char *name)
 
void Menu_Init (menuFrameWork_t *menu)
 
void Menu_Size (menuFrameWork_t *menu)
 
void Menu_Draw (menuFrameWork_t *menu)
 
void Menu_AddItem (menuFrameWork_t *menu, void *item)
 
menuSound_t Menu_SelectItem (menuFrameWork_t *menu)
 
menuSound_t Menu_SlideItem (menuFrameWork_t *menu, int dir)
 
menuSound_t Menu_KeyEvent (menuCommon_t *item, int key)
 
menuSound_t Menu_CharEvent (menuCommon_t *item, int key)
 
menuSound_t Menu_MouseMove (menuCommon_t *item)
 
menuSound_t Menu_Keydown (menuFrameWork_t *menu, int key)
 
void Menu_SetFocus (menuCommon_t *item)
 
menuSound_t Menu_AdjustCursor (menuFrameWork_t *menu, int dir)
 
menuCommon_tMenu_ItemAtCursor (menuFrameWork_t *menu)
 
menuCommon_tMenu_HitTest (menuFrameWork_t *menu)
 
void MenuList_Init (menuList_t *l)
 
void MenuList_SetValue (menuList_t *l, int value)
 
void MenuList_Sort (menuList_t *l, int offset, int(*cmpfunc)(const void *, const void *))
 
void SpinControl_Init (menuSpinControl_t *s)
 
qboolean Menu_Push (menuFrameWork_t *menu)
 
void Menu_Pop (menuFrameWork_t *menu)
 
void Menu_Free (menuFrameWork_t *menu)
 
void M_Menu_PlayerConfig (void)
 
void M_Menu_Demos (void)
 
void M_Menu_Servers (void)
 

Variables

uiStatic_t uis
 
list_t ui_menus
 
cvar_t * ui_debug
 

Macro Definition Documentation

◆ CURSOR_OFFSET

#define CURSOR_OFFSET   25

Definition at line 285 of file ui.h.

◆ CURSOR_WIDTH

#define CURSOR_WIDTH   32

Definition at line 284 of file ui.h.

◆ DOUBLE_CLICK_DELAY

#define DOUBLE_CLICK_DELAY   300

Definition at line 83 of file ui.h.

◆ GENERIC_SPACING

#define GENERIC_SPACING (   x)    ((x) + (x) / 4)

Definition at line 79 of file ui.h.

◆ LCOLUMN_OFFSET

#define LCOLUMN_OFFSET   -RCOLUMN_OFFSET

Definition at line 77 of file ui.h.

◆ MAX_COLUMNS

#define MAX_COLUMNS   8

Definition at line 185 of file ui.h.

◆ MAX_MENU_DEPTH

#define MAX_MENU_DEPTH   8

Definition at line 281 of file ui.h.

◆ MAX_PLAYERMODELS

#define MAX_PLAYERMODELS   1024

Definition at line 270 of file ui.h.

◆ MAXMENUITEMS

#define MAXMENUITEMS   64

Definition at line 37 of file ui.h.

◆ MENU_SPACING

#define MENU_SPACING   GENERIC_SPACING(CHAR_HEIGHT)

Definition at line 81 of file ui.h.

◆ MLF_COLOR

#define MLF_COLOR   0x00000004

Definition at line 195 of file ui.h.

◆ MLF_HEADER

#define MLF_HEADER   0x00000001

Definition at line 193 of file ui.h.

◆ MLF_SCROLLBAR

#define MLF_SCROLLBAR   0x00000002

Definition at line 194 of file ui.h.

◆ MLIST_BORDER_WIDTH

#define MLIST_BORDER_WIDTH   1

Definition at line 188 of file ui.h.

◆ MLIST_PADDING

#define MLIST_PADDING   (MLIST_PRESTEP*2)

Definition at line 191 of file ui.h.

◆ MLIST_PRESTEP

#define MLIST_PRESTEP   3

Definition at line 190 of file ui.h.

◆ MLIST_SCROLLBAR_WIDTH

#define MLIST_SCROLLBAR_WIDTH   GENERIC_SPACING(CHAR_WIDTH)

Definition at line 189 of file ui.h.

◆ MLIST_SPACING

#define MLIST_SPACING   GENERIC_SPACING(CHAR_HEIGHT)

Definition at line 187 of file ui.h.

◆ NUM_CURSOR_FRAMES

#define NUM_CURSOR_FRAMES   15

Definition at line 287 of file ui.h.

◆ QMF_CUSTOM_COLOR

#define QMF_CUSTOM_COLOR   0x00000040

Definition at line 65 of file ui.h.

◆ QMF_DISABLED

#define QMF_DISABLED   0x00000020

Definition at line 64 of file ui.h.

◆ QMF_GRAYED

#define QMF_GRAYED   0x00000002

Definition at line 60 of file ui.h.

◆ QMF_HASFOCUS

#define QMF_HASFOCUS   0x00000008

Definition at line 62 of file ui.h.

◆ QMF_HIDDEN

#define QMF_HIDDEN   0x00000010

Definition at line 63 of file ui.h.

◆ QMF_LEFT_JUSTIFY

#define QMF_LEFT_JUSTIFY   0x00000001

Definition at line 59 of file ui.h.

◆ QMF_NUMBERSONLY

#define QMF_NUMBERSONLY   0x00000004

Definition at line 61 of file ui.h.

◆ RCOLUMN_OFFSET

#define RCOLUMN_OFFSET   (CHAR_WIDTH * 2)

Definition at line 76 of file ui.h.

◆ SLIDER_RANGE

#define SLIDER_RANGE   10

Definition at line 170 of file ui.h.

◆ UI_CopyString

#define UI_CopyString (   s)    Z_TagCopyString(s, TAG_UI)

Definition at line 35 of file ui.h.

◆ UI_IsItemSelectable

#define UI_IsItemSelectable (   item)
Value:
((item)->type != MTYPE_SEPARATOR && \
(item)->type != MTYPE_STATIC && \
!((item)->flags & (QMF_GRAYED | QMF_HIDDEN | QMF_DISABLED)))

Definition at line 85 of file ui.h.

◆ UI_Malloc

#define UI_Malloc (   s)    Z_TagMalloc(s, TAG_UI)

Definition at line 33 of file ui.h.

◆ UI_Mallocz

#define UI_Mallocz (   s)    Z_TagMallocz(s, TAG_UI)

Definition at line 34 of file ui.h.

Typedef Documentation

◆ confirmAction_t

typedef void(* confirmAction_t) (qboolean)

Definition at line 90 of file ui.h.

◆ menuAction_t

typedef struct menuAction_s menuAction_t

◆ menuBitmap_t

typedef struct menuBitmap_s menuBitmap_t

◆ menuCommon_t

typedef struct menuCommon_s menuCommon_t

◆ menuCondition_t

◆ menuField_t

typedef struct menuField_s menuField_t

◆ menuFrameWork_t

◆ menuKeybind_t

typedef struct menuKeybind_s menuKeybind_t

◆ menuList_t

typedef struct menuList_s menuList_t

◆ menuListColumn_t

◆ menuSeparator_t

◆ menuSlider_t

typedef struct menuSlider_s menuSlider_t

◆ menuSpinControl_t

◆ menuStatic_t

typedef struct menuStatic_s menuStatic_t

◆ playerModelInfo_t

◆ uiStatic_t

typedef struct uiStatic_s uiStatic_t

Enumeration Type Documentation

◆ menuSound_t

Enumerator
QMS_NOTHANDLED 
QMS_SILENT 
QMS_IN 
QMS_MOVE 
QMS_OUT 
QMS_BEEP 

Definition at line 67 of file ui.h.

67  {
69  QMS_SILENT,
70  QMS_IN,
71  QMS_MOVE,
72  QMS_OUT,
73  QMS_BEEP
74 } menuSound_t;

◆ menuType_t

enum menuType_t
Enumerator
MTYPE_BAD 
MTYPE_SLIDER 
MTYPE_LIST 
MTYPE_ACTION 
MTYPE_SPINCONTROL 
MTYPE_SEPARATOR 
MTYPE_FIELD 
MTYPE_BITFIELD 
MTYPE_PAIRS 
MTYPE_STRINGS 
MTYPE_VALUES 
MTYPE_TOGGLE 
MTYPE_STATIC 
MTYPE_KEYBIND 
MTYPE_BITMAP 
MTYPE_SAVEGAME 
MTYPE_LOADGAME 

Definition at line 39 of file ui.h.

Function Documentation

◆ M_Menu_Demos()

void M_Menu_Demos ( void  )

Definition at line 636 of file demos.c.

637 {
638  ui_sortdemos = Cvar_Get("ui_sortdemos", "1", 0);
640 
641  ui_listalldemos = Cvar_Get("ui_listalldemos", "0", 0);
642 
643  m_demos.menu.name = "demos";
644  m_demos.menu.title = "Demo Browser";
645 
646  strcpy(m_demos.browse, "/demos");
647 
648  m_demos.menu.draw = Draw;
650  m_demos.menu.pop = Pop;
651  m_demos.menu.size = Size;
653  m_demos.menu.free = Free;
655  m_demos.menu.color.u32 = uis.color.background.u32;
657 
663  m_demos.list.sortdir = 1;
666  m_demos.list.sort = Sort;
668 
670  m_demos.list.columns[0].uiFlags = UI_LEFT;
671  m_demos.list.columns[1].name = "Date";
672  m_demos.list.columns[1].uiFlags = UI_CENTER;
673  m_demos.list.columns[2].name = "Size";
674  m_demos.list.columns[2].uiFlags = UI_RIGHT;
675  m_demos.list.columns[3].name = "Map";
676  m_demos.list.columns[3].uiFlags = UI_CENTER;
677  m_demos.list.columns[4].name = "POV";
678  m_demos.list.columns[4].uiFlags = UI_CENTER;
679 
681 
683 
684  List_Append(&ui_menus, &m_demos.menu.entry);
685 }

Referenced by UI_Init().

◆ M_Menu_PlayerConfig()

void M_Menu_PlayerConfig ( void  )

Definition at line 322 of file playerconfig.c.

323 {
324  static const vec3_t origin = { 40.0f, 0.0f, 0.0f };
325  static const vec3_t angles = { 0.0f, 260.0f, 0.0f };
326 
327  m_player.menu.name = "players";
329  m_player.menu.pop = Pop;
334 
335  if (vid_rtx->integer)
336  {
337  // Q2RTX: make the player menu transparent so that we can see
338  // the model below: all 2D stuff is rendered after 3D, in stretch_pics.
339  m_player.menu.color.u32 = 0;
340  }
341  else
342  {
343  m_player.menu.color.u32 = MakeColor(0, 0, 0, 255);
344  }
345 
347 
348  m_player.entities[0].flags = RF_FULLBRIGHT;
349  m_player.entities[0].id = 1; // Q2RTX: add entity id to fix motion vectors
350  VectorCopy(angles, m_player.entities[0].angles);
351  VectorCopy(origin, m_player.entities[0].origin);
352  VectorCopy(origin, m_player.entities[0].oldorigin);
353 
354  m_player.entities[1].flags = RF_FULLBRIGHT;
355  m_player.entities[1].id = 2; // Q2RTX: add entity id to fix motion vectors
356  VectorCopy(angles, m_player.entities[1].angles);
357  VectorCopy(origin, m_player.entities[1].origin);
358  VectorCopy(origin, m_player.entities[1].oldorigin);
359 
360  m_player.refdef.num_entities = 0;
361  m_player.refdef.entities = m_player.entities;
362  m_player.refdef.rdflags = RDF_NOWORLDMODEL;
363 
364  if (vid_rtx->integer)
365  {
366  m_player.refdef.num_dlights = sizeof(dlights) / sizeof(*dlights);
367  m_player.refdef.dlights = dlights;
368  }
369  else
370  {
371  m_player.refdef.num_dlights = 0;
372  }
373 
376  m_player.name.generic.name = "name";
377  m_player.name.width = MAX_CLIENT_NAME - 1;
378 
381  m_player.model.generic.name = "model";
383 
386  m_player.skin.generic.name = "skin";
388 
390  m_player.hand.generic.name = "handedness";
391  m_player.hand.itemnames = (char **)handedness;
392 
394  m_player.view.generic.name = "view";
395  m_player.view.itemnames = (char **)viewmodes;
396 
402 
403  List_Append(&ui_menus, &m_player.menu.entry);
404 }

Referenced by UI_Init().

◆ M_Menu_Servers()

void M_Menu_Servers ( void  )

Definition at line 1073 of file servers.c.

1074 {
1075  ui_sortservers = Cvar_Get("ui_sortservers", "0", 0);
1077  ui_colorservers = Cvar_Get("ui_colorservers", "0", 0);
1079  ui_pingrate = Cvar_Get("ui_pingrate", "0", 0);
1080 
1081  m_servers.menu.name = "servers";
1082  m_servers.menu.title = "Server Browser";
1083 
1084  m_servers.menu.draw = Draw;
1086  m_servers.menu.push = Push;
1087  m_servers.menu.pop = Pop;
1088  m_servers.menu.size = Size;
1090  m_servers.menu.free = Free;
1092  m_servers.menu.color.u32 = uis.color.background.u32;
1094 
1095 //
1096 // server list
1097 //
1104  m_servers.list.sortdir = 1;
1105  m_servers.list.sortcol = -1;
1106  m_servers.list.sort = Sort;
1109 
1110  m_servers.list.columns[0].uiFlags = UI_LEFT;
1111  m_servers.list.columns[0].name = "Hostname";
1112  m_servers.list.columns[1].uiFlags = UI_CENTER;
1113  m_servers.list.columns[1].name = "Mod";
1114  m_servers.list.columns[2].uiFlags = UI_CENTER;
1115  m_servers.list.columns[2].name = "Map";
1116  m_servers.list.columns[3].uiFlags = UI_CENTER;
1117  m_servers.list.columns[3].name = "Players";
1118  m_servers.list.columns[4].uiFlags = UI_RIGHT;
1119  m_servers.list.columns[4].name = "RTT";
1120 
1122 
1123 //
1124 // server info
1125 //
1131 
1132  m_servers.info.columns[0].uiFlags = UI_LEFT;
1133  m_servers.info.columns[0].name = "Key";
1134  m_servers.info.columns[1].uiFlags = UI_LEFT;
1135  m_servers.info.columns[1].name = "Value";
1136 
1137 //
1138 // player list
1139 //
1145 
1146  m_servers.players.columns[0].uiFlags = UI_RIGHT;
1147  m_servers.players.columns[0].name = "Frg";
1148  m_servers.players.columns[1].uiFlags = UI_RIGHT;
1149  m_servers.players.columns[1].name = "RTT";
1150  m_servers.players.columns[2].uiFlags = UI_LEFT;
1151  m_servers.players.columns[2].name = "Name";
1152 
1156 
1157  List_Append(&ui_menus, &m_servers.menu.entry);
1158 }

Referenced by UI_Init().

◆ Menu_AddItem()

void Menu_AddItem ( menuFrameWork_t menu,
void item 
)

Definition at line 1785 of file menu.c.

1786 {
1787  if (menu->nitems >= MAXMENUITEMS) {
1788  Com_Error(ERR_FATAL, "Menu_AddItem: too many items");
1789  }
1790 
1791  menu->items[menu->nitems++] = item;
1792  ((menuCommon_t *)item)->parent = menu;
1793  ((menuCommon_t *)item)->condition = menu->current_condition;
1794 }

Referenced by M_Menu_Demos(), M_Menu_PlayerConfig(), M_Menu_Servers(), Parse_Action(), Parse_Bind(), Parse_Bitmap(), Parse_Blank(), Parse_Field(), Parse_Pairs(), Parse_Range(), Parse_Savegame(), Parse_Spin(), and Parse_Toggle().

◆ Menu_AdjustCursor()

menuSound_t Menu_AdjustCursor ( menuFrameWork_t menu,
int  dir 
)

Definition at line 2101 of file menu.c.

2102 {
2103  menuCommon_t *item;
2104  int cursor, pos;
2105  int i;
2106 
2107  pos = 0;
2108  for (i = 0; i < m->nitems; i++) {
2109  item = (menuCommon_t *)m->items[i];
2110 
2111  if (item->flags & QMF_HASFOCUS) {
2112  pos = i;
2113  break;
2114  }
2115  }
2116 
2117  /*
2118  ** crawl in the direction indicated until we find a valid spot
2119  */
2120  cursor = pos;
2121  if (dir == 1) {
2122  do {
2123  cursor++;
2124  if (cursor >= m->nitems)
2125  cursor = 0;
2126 
2127  item = (menuCommon_t *)m->items[cursor];
2128  if (UI_IsItemSelectable(item))
2129  break;
2130  } while (cursor != pos);
2131  } else {
2132  do {
2133  cursor--;
2134  if (cursor < 0)
2135  cursor = m->nitems - 1;
2136 
2137  item = (menuCommon_t *)m->items[cursor];
2138  if (UI_IsItemSelectable(item))
2139  break;
2140  } while (cursor != pos);
2141  }
2142 
2143  Menu_SetFocus(item);
2144 
2145  return QMS_MOVE;
2146 }

Referenced by Menu_DefaultKey().

◆ Menu_CharEvent()

menuSound_t Menu_CharEvent ( menuCommon_t item,
int  key 
)

Definition at line 2376 of file menu.c.

2377 {
2378  switch (item->type) {
2379  case MTYPE_FIELD:
2380  return Field_Char((menuField_t *)item, key);
2381  default:
2382  return QMS_NOTHANDLED;
2383  }
2384 }

Referenced by UI_CharEvent().

◆ Menu_Draw()

void Menu_Draw ( menuFrameWork_t menu)

Definition at line 2196 of file menu.c.

2197 {
2198  void *item;
2199  int i;
2200 
2201 //
2202 // draw background
2203 //
2204  if (menu->image) {
2205  R_DrawStretchPic(0, menu->y1, uis.width,
2206  menu->y2 - menu->y1, menu->image);
2207  } else {
2208  R_DrawFill32(0, menu->y1, uis.width,
2209  menu->y2 - menu->y1, menu->color.u32);
2210  }
2211 
2212 //
2213 // draw title bar
2214 //
2215  if (menu->title) {
2216  UI_DrawString(uis.width / 2, menu->y1,
2217  UI_CENTER | UI_ALTCOLOR, menu->title);
2218  }
2219 
2220 //
2221 // draw banner, plaque and logo
2222 //
2223  if (menu->banner) {
2224  R_DrawPic(menu->banner_rc.x, menu->banner_rc.y, menu->banner);
2225  }
2226  if (menu->plaque) {
2227  R_DrawPic(menu->plaque_rc.x, menu->plaque_rc.y, menu->plaque);
2228  }
2229  if (menu->logo) {
2230  R_DrawPic(menu->logo_rc.x, menu->logo_rc.y, menu->logo);
2231  }
2232  if (menu->footer) {
2233  R_DrawStretchPic(menu->footer_rc.x, menu->footer_rc.y, menu->footer_rc.width, menu->footer_rc.height, menu->footer);
2234  }
2235 
2236 //
2237 // draw contents
2238 //
2239  for (i = 0; i < menu->nitems; i++) {
2240  item = menu->items[i];
2241  if (((menuCommon_t *)item)->flags & QMF_HIDDEN) {
2242  continue;
2243  }
2244 
2245  switch (((menuCommon_t *)item)->type) {
2246  case MTYPE_FIELD:
2247  Field_Draw(item);
2248  break;
2249  case MTYPE_SLIDER:
2250  Slider_Draw(item);
2251  break;
2252  case MTYPE_LIST:
2253  MenuList_Draw(item);
2254  break;
2255  case MTYPE_SPINCONTROL:
2256  case MTYPE_BITFIELD:
2257  case MTYPE_PAIRS:
2258  case MTYPE_VALUES:
2259  case MTYPE_STRINGS:
2260  case MTYPE_TOGGLE:
2261  SpinControl_Draw(item);
2262  break;
2263  case MTYPE_ACTION:
2264  case MTYPE_SAVEGAME:
2265  case MTYPE_LOADGAME:
2266  Action_Draw(item);
2267  break;
2268  case MTYPE_SEPARATOR:
2269  Separator_Draw(item);
2270  break;
2271  case MTYPE_STATIC:
2272  Static_Draw(item);
2273  break;
2274  case MTYPE_KEYBIND:
2275  Keybind_Draw(item);
2276  break;
2277  case MTYPE_BITMAP:
2278  Bitmap_Draw(item);
2279  break;
2280  default:
2281  Com_Error(ERR_FATAL, "Menu_Draw: unknown item type");
2282  break;
2283  }
2284 
2285  if (ui_debug->integer) {
2286  UI_DrawRect8(&((menuCommon_t *)item)->rect, 1, 223);
2287  }
2288  }
2289 
2290 //
2291 // draw status bar
2292 //
2293  if (menu->status) {
2294  Menu_DrawStatus(menu);
2295  }
2296 }

Referenced by Draw(), and UI_Draw().

◆ Menu_Free()

void Menu_Free ( menuFrameWork_t menu)

Definition at line 2586 of file menu.c.

2587 {
2588  void *item;
2589  int i;
2590 
2591  for (i = 0; i < menu->nitems; i++) {
2592  item = menu->items[i];
2593 
2594  switch (((menuCommon_t *)item)->type) {
2595  case MTYPE_ACTION:
2596  case MTYPE_SAVEGAME:
2597  case MTYPE_LOADGAME:
2598  Action_Free(item);
2599  break;
2600  case MTYPE_SLIDER:
2601  Slider_Free(item);
2602  break;
2603  case MTYPE_BITFIELD:
2604  case MTYPE_TOGGLE:
2605  BitField_Free(item);
2606  break;
2607  case MTYPE_PAIRS:
2608  Pairs_Free(item);
2609  break;
2610  case MTYPE_SPINCONTROL:
2611  case MTYPE_STRINGS:
2612  SpinControl_Free(item);
2613  break;
2614  case MTYPE_KEYBIND:
2615  Keybind_Free(item);
2616  break;
2617  case MTYPE_FIELD:
2618  Field_Free(item);
2619  break;
2620  case MTYPE_SEPARATOR:
2621  Z_Free(item);
2622  break;
2623  case MTYPE_BITMAP:
2624  Bitmap_Free(item);
2625  break;
2626  default:
2627  break;
2628  }
2629  }
2630 
2631  Z_Free(menu->title);
2632  Z_Free(menu->name);
2633  Z_Free(menu);
2634 }

Referenced by Parse_File().

◆ Menu_HitTest()

menuCommon_t* Menu_HitTest ( menuFrameWork_t menu)

Definition at line 2480 of file menu.c.

2481 {
2482  int i;
2483  menuCommon_t *item;
2484 
2485  if (menu->keywait) {
2486  return NULL;
2487  }
2488 
2489  for (i = 0; i < menu->nitems; i++) {
2490  item = menu->items[i];
2491  if (item->flags & QMF_HIDDEN) {
2492  continue;
2493  }
2494 
2495  if (UI_CursorInRect(&item->rect)) {
2496  return item;
2497  }
2498  }
2499 
2500  return NULL;
2501 }

Referenced by Menu_DefaultKey(), and UI_DoHitTest().

◆ Menu_Init()

void Menu_Init ( menuFrameWork_t menu)

Definition at line 1817 of file menu.c.

1818 {
1819  void *item;
1820  int i;
1821  int focus = 0;
1822  vrect_t *rc;
1823 
1824  menu->y1 = 0;
1825  menu->y2 = uis.height;
1826 
1827  for (i = 0; i < menu->nitems; i++) {
1828  item = menu->items[i];
1829 
1830  menuCondition_t *condition = &((menuCommon_t*)item)->condition;
1831  if (condition->cvar)
1832  {
1833  qboolean equals = condition->cvar->integer == condition->value;
1834  if (equals == condition->equals)
1835  ((menuCommon_t *)item)->flags &= ~QMF_HIDDEN;
1836  else
1837  ((menuCommon_t *)item)->flags |= QMF_HIDDEN;
1838  }
1839  }
1840 
1841  if (!menu->size) {
1842  menu->size = Menu_Size;
1843  }
1844  menu->size(menu);
1845 
1846  for (i = 0; i < menu->nitems; i++) {
1847  item = menu->items[i];
1848 
1849  focus |= ((menuCommon_t *)item)->flags & QMF_HASFOCUS;
1850  switch (((menuCommon_t *)item)->type) {
1851  case MTYPE_FIELD:
1852  Field_Init(item);
1853  break;
1854  case MTYPE_SLIDER:
1855  Slider_Init(item);
1856  break;
1857  case MTYPE_LIST:
1858  MenuList_Init(item);
1859  break;
1860  case MTYPE_SPINCONTROL:
1861  case MTYPE_BITFIELD:
1862  case MTYPE_PAIRS:
1863  case MTYPE_VALUES:
1864  case MTYPE_STRINGS:
1865  case MTYPE_TOGGLE:
1866  SpinControl_Init(item);
1867  break;
1868  case MTYPE_ACTION:
1869  case MTYPE_SAVEGAME:
1870  case MTYPE_LOADGAME:
1871  Action_Init(item);
1872  break;
1873  case MTYPE_SEPARATOR:
1874  Separator_Init(item);
1875  break;
1876  case MTYPE_STATIC:
1877  Static_Init(item);
1878  break;
1879  case MTYPE_KEYBIND:
1880  Keybind_Init(item);
1881  break;
1882  case MTYPE_BITMAP:
1883  Bitmap_Init(item);
1884  break;
1885  default:
1886  Com_Error(ERR_FATAL, "Menu_Init: unknown item type");
1887  break;
1888  }
1889  }
1890 
1891  // set focus to the first non-hidden item by default
1892  if (!focus && menu->nitems) {
1893  for (i = 0; i < menu->nitems; i++) {
1894  item = menu->items[i];
1895  if (!(((menuCommon_t *)item)->flags & QMF_HIDDEN) && (((menuCommon_t *)item)->type != MTYPE_SEPARATOR)) {
1896  ((menuCommon_t *)item)->flags |= QMF_HASFOCUS;
1897  if (((menuCommon_t *)item)->status) {
1898  menu->status = ((menuCommon_t *)item)->status;
1899  }
1900  break;
1901  }
1902  }
1903  }
1904 
1905  // calc menu bounding box
1906  UI_ClearBounds(menu->mins, menu->maxs);
1907 
1908  for (i = 0; i < menu->nitems; i++) {
1909  item = menu->items[i];
1910  rc = &((menuCommon_t *)item)->rect;
1911 
1912  UI_AddRectToBounds(rc, menu->mins, menu->maxs);
1913  }
1914 
1915  // expand
1916  menu->mins[0] -= MENU_SPACING;
1917  menu->mins[1] -= MENU_SPACING;
1918  menu->maxs[0] += MENU_SPACING;
1919  menu->maxs[1] += MENU_SPACING;
1920 
1921  // clamp
1922  if (menu->mins[0] < 0) menu->mins[0] = 0;
1923  if (menu->mins[1] < 0) menu->mins[1] = 0;
1924  if (menu->maxs[0] > uis.width) menu->maxs[0] = uis.width;
1925  if (menu->maxs[1] > uis.height) menu->maxs[1] = uis.height;
1926 }

Referenced by UI_PushMenu(), and UI_Resize().

◆ Menu_ItemAtCursor()

menuCommon_t* Menu_ItemAtCursor ( menuFrameWork_t menu)

Definition at line 2042 of file menu.c.

2043 {
2044  menuCommon_t *item;
2045  int i;
2046 
2047  for (i = 0; i < m->nitems; i++) {
2048  item = m->items[i];
2049  if (item->flags & QMF_HASFOCUS) {
2050  return item;
2051  }
2052  }
2053 
2054  return NULL;
2055 }

Referenced by Menu_Keydown(), Menu_SelectItem(), Menu_SlideItem(), and UI_CharEvent().

◆ Menu_Keydown()

menuSound_t Menu_Keydown ( menuFrameWork_t menu,
int  key 
)

Definition at line 2452 of file menu.c.

2453 {
2454  menuCommon_t *item;
2455  menuSound_t sound;
2456 
2457  if (menu->keywait) {
2458  }
2459 
2460  if (menu->keydown) {
2461  sound = menu->keydown(menu, key);
2462  if (sound != QMS_NOTHANDLED) {
2463  return sound;
2464  }
2465  }
2466 
2467  item = Menu_ItemAtCursor(menu);
2468  if (item) {
2469  sound = Menu_KeyEvent(item, key);
2470  if (sound != QMS_NOTHANDLED) {
2471  return sound;
2472  }
2473  }
2474 
2475  sound = Menu_DefaultKey(menu, key);
2476  return sound;
2477 }

Referenced by UI_KeyEvent().

◆ Menu_KeyEvent()

menuSound_t Menu_KeyEvent ( menuCommon_t item,
int  key 
)

Definition at line 2353 of file menu.c.

2354 {
2355  if (item->keydown) {
2356  menuSound_t sound = item->keydown(item, key);
2357  if (sound != QMS_NOTHANDLED) {
2358  return sound;
2359  }
2360  }
2361 
2362  switch (item->type) {
2363  case MTYPE_FIELD:
2364  return Field_Key((menuField_t *)item, key);
2365  case MTYPE_LIST:
2366  return MenuList_Key((menuList_t *)item, key);
2367  case MTYPE_SLIDER:
2368  return Slider_Key((menuSlider_t *)item, key);
2369  case MTYPE_KEYBIND:
2370  return Keybind_Key((menuKeybind_t *)item, key);
2371  default:
2372  return QMS_NOTHANDLED;
2373  }
2374 }

Referenced by Menu_Keydown().

◆ Menu_MouseMove()

menuSound_t Menu_MouseMove ( menuCommon_t item)

Definition at line 2386 of file menu.c.

2387 {
2388  switch (item->type) {
2389  case MTYPE_LIST:
2390  return MenuList_MouseMove((menuList_t *)item);
2391  case MTYPE_SLIDER:
2392  return Slider_MouseMove((menuSlider_t *)item);
2393  default:
2394  return QMS_NOTHANDLED;
2395  }
2396 }

Referenced by UI_DoHitTest().

◆ Menu_Pop()

void Menu_Pop ( menuFrameWork_t menu)

Definition at line 2547 of file menu.c.

2548 {
2549  void *item;
2550  int i;
2551 
2552  for (i = 0; i < menu->nitems; i++) {
2553  item = menu->items[i];
2554 
2555  switch (((menuCommon_t *)item)->type) {
2556  case MTYPE_SLIDER:
2557  Slider_Pop(item);
2558  break;
2559  case MTYPE_BITFIELD:
2560  BitField_Pop(item);
2561  break;
2562  case MTYPE_PAIRS:
2563  Pairs_Pop(item);
2564  break;
2565  case MTYPE_STRINGS:
2566  Strings_Pop(item);
2567  break;
2568  case MTYPE_SPINCONTROL:
2569  SpinControl_Pop(item);
2570  break;
2571  case MTYPE_TOGGLE:
2572  Toggle_Pop(item);
2573  break;
2574  case MTYPE_KEYBIND:
2575  Keybind_Pop(item);
2576  break;
2577  case MTYPE_FIELD:
2578  Field_Pop(item);
2579  break;
2580  default:
2581  break;
2582  }
2583  }
2584 }

Referenced by Parse_File().

◆ Menu_Push()

qboolean Menu_Push ( menuFrameWork_t menu)

Definition at line 2503 of file menu.c.

2504 {
2505  void *item;
2506  int i;
2507 
2508  for (i = 0; i < menu->nitems; i++) {
2509  item = menu->items[i];
2510 
2511  switch (((menuCommon_t *)item)->type) {
2512  case MTYPE_SLIDER:
2513  Slider_Push(item);
2514  break;
2515  case MTYPE_BITFIELD:
2516  BitField_Push(item);
2517  break;
2518  case MTYPE_PAIRS:
2519  Pairs_Push(item);
2520  break;
2521  case MTYPE_STRINGS:
2522  Strings_Push(item);
2523  break;
2524  case MTYPE_SPINCONTROL:
2525  SpinControl_Push(item);
2526  break;
2527  case MTYPE_TOGGLE:
2528  Toggle_Push(item);
2529  break;
2530  case MTYPE_KEYBIND:
2531  Keybind_Push(item);
2532  break;
2533  case MTYPE_FIELD:
2534  Field_Push(item);
2535  break;
2536  case MTYPE_SAVEGAME:
2537  case MTYPE_LOADGAME:
2538  Savegame_Push(item);
2539  break;
2540  default:
2541  break;
2542  }
2543  }
2544  return qtrue;
2545 }

Referenced by Parse_File().

◆ Menu_SelectItem()

menuSound_t Menu_SelectItem ( menuFrameWork_t menu)

Definition at line 2298 of file menu.c.

2299 {
2300  menuCommon_t *item;
2301 
2302  if (!(item = Menu_ItemAtCursor(s))) {
2303  return QMS_NOTHANDLED;
2304  }
2305 
2306  switch (item->type) {
2307  //case MTYPE_SLIDER:
2308  // return Slider_DoSlide((menuSlider_t *)item, 1);
2309  case MTYPE_SPINCONTROL:
2310  case MTYPE_BITFIELD:
2311  case MTYPE_PAIRS:
2312  case MTYPE_VALUES:
2313  case MTYPE_STRINGS:
2314  case MTYPE_TOGGLE:
2315  return SpinControl_DoEnter((menuSpinControl_t *)item);
2316  case MTYPE_KEYBIND:
2317  return Keybind_DoEnter((menuKeybind_t *)item);
2318  case MTYPE_FIELD:
2319  case MTYPE_ACTION:
2320  case MTYPE_LIST:
2321  case MTYPE_BITMAP:
2322  case MTYPE_SAVEGAME:
2323  case MTYPE_LOADGAME:
2324  return Common_DoEnter(item);
2325  default:
2326  return QMS_NOTHANDLED;
2327  }
2328 }

Referenced by Menu_DefaultKey().

◆ Menu_SetFocus()

void Menu_SetFocus ( menuCommon_t item)

Definition at line 2057 of file menu.c.

2058 {
2059  menuFrameWork_t *menu;
2060  menuCommon_t *item;
2061  int i;
2062 
2063  if (focus->flags & QMF_HASFOCUS) {
2064  return;
2065  }
2066 
2067  menu = focus->parent;
2068 
2069  for (i = 0; i < menu->nitems; i++) {
2070  item = (menuCommon_t *)menu->items[i];
2071 
2072  if (item == focus) {
2073  item->flags |= QMF_HASFOCUS;
2074  if (item->focus) {
2075  item->focus(item, qtrue);
2076  } else if (item->status) {
2077  menu->status = item->status;
2078  }
2079  } else if (item->flags & QMF_HASFOCUS) {
2080  item->flags &= ~QMF_HASFOCUS;
2081  if (item->focus) {
2082  item->focus(item, qfalse);
2083  } else if (menu->status == item->status
2084  && menu->status != focus->status) {
2085  menu->status = NULL;
2086  }
2087  }
2088  }
2089 
2090 }

Referenced by Menu_AdjustCursor(), and UI_DoHitTest().

◆ Menu_Size()

void Menu_Size ( menuFrameWork_t menu)

Definition at line 1928 of file menu.c.

1929 {
1930  menuCommon_t *item;
1931  int x, y, w, h;
1932  int i, widest = -1;
1933 
1934  // count visible items
1935  for (i = 0, h = 0; i < menu->nitems; i++) {
1936  item = menu->items[i];
1937  if (item->flags & QMF_HIDDEN) {
1938  continue;
1939  }
1940  if (item->type == MTYPE_BITMAP) {
1941  h += GENERIC_SPACING(item->height);
1942  if (widest < item->width) {
1943  widest = item->width;
1944  }
1945  } else {
1946  h += MENU_SPACING;
1947  }
1948  }
1949 
1950  // account for banner
1951  if (menu->banner) {
1952  h += GENERIC_SPACING(menu->banner_rc.height);
1953  }
1954 
1955  // set menu top/bottom
1956  if (menu->compact) {
1957  menu->y1 = (uis.height - h) / 2 - MENU_SPACING;
1958  menu->y2 = (uis.height + h) / 2 + MENU_SPACING;
1959  } else {
1960  menu->y1 = 0;
1961  menu->y2 = uis.height;
1962  }
1963 
1964  // set menu horizontal base
1965  if (widest == -1) {
1966  x = uis.width / 2;
1967  } else {
1968  // if menu has bitmaps, it is expected to have plaque and logo
1969  // align them horizontally to avoid going off screen on small resolution
1970  w = widest + CURSOR_WIDTH;
1971  if (menu->plaque_rc.width > menu->logo_rc.width) {
1972  w += menu->plaque_rc.width;
1973  } else {
1974  w += menu->logo_rc.width;
1975  }
1976  x = (uis.width + w) / 2 - widest;
1977  }
1978 
1979  // set menu vertical base
1980  y = (uis.height - h) / 2;
1981 
1982  // banner is horizontally centered and
1983  // positioned on top of all menu items
1984  if (menu->banner) {
1985  menu->banner_rc.x = (uis.width - menu->banner_rc.width) / 2;
1986  menu->banner_rc.y = y;
1987  y += GENERIC_SPACING(menu->banner_rc.height);
1988  }
1989 
1990  // plaque and logo are vertically centered and
1991  // positioned to the left of bitmaps and cursor
1992  h = 0;
1993  if (menu->plaque) {
1994  h += menu->plaque_rc.height;
1995  }
1996  if (menu->logo) {
1997  h += menu->logo_rc.height + 5;
1998  }
1999 
2000  if (menu->plaque) {
2001  menu->plaque_rc.x = x - CURSOR_WIDTH - menu->plaque_rc.width;
2002  menu->plaque_rc.y = (uis.height - h) / 2;
2003  }
2004 
2005  if (menu->logo) {
2006  menu->logo_rc.x = x - CURSOR_WIDTH - menu->logo_rc.width;
2007  menu->logo_rc.y = (uis.height + h) / 2 - menu->logo_rc.height;
2008  }
2009 
2010  // align items
2011  for (i = 0; i < menu->nitems; i++) {
2012  item = menu->items[i];
2013  if (item->flags & QMF_HIDDEN) {
2014  continue;
2015  }
2016  item->x = x;
2017  item->y = y;
2018  if (item->type == MTYPE_BITMAP) {
2019  y += GENERIC_SPACING(item->height);
2020  } else {
2021  y += MENU_SPACING;
2022  }
2023  }
2024 
2025  // footer is horizontally centered and
2026  // positioned below all menu items
2027  if (menu->footer) {
2028  menu->footer_rc.x = (uis.width - menu->footer_rc.width) / 2;
2029 
2030  menu->footer_rc.y = y;
2031 
2032  if (menu->plaque)
2033  menu->footer_rc.y = max(menu->footer_rc.y, menu->plaque_rc.y + menu->plaque_rc.height);
2034 
2035  if (menu->logo)
2036  menu->footer_rc.y = max(menu->footer_rc.y, menu->logo_rc.y + menu->logo_rc.height);
2037 
2038  menu->footer_rc.y += menu->footer_rc.height;
2039  }
2040 }

Referenced by Menu_Init().

◆ Menu_SlideItem()

menuSound_t Menu_SlideItem ( menuFrameWork_t menu,
int  dir 
)

Definition at line 2330 of file menu.c.

2331 {
2332  menuCommon_t *item;
2333 
2334  if (!(item = Menu_ItemAtCursor(s))) {
2335  return QMS_NOTHANDLED;
2336  }
2337 
2338  switch (item->type) {
2339  case MTYPE_SLIDER:
2340  return Slider_DoSlide((menuSlider_t *)item, dir);
2341  case MTYPE_SPINCONTROL:
2342  case MTYPE_BITFIELD:
2343  case MTYPE_PAIRS:
2344  case MTYPE_VALUES:
2345  case MTYPE_STRINGS:
2346  case MTYPE_TOGGLE:
2347  return SpinControl_DoSlide((menuSpinControl_t *)item, dir);
2348  default:
2349  return QMS_NOTHANDLED;
2350  }
2351 }

Referenced by Menu_DefaultKey().

◆ MenuList_Init()

void MenuList_Init ( menuList_t l)

Definition at line 820 of file menu.c.

821 {
822  int height;
823  int i;
824 
825  height = l->generic.height;
826  if (l->mlFlags & MLF_HEADER) {
828  }
829 
831 
832  //clamp(l->curvalue, 0, l->numItems - 1);
833 
835 
836  l->generic.rect.x = l->generic.x;
837  l->generic.rect.y = l->generic.y;
838 
839  l->generic.rect.width = 0;
840  for (i = 0; i < l->numcolumns; i++) {
841  l->generic.rect.width += l->columns[i].width;
842  }
843 
844  if (l->mlFlags & MLF_SCROLLBAR) {
845  l->generic.rect.width += MLIST_SCROLLBAR_WIDTH;
846  }
847 
848  l->generic.rect.height = l->generic.height;
849 
850  if (l->sortdir && l->sort) {
851  l->sort(l);
852  }
853 }

Referenced by EnterDirectory(), LeaveDirectory(), and Menu_Init().

◆ MenuList_SetValue()

void MenuList_SetValue ( menuList_t l,
int  value 
)

Definition at line 860 of file menu.c.

861 {
862  if (value > l->numItems - 1)
863  value = l->numItems - 1;
864  if (value < 0)
865  value = 0;
866 
867  if (value != l->curvalue) {
868  l->curvalue = value;
869  if (l->generic.change) {
870  l->generic.change(&l->generic);
871  }
872  }
873 
875 }

Referenced by Expose(), LeaveDirectory(), and MenuList_Key().

◆ MenuList_Sort()

void MenuList_Sort ( menuList_t l,
int  offset,
int(*)(const void *, const void *)  cmpfunc 
)

Definition at line 1465 of file menu.c.

1466 {
1467  void *n;
1468  int i;
1469 
1470  if (!l->items)
1471  return;
1472 
1473  if (offset >= l->numItems)
1474  return;
1475 
1476  if (l->sortcol < 0 || l->sortcol >= l->numcolumns)
1477  return;
1478 
1479  if (l->curvalue < 0 || l->curvalue >= l->numItems)
1480  n = NULL;
1481  else
1482  n = l->items[l->curvalue];
1483 
1484  qsort(l->items + offset, l->numItems - offset, sizeof(char *), cmpfunc);
1485 
1486  for (i = 0; i < l->numItems; i++) {
1487  if (l->items[i] == n) {
1488  l->curvalue = i;
1489  break;
1490  }
1491  }
1492 
1493  if (n)
1495 }

Referenced by Sort().

◆ PlayerModel_Free()

void PlayerModel_Free ( void  )

Definition at line 186 of file playermodels.c.

187 {
188  playerModelInfo_t *pmi;
189  int i, j;
190 
191  for (i = 0, pmi = uis.pmi; i < uis.numPlayerModels; i++, pmi++) {
192  if (pmi->skindisplaynames) {
193  for (j = 0; j < pmi->nskins; j++) {
194  Z_Free(pmi->skindisplaynames[j]);
195  }
196  Z_Free(pmi->skindisplaynames);
197  }
198  Z_Free(pmi->directory);
199  memset(pmi, 0, sizeof(*pmi));
200  }
201 
202  uis.numPlayerModels = 0;
203 }

Referenced by UI_Shutdown().

◆ PlayerModel_Load()

void PlayerModel_Load ( void  )

Definition at line 67 of file playermodels.c.

68 {
69  char scratch[MAX_QPATH];
70  size_t len;
71  int ndirs = 0;
72  char *dirnames[MAX_PLAYERMODELS];
73  int i, j;
74  char **list;
75  char *s, *p;
76  int numFiles;
77  playerModelInfo_t *pmi;
78 
79  uis.numPlayerModels = 0;
80 
81  // get a list of directories
82  if (!(list = (char **)FS_ListFiles(NULL, "players/*/tris.md2", FS_SEARCH_BYFILTER | FS_SEARCH_SAVEPATH, &numFiles))) {
83  return;
84  }
85 
86  for (i = 0; i < numFiles; i++) {
87  len = Q_strlcpy(scratch, list[i], sizeof(scratch));
88  if (len >= sizeof(scratch))
89  continue;
90 
91  // make short name for the model
92  if (!(s = strchr(scratch, '/')))
93  continue;
94  s++;
95 
96  if (!(p = strchr(s, '/')))
97  continue;
98  *p = 0;
99 
100  for (j = 0; j < ndirs; j++) {
101  if (!strcmp(dirnames[j], s)) {
102  break;
103  }
104  }
105 
106  if (j != ndirs) {
107  continue;
108  }
109 
110  dirnames[ndirs++] = UI_CopyString(s);
111  if (ndirs == MAX_PLAYERMODELS) {
112  break;
113  }
114  }
115 
116  FS_FreeList((void **)list);
117 
118  if (!ndirs) {
119  return;
120  }
121 
122  // go through the subdirectories
123  for (i = 0; i < ndirs; i++) {
124  int k, s;
125  char **pcxnames;
126  char **skinnames;
127  int npcxfiles;
128  int nskins = 0;
129 
130  // verify the existence of tris.md2
131  Q_concat(scratch, sizeof(scratch), "players/", dirnames[i], "/tris.md2", NULL);
132  if (!FS_FileExists(scratch)) {
133  goto skip;
134  }
135 
136  // verify the existence of at least one pcx skin
137  Q_concat(scratch, sizeof(scratch), "players/", dirnames[i], NULL);
138  pcxnames = (char **)FS_ListFiles(scratch, ".pcx", 0, &npcxfiles);
139  if (!pcxnames) {
140  goto skip;
141  }
142 
143  // count valid skins, which consist of a skin with a matching "_i" icon
144  for (k = 0; k < npcxfiles; k++) {
145  if (!strstr(pcxnames[k], "_i.pcx")) {
146  if (IconOfSkinExists(pcxnames[k], pcxnames, npcxfiles)) {
147  nskins++;
148  }
149  }
150  }
151 
152  if (!nskins) {
153  FS_FreeList((void **)pcxnames);
154  goto skip;
155  }
156 
157  skinnames = UI_Malloc(sizeof(char *) * (nskins + 1));
158  skinnames[nskins] = NULL;
159 
160  // copy the valid skins
161  for (s = 0, k = 0; k < npcxfiles; k++) {
162  if (!strstr(pcxnames[k], "_i.pcx")) {
163  if (IconOfSkinExists(pcxnames[k], pcxnames, npcxfiles)) {
164  COM_StripExtension(pcxnames[k], scratch, sizeof(scratch));
165  skinnames[s++] = UI_CopyString(scratch);
166  }
167  }
168  }
169 
170  FS_FreeList((void **)pcxnames);
171 
172  // at this point we have a valid player model
173  pmi = &uis.pmi[uis.numPlayerModels++];
174  pmi->nskins = nskins;
175  pmi->skindisplaynames = skinnames;
176  pmi->directory = dirnames[i];
177  continue;
178 
179 skip:
180  Z_Free(dirnames[i]);
181  }
182 
183  qsort(uis.pmi, uis.numPlayerModels, sizeof(uis.pmi[0]), pmicmpfnc);
184 }

Referenced by Push().

◆ SpinControl_Init()

void SpinControl_Init ( menuSpinControl_t s)

Definition at line 543 of file menu.c.

544 {
545  char **n;
546  int maxLength, length;
547 
548  s->generic.uiFlags &= ~(UI_LEFT | UI_RIGHT);
549 
550  s->generic.rect.x = s->generic.x + LCOLUMN_OFFSET;
551  s->generic.rect.y = s->generic.y;
552 
554  s->generic.uiFlags | UI_RIGHT, s->generic.name);
555 
556  maxLength = 0;
557  s->numItems = 0;
558  n = s->itemnames;
559  while (*n) {
560  length = strlen(*n);
561 
562  if (maxLength < length) {
563  maxLength = length;
564  }
565  s->numItems++;
566  n++;
567  }
568 
569  s->generic.rect.width += (RCOLUMN_OFFSET - LCOLUMN_OFFSET) +
570  maxLength * CHAR_WIDTH;
571 }

Referenced by Change(), and Menu_Init().

◆ UI_CursorInRect()

qboolean UI_CursorInRect ( vrect_t *  rect)

Definition at line 297 of file ui.c.

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 }

Referenced by Menu_HitTest(), MenuList_Click(), and Slider_Click().

◆ UI_DoHitTest()

qboolean UI_DoHitTest ( void  )

Definition at line 368 of file ui.c.

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 }

Referenced by UI_MouseEvent(), UI_PopMenu(), and UI_PushMenu().

◆ UI_DrawChar()

void UI_DrawChar ( int  x,
int  y,
int  flags,
int  ch 
)

Definition at line 325 of file ui.c.

326 {
327  R_DrawChar(x, y, flags, ch, uis.fontHandle);
328 }

Referenced by Action_Draw(), Keybind_Draw(), Slider_Draw(), and SpinControl_Draw().

◆ UI_DrawRect8()

void UI_DrawRect8 ( const vrect_t *  rect,
int  border,
int  c 
)

Definition at line 342 of file ui.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 }

Referenced by Menu_Draw().

◆ UI_DrawString()

void UI_DrawString ( int  x,
int  y,
int  flags,
const char *  string 
)

Definition at line 314 of file ui.c.

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 }

Referenced by Action_Draw(), Draw(), DrawStatus(), Field_Draw(), Keybind_Draw(), Menu_Draw(), MenuList_DrawString(), Separator_Draw(), Slider_Draw(), SpinControl_Draw(), Static_Draw(), and UI_Draw().

◆ UI_FindMenu()

menuFrameWork_t* UI_FindMenu ( const char *  name)

Definition at line 190 of file ui.c.

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 }

Referenced by Parse_File(), UI_OpenMenu(), and UI_PushMenu_f().

◆ UI_ForceMenuOff()

void UI_ForceMenuOff ( void  )

Definition at line 119 of file ui.c.

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 }

Referenced by UI_OpenMenu(), UI_PopMenu(), and UI_Shutdown().

◆ UI_FormatColumns()

void* UI_FormatColumns ( int  extrasize,
  ... 
)

Definition at line 251 of file ui.c.

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 }

Referenced by AddServer(), BuildDir(), BuildName(), PingSelected(), UI_ErrorEvent(), and UI_StatusEvent().

◆ UI_GetColumn()

char* UI_GetColumn ( char *  s,
int  n 
)

Definition at line 281 of file ui.c.

282 {
283  int i;
284 
285  for (i = 0; i < n && *s; i++) {
286  s += strlen(s) + 1;
287  }
288 
289  return s;
290 }

Referenced by MenuList_Key(), namecmp(), pingcmp(), and WriteCache().

◆ UI_LoadScript()

void UI_LoadScript ( void  )

Definition at line 789 of file script.c.

790 {
791  Parse_File("q2rtx.menu", 0);
792 }

Referenced by UI_Init().

◆ UI_PopMenu()

void UI_PopMenu ( void  )

Definition at line 143 of file ui.c.

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 }

Referenced by Menu_DefaultKey(), UI_PopMenu_f(), and UI_PushMenu().

◆ UI_PushMenu()

void UI_PushMenu ( menuFrameWork_t menu)

Definition at line 39 of file ui.c.

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 }

Referenced by UI_OpenMenu(), and UI_PushMenu_f().

◆ UI_StartSound()

void UI_StartSound ( menuSound_t  sound)

Definition at line 478 of file ui.c.

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 }

Referenced by keybind_cb(), UI_CharEvent(), and UI_KeyEvent().

◆ UI_StringDimensions()

void UI_StringDimensions ( vrect_t *  rc,
int  flags,
const char *  string 
)

Definition at line 330 of file ui.c.

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 }

Referenced by Action_Init(), Field_Init(), Keybind_Init(), Savegame_Push(), SpinControl_Init(), and Static_Init().

Variable Documentation

◆ ui_debug

cvar_t* ui_debug

Definition at line 28 of file ui.c.

Referenced by Menu_Draw(), UI_Draw(), and UI_Init().

◆ ui_menus

◆ uis

Definition at line 24 of file ui.c.

menuCondition_s::value
int value
Definition: ui.h:94
vid_rtx
cvar_t * vid_rtx
Definition: refresh.c:30
ui_sortservers_changed
static void ui_sortservers_changed(cvar_t *self)
Definition: servers.c:840
menuList_s::sortcol
int sortcol
Definition: ui.h:224
menuCommon_s
Definition: ui.h:140
MTYPE_TOGGLE
@ MTYPE_TOGGLE
Definition: ui.h:51
menuFrameWork_s::title
char * title
Definition: ui.h:101
viewmodes
static const char * viewmodes[]
Definition: playerconfig.c:61
menuList_s::columns
menuListColumn_t columns[MAX_COLUMNS]
Definition: ui.h:222
uiStatic_s::transparent
qboolean transparent
Definition: ui.h:301
Strings_Pop
static void Strings_Pop(menuSpinControl_t *s)
Definition: menu.c:749
uiStatic_s::fontHandle
qhandle_t fontHandle
Definition: ui.h:307
QMS_NOTHANDLED
@ QMS_NOTHANDLED
Definition: ui.h:68
ui_listalldemos
static cvar_t * ui_listalldemos
Definition: demos.c:72
menuFrameWork_s::mins
int mins[2]
Definition: ui.h:114
menuCommon_s::change
menuSound_t(* change)(struct menuCommon_s *)
Definition: ui.h:158
uiStatic_s::mouseTracker
menuCommon_t * mouseTracker
Definition: ui.h:297
menuFrameWork_s::status
char * status
Definition: ui.h:101
MenuList_Key
static menuSound_t MenuList_Key(menuList_t *l, int key)
Definition: menu.c:1100
MTYPE_SEPARATOR
@ MTYPE_SEPARATOR
Definition: ui.h:45
Slider_Free
static void Slider_Free(menuSlider_t *s)
Definition: menu.c:1522
menuCommon_s::type
menuType_t type
Definition: ui.h:141
menuCommon_s::keydown
menuSound_t(* keydown)(struct menuCommon_s *, int key)
Definition: ui.h:159
menuCommon_s::focus
menuSound_t(* focus)(struct menuCommon_s *, qboolean gain)
Definition: ui.h:160
menuFrameWork_s::name
char * name
Definition: ui.h:101
height
static int height
Definition: physical_sky.c:39
Size
static void Size(menuFrameWork_t *self)
Definition: demos.c:529
Slider_Key
static menuSound_t Slider_Key(menuSlider_t *s, int key)
Definition: menu.c:1601
MTYPE_STRINGS
@ MTYPE_STRINGS
Definition: ui.h:49
menuCondition_s::cvar
cvar_t * cvar
Definition: ui.h:93
menuList_s::generic
menuCommon_t generic
Definition: ui.h:204
MTYPE_VALUES
@ MTYPE_VALUES
Definition: ui.h:50
SpinControl_Pop
static void SpinControl_Pop(menuSpinControl_t *s)
Definition: menu.c:518
MTYPE_KEYBIND
@ MTYPE_KEYBIND
Definition: ui.h:53
pmicmpfnc
static int pmicmpfnc(const void *_a, const void *_b)
Definition: playermodels.c:46
menuFrameWork_s::size
void(* size)(struct menuFrameWork_s *)
Definition: ui.h:135
Action_Draw
static void Action_Draw(menuAction_t *a)
Definition: menu.c:65
menuCommon_s::activate
menuSound_t(* activate)(struct menuCommon_s *)
Definition: ui.h:157
menuCommon_s::height
int height
Definition: ui.h:150
Free
static void Free(menuFrameWork_t *self)
Definition: servers.c:1060
Key_SetDest
void Key_SetDest(keydest_t dest)
Definition: keys.c:178
MenuList_Draw
static void MenuList_Draw(menuList_t *l)
Definition: menu.c:1333
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
Free
static void Free(menuFrameWork_t *self)
Definition: playerconfig.c:317
Activate
static menuSound_t Activate(menuCommon_t *self)
Definition: demos.c:451
SpinControl_DoEnter
static int SpinControl_DoEnter(menuSpinControl_t *s)
Definition: menu.c:578
menuFrameWork_s::logo_rc
vrect_t logo_rc
Definition: ui.h:124
Action_Init
static void Action_Init(menuAction_t *a)
Definition: menu.c:44
menuFrameWork_s::free
void(* free)(struct menuFrameWork_s *)
Definition: ui.h:136
menuFrameWork_s::push
qboolean(* push)(struct menuFrameWork_s *)
Definition: ui.h:131
Pop
static void Pop(menuFrameWork_t *self)
Definition: servers.c:1045
m_servers_t::menu
menuFrameWork_t menu
Definition: servers.c:67
FS_FreeList
void FS_FreeList(void **list)
Definition: files.c:2939
menuType_t
menuType_t
Definition: ui.h:39
Slider_Pop
static void Slider_Pop(menuSlider_t *s)
Definition: menu.c:1514
Slider_Push
static void Slider_Push(menuSlider_t *s)
Definition: menu.c:1507
uiStatic_s::height
int height
Definition: ui.h:292
Expose
static void Expose(menuFrameWork_t *self)
Definition: servers.c:1054
menuFrameWork_s::expose
void(* expose)(struct menuFrameWork_s *)
Definition: ui.h:133
ui_colorservers_changed
static void ui_colorservers_changed(cvar_t *self)
Definition: servers.c:1065
ui_colorservers
static cvar_t * ui_colorservers
Definition: servers.c:85
menuKeybind_s
Definition: ui.h:262
menuList_s::numcolumns
int numcolumns
Definition: ui.h:223
menuFrameWork_s::logo
qhandle_t logo
Definition: ui.h:123
MTYPE_SAVEGAME
@ MTYPE_SAVEGAME
Definition: ui.h:55
m_player_s::name
menuField_t name
Definition: playerconfig.c:35
MenuList_AdjustPrestep
static void MenuList_AdjustPrestep(menuList_t *l)
Definition: menu.c:802
menuField_s::generic
menuCommon_t generic
Definition: ui.h:164
ca_active
@ ca_active
Definition: client.h:340
playerModelInfo_s
Definition: ui.h:272
IconOfSkinExists
static qboolean IconOfSkinExists(char *skin, char **pcxfiles, int npcxfiles)
Definition: playermodels.c:30
BitField_Push
static void BitField_Push(menuSpinControl_t *s)
Definition: menu.c:656
menuCommon_s::id
int id
Definition: ui.h:142
BitField_Free
static void BitField_Free(menuSpinControl_t *s)
Definition: menu.c:677
client_static_s::state
connstate_t state
Definition: client.h:375
m_demos_s::menu
menuFrameWork_t menu
Definition: demos.c:57
Keybind_Init
static void Keybind_Init(menuKeybind_t *k)
Definition: menu.c:194
Pairs_Push
static void Pairs_Push(menuSpinControl_t *s)
Definition: menu.c:692
Push
static qboolean Push(menuFrameWork_t *self)
Definition: servers.c:1038
R_DrawFill8
void(* R_DrawFill8)(int x, int y, int w, int h, int c)
Definition: refresh.c:422
menuFrameWork_s::image
qhandle_t image
Definition: ui.h:110
MTYPE_BAD
@ MTYPE_BAD
Definition: ui.h:40
Field_Draw
static void Field_Draw(menuField_t *f)
Definition: menu.c:424
QMS_SILENT
@ QMS_SILENT
Definition: ui.h:69
SLOT_EXTRASIZE
#define SLOT_EXTRASIZE
Definition: servers.c:36
CL_WriteConfig
void CL_WriteConfig(void)
Definition: main.c:2391
SpinControl_Draw
static void SpinControl_Draw(menuSpinControl_t *s)
Definition: menu.c:625
ui_sortdemos_changed
static void ui_sortdemos_changed(cvar_t *self)
Definition: demos.c:613
m_servers_t::list
menuList_t list
Definition: servers.c:68
menuCommon_s::rect
vrect_t rect
Definition: ui.h:146
menuFrameWork_s::footer_rc
vrect_t footer_rc
Definition: ui.h:127
UI_ClearBounds
static void UI_ClearBounds(int mins[2], int maxs[2])
Definition: menu.c:1796
menuFrameWork_s
Definition: ui.h:98
Menu_SetFocus
void Menu_SetFocus(menuCommon_t *focus)
Definition: menu.c:2057
menuFrameWork_s::banner
qhandle_t banner
Definition: ui.h:117
menuFrameWork_s::nitems
int nitems
Definition: ui.h:103
menuList_s::maxItems
int maxItems
Definition: ui.h:208
menuList_s::mlFlags
int mlFlags
Definition: ui.h:209
Static_Init
static void Static_Init(menuStatic_t *s)
Definition: menu.c:105
COL_MAX
#define COL_MAX
Definition: demos.c:47
Strings_Push
static void Strings_Push(menuSpinControl_t *s)
Definition: menu.c:735
MTYPE_BITMAP
@ MTYPE_BITMAP
Definition: ui.h:54
menuList_s::items
void ** items
Definition: ui.h:206
MTYPE_STATIC
@ MTYPE_STATIC
Definition: ui.h:52
Keybind_Key
static menuSound_t Keybind_Key(menuKeybind_t *k, int key)
Definition: menu.c:349
Savegame_Push
static void Savegame_Push(menuAction_t *a)
Definition: menu.c:1726
UI_Malloc
#define UI_Malloc(s)
Definition: ui.h:33
UI_AddRectToBounds
static void UI_AddRectToBounds(const vrect_t *rc, int mins[2], int maxs[2])
Definition: menu.c:1802
Keybind_DoEnter
static menuSound_t Keybind_DoEnter(menuKeybind_t *k)
Definition: menu.c:339
Expose
static void Expose(menuFrameWork_t *self)
Definition: demos.c:586
Keydown
static menuSound_t Keydown(menuFrameWork_t *self, int key)
Definition: demos.c:560
Bitmap_Init
static void Bitmap_Init(menuBitmap_t *b)
Definition: menu.c:153
Keybind_Draw
static void Keybind_Draw(menuKeybind_t *k)
Definition: menu.c:226
GENERIC_SPACING
#define GENERIC_SPACING(x)
Definition: ui.h:79
MTYPE_SPINCONTROL
@ MTYPE_SPINCONTROL
Definition: ui.h:44
Menu_HitTest
menuCommon_t * Menu_HitTest(menuFrameWork_t *menu)
Definition: menu.c:2480
UI_PopMenu
void UI_PopMenu(void)
Definition: ui.c:143
menuFrameWork_s::maxs
int maxs[2]
Definition: ui.h:115
m_servers_t::players
menuList_t players
Definition: servers.c:70
Field_Push
static void Field_Push(menuField_t *f)
Definition: menu.c:375
Draw
static void Draw(menuFrameWork_t *self)
Definition: playerconfig.c:125
UI_DoHitTest
qboolean UI_DoHitTest(void)
Definition: ui.c:368
m_player
static m_player_t m_player
Definition: playerconfig.c:50
MLIST_SCROLLBAR_WIDTH
#define MLIST_SCROLLBAR_WIDTH
Definition: ui.h:189
width
static int width
Definition: physical_sky.c:38
menuCommon_s::width
int width
Definition: ui.h:150
RCOLUMN_OFFSET
#define RCOLUMN_OFFSET
Definition: ui.h:76
dlights
static dlight_t dlights[]
Definition: playerconfig.c:69
Draw
static void Draw(menuFrameWork_t *self)
Definition: demos.c:570
QMS_MOVE
@ QMS_MOVE
Definition: ui.h:71
uis
uiStatic_t uis
Definition: ui.c:24
Pop
static void Pop(menuFrameWork_t *self)
Definition: demos.c:579
menuListColumn_s::uiFlags
int uiFlags
Definition: ui.h:200
Menu_DrawStatus
static void Menu_DrawStatus(menuFrameWork_t *menu)
Definition: menu.c:2148
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
menuCondition_s
Definition: ui.h:92
Bitmap_Draw
static void Bitmap_Draw(menuBitmap_t *b)
Definition: menu.c:161
menuListColumn_s::width
int width
Definition: ui.h:199
Slider_Draw
static void Slider_Draw(menuSlider_t *s)
Definition: menu.c:1647
QMF_HASFOCUS
#define QMF_HASFOCUS
Definition: ui.h:62
Size
static void Size(menuFrameWork_t *self)
Definition: playerconfig.c:152
DEMO_EXTRASIZE
#define DEMO_EXTRASIZE
Definition: demos.c:33
menuList_s::sort
menuSound_t(* sort)(struct menuList_s *)
Definition: ui.h:226
uiStatic_s::layers
menuFrameWork_t * layers[MAX_MENU_DEPTH]
Definition: ui.h:295
SpinControl_Free
static void SpinControl_Free(menuSpinControl_t *s)
Definition: menu.c:524
ui_debug
cvar_t * ui_debug
Definition: ui.c:28
Action_Free
static void Action_Free(menuAction_t *a)
Definition: menu.c:31
menuCommon_s::x
int x
Definition: ui.h:149
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
Z_Free
void Z_Free(void *ptr)
Definition: zone.c:147
Sort
static menuSound_t Sort(menuList_t *self)
Definition: demos.c:510
playerModelInfo_s::directory
char * directory
Definition: ui.h:275
Toggle_Pop
static void Toggle_Pop(menuSpinControl_t *s)
Definition: menu.c:773
R_DrawPic
void(* R_DrawPic)(int x, int y, qhandle_t pic)
Definition: refresh.c:419
Draw
static void Draw(menuFrameWork_t *self)
Definition: servers.c:1032
Field_Free
static void Field_Free(menuField_t *f)
Definition: menu.c:386
IN_WarpMouse
void IN_WarpMouse(int x, int y)
Definition: input.c:161
menuList_s::sortdir
int sortdir
Definition: ui.h:224
Change
static menuSound_t Change(menuCommon_t *self)
Definition: servers.c:880
Menu_DefaultKey
static menuSound_t Menu_DefaultKey(menuFrameWork_t *m, int key)
Definition: menu.c:2398
COL_MAX
#define COL_MAX
Definition: servers.c:43
UI_CopyString
#define UI_CopyString(s)
Definition: ui.h:35
m
static struct mdfour * m
Definition: mdfour.c:32
QMS_OUT
@ QMS_OUT
Definition: ui.h:72
Keybind_Free
static void Keybind_Free(menuKeybind_t *k)
Definition: menu.c:180
MTYPE_ACTION
@ MTYPE_ACTION
Definition: ui.h:43
UI_DrawString
void UI_DrawString(int x, int y, int flags, const char *string)
Definition: ui.c:314
FS_ListFiles
void ** FS_ListFiles(const char *path, const char *filter, unsigned flags, int *count_p)
Definition: files.c:2716
m_player_s::hand
menuSpinControl_t hand
Definition: playerconfig.c:38
Menu_MouseMove
menuSound_t Menu_MouseMove(menuCommon_t *item)
Definition: menu.c:2386
m_player_s::entities
entity_t entities[2]
Definition: playerconfig.c:42
origin
static vec3_t origin
Definition: mesh.c:27
R_DrawString
int(* R_DrawString)(int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font)
Definition: refresh.c:417
Field_Char
static int Field_Char(menuField_t *f, int key)
Definition: menu.c:484
m_player_s::refdef
refdef_t refdef
Definition: playerconfig.c:41
Field_Init
static void Field_Init(menuField_t *f)
Definition: menu.c:398
uiStatic_s::activeMenu
menuFrameWork_t * activeMenu
Definition: ui.h:296
Pop
static void Pop(menuFrameWork_t *self)
Definition: playerconfig.c:224
menuFrameWork_s::footer
qhandle_t footer
Definition: ui.h:126
menuSpinControl_s::generic
menuCommon_t generic
Definition: ui.h:230
menuField_s::width
int width
Definition: ui.h:167
menuFrameWork_s::compact
qboolean compact
Definition: ui.h:106
m_demos_s::browse
char browse[MAX_OSPATH]
Definition: demos.c:61
menuSound_t
menuSound_t
Definition: ui.h:67
Q_strlcpy
size_t Q_strlcpy(char *dst, const char *src, size_t size)
Definition: shared.c:715
menuFrameWork_s::plaque_rc
vrect_t plaque_rc
Definition: ui.h:121
menuFrameWork_s::plaque
qhandle_t plaque
Definition: ui.h:120
Keydown
static menuSound_t Keydown(menuFrameWork_t *self, int key)
Definition: servers.c:967
QMF_LEFT_JUSTIFY
#define QMF_LEFT_JUSTIFY
Definition: ui.h:59
Con_Close
void Con_Close(qboolean force)
Definition: console.c:124
menuList_s::numItems
int numItems
Definition: ui.h:207
Menu_AddItem
void Menu_AddItem(menuFrameWork_t *menu, void *item)
Definition: menu.c:1785
UI_DrawRect8
void UI_DrawRect8(const vrect_t *rc, int border, int c)
Definition: ui.c:342
QMF_DISABLED
#define QMF_DISABLED
Definition: ui.h:64
MTYPE_PAIRS
@ MTYPE_PAIRS
Definition: ui.h:48
MAXMENUITEMS
#define MAXMENUITEMS
Definition: ui.h:37
uiStatic_s::menuDepth
int menuDepth
Definition: ui.h:294
menuList_s::extrasize
int extrasize
Definition: ui.h:210
R_DrawFill32
void(* R_DrawFill32)(int x, int y, int w, int h, uint32_t color)
Definition: refresh.c:423
Menu_Size
void Menu_Size(menuFrameWork_t *menu)
Definition: menu.c:1928
menuCondition_s::equals
qboolean equals
Definition: ui.h:95
menuSpinControl_s::itemnames
char ** itemnames
Definition: ui.h:233
Free
static void Free(menuFrameWork_t *self)
Definition: demos.c:608
ui_menus
list_t ui_menus
MLF_SCROLLBAR
#define MLF_SCROLLBAR
Definition: ui.h:194
playerModelInfo_s::skindisplaynames
char ** skindisplaynames
Definition: ui.h:274
ID_SKIN
#define ID_SKIN
Definition: playerconfig.c:31
UI_ForceMenuOff
void UI_ForceMenuOff(void)
Definition: ui.c:119
menuCommon_s::y
int y
Definition: ui.h:149
Change
static menuSound_t Change(menuCommon_t *self)
Definition: playerconfig.c:206
menuFrameWork_s::color
color_t color
Definition: ui.h:111
MLF_HEADER
#define MLF_HEADER
Definition: ui.h:193
QMS_BEEP
@ QMS_BEEP
Definition: ui.h:73
handedness
static const char * handedness[]
Definition: playerconfig.c:54
LCOLUMN_OFFSET
#define LCOLUMN_OFFSET
Definition: ui.h:77
Push
static qboolean Push(menuFrameWork_t *self)
Definition: playerconfig.c:241
m_demos
static m_demos_t m_demos
Definition: demos.c:69
S_StartLocalSound
void S_StartLocalSound(const char *sound)
Definition: main.c:911
MenuList_ValidatePrestep
static void MenuList_ValidatePrestep(menuList_t *l)
Definition: menu.c:792
cls
client_static_t cls
Definition: main.c:98
MTYPE_LOADGAME
@ MTYPE_LOADGAME
Definition: ui.h:56
c
statCounters_t c
Definition: main.c:30
m_servers
static m_servers_t m_servers
Definition: servers.c:82
Keybind_Push
static void Keybind_Push(menuKeybind_t *k)
Definition: menu.c:262
menuSpinControl_s
Definition: ui.h:229
uiStatic_s::pmi
playerModelInfo_t pmi[MAX_PLAYERMODELS]
Definition: ui.h:303
Slider_Init
static void Slider_Init(menuSlider_t *s)
Definition: menu.c:1530
uiStatic_s::color
struct uiStatic_s::@9 color
COM_StripExtension
void COM_StripExtension(const char *in, char *out, size_t size)
Definition: shared.c:174
SpinControl_DoSlide
static int SpinControl_DoSlide(menuSpinControl_t *s, int dir)
Definition: menu.c:600
menuCommon_s::flags
int flags
Definition: ui.h:152
m_servers_t::names
void * names[MAX_STATUS_SERVERS]
Definition: servers.c:71
m_player_s::menu
menuFrameWork_t menu
Definition: playerconfig.c:34
menuFrameWork_s::y1
int y1
Definition: ui.h:112
MLIST_SPACING
#define MLIST_SPACING
Definition: ui.h:187
Size
static void Size(menuFrameWork_t *self)
Definition: servers.c:958
uiStatic_s::mouseCoords
int mouseCoords[2]
Definition: ui.h:298
menuListColumn_s::name
char * name
Definition: ui.h:198
menuCommon_s::name
char * name
Definition: ui.h:143
Key_GetDest
keydest_t Key_GetDest(void)
Definition: keys.c:168
ui_sortservers
static cvar_t * ui_sortservers
Definition: servers.c:84
ui_pingrate
static cvar_t * ui_pingrate
Definition: servers.c:86
Separator_Draw
static void Separator_Draw(menuSeparator_t *s)
Definition: menu.c:1712
m_player_s::model
menuSpinControl_t model
Definition: playerconfig.c:36
MAX_COLUMNS
#define MAX_COLUMNS
Definition: ui.h:185
menuFrameWork_s::banner_rc
vrect_t banner_rc
Definition: ui.h:118
uiStatic_s::width
int width
Definition: ui.h:292
menuFrameWork_s::items
void * items[MAXMENUITEMS]
Definition: ui.h:104
uiStatic_s::background
color_t background
Definition: ui.h:314
menuList_s
Definition: ui.h:203
R_DrawStretchPic
void(* R_DrawStretchPic)(int x, int y, int w, int h, qhandle_t pic)
Definition: refresh.c:420
COL_NAME
#define COL_NAME
Definition: demos.c:42
m_demos_s::list
menuList_t list
Definition: demos.c:58
QMF_HIDDEN
#define QMF_HIDDEN
Definition: ui.h:63
MTYPE_FIELD
@ MTYPE_FIELD
Definition: ui.h:46
Field_Pop
static void Field_Pop(menuField_t *f)
Definition: menu.c:381
Pairs_Pop
static void Pairs_Pop(menuSpinControl_t *s)
Definition: menu.c:706
uiStatic_s::backgroundHandle
qhandle_t backgroundHandle
Definition: ui.h:306
Parse_File
static qboolean Parse_File(const char *path, int depth)
Definition: script.c:624
Change
static menuSound_t Change(menuCommon_t *self)
Definition: demos.c:253
UI_CursorInRect
qboolean UI_CursorInRect(vrect_t *rect)
Definition: ui.c:297
Common_DoEnter
static int Common_DoEnter(menuCommon_t *item)
Definition: menu.c:1767
menuSpinControl_s::numItems
int numItems
Definition: ui.h:235
menuFrameWork_s::entry
list_t entry
Definition: ui.h:99
QMS_IN
@ QMS_IN
Definition: ui.h:70
m_player_s::skin
menuSpinControl_t skin
Definition: playerconfig.c:37
UI_IsItemSelectable
#define UI_IsItemSelectable(item)
Definition: ui.h:85
MTYPE_LIST
@ MTYPE_LIST
Definition: ui.h:42
Separator_Init
static void Separator_Init(menuSeparator_t *s)
Definition: menu.c:1701
ID_MODEL
#define ID_MODEL
Definition: playerconfig.c:30
menuSlider_s
Definition: ui.h:172
R_DrawChar
void(* R_DrawChar)(int x, int y, int flags, int ch, qhandle_t font)
Definition: refresh.c:416
menuFrameWork_s::draw
void(* draw)(struct menuFrameWork_s *)
Definition: ui.h:134
menuFrameWork_s::current_condition
menuCondition_t current_condition
Definition: ui.h:129
Menu_ItemAtCursor
menuCommon_t * Menu_ItemAtCursor(menuFrameWork_t *m)
Definition: menu.c:2042
Toggle_Push
static void Toggle_Push(menuSpinControl_t *s)
Definition: menu.c:763
Slider_DoSlide
static menuSound_t Slider_DoSlide(menuSlider_t *s, int dir)
Definition: menu.c:1625
Q_concat
size_t Q_concat(char *dest, size_t size,...)
Definition: shared.c:758
Pairs_Free
static void Pairs_Free(menuSpinControl_t *s)
Definition: menu.c:712
playerModelInfo_s::nskins
int nskins
Definition: ui.h:273
MTYPE_BITFIELD
@ MTYPE_BITFIELD
Definition: ui.h:47
menuCommon_s::status
char * status
Definition: ui.h:147
Field_Key
static int Field_Key(menuField_t *f, int key)
Definition: menu.c:466
SpinControl_Push
static void SpinControl_Push(menuSpinControl_t *s)
Definition: menu.c:508
MenuList_MouseMove
static menuSound_t MenuList_MouseMove(menuList_t *l)
Definition: menu.c:1275
menuFrameWork_s::pop
void(* pop)(struct menuFrameWork_s *)
Definition: ui.h:132
MTYPE_SLIDER
@ MTYPE_SLIDER
Definition: ui.h:41
menuFrameWork_s::y2
int y2
Definition: ui.h:112
m_player_s::view
menuSpinControl_t view
Definition: playerconfig.c:39
CURSOR_WIDTH
#define CURSOR_WIDTH
Definition: ui.h:284
Sort
static menuSound_t Sort(menuList_t *self)
Definition: servers.c:834
Slider_MouseMove
static menuSound_t Slider_MouseMove(menuSlider_t *s)
Definition: menu.c:1582
menuCommon_s::uiFlags
int uiFlags
Definition: ui.h:153
menuFrameWork_s::transparent
qboolean transparent
Definition: ui.h:107
BitField_Pop
static void BitField_Pop(menuSpinControl_t *s)
Definition: menu.c:665
uiStatic_s::numPlayerModels
int numPlayerModels
Definition: ui.h:302
Keybind_Pop
static void Keybind_Pop(menuKeybind_t *k)
Definition: menu.c:278
MenuList_Init
void MenuList_Init(menuList_t *l)
Definition: menu.c:820
QMF_GRAYED
#define QMF_GRAYED
Definition: ui.h:60
Menu_KeyEvent
menuSound_t Menu_KeyEvent(menuCommon_t *item, int key)
Definition: menu.c:2353
SpinControl_Init
void SpinControl_Init(menuSpinControl_t *s)
Definition: menu.c:543
menuFrameWork_s::keydown
menuSound_t(* keydown)(struct menuFrameWork_s *, int)
Definition: ui.h:137
menuList_s::curvalue
int curvalue
Definition: ui.h:213
Connect
static menuSound_t Connect(menuCommon_t *self)
Definition: servers.c:863
MAX_MENU_DEPTH
#define MAX_MENU_DEPTH
Definition: ui.h:281
m_servers_t::info
menuList_t info
Definition: servers.c:69
MAX_PLAYERMODELS
#define MAX_PLAYERMODELS
Definition: ui.h:270
menuFrameWork_s::keywait
qboolean keywait
Definition: ui.h:108
ui_sortdemos
static cvar_t * ui_sortdemos
Definition: demos.c:71
Bitmap_Free
static void Bitmap_Free(menuBitmap_t *b)
Definition: menu.c:146
menuField_s
Definition: ui.h:163
Static_Draw
static void Static_Draw(menuStatic_t *s)
Definition: menu.c:127
MENU_SPACING
#define MENU_SPACING
Definition: ui.h:81
Menu_Init
void Menu_Init(menuFrameWork_t *menu)
Definition: menu.c:1817