vkQuake2 doxygen  1.0 dev
menu.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 Copyright (C) 2018-2019 Krzysztof Kondrak
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 
14 See the GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 */
21 #include <ctype.h>
22 #ifdef _WIN32
23 #include <io.h>
24 #endif
25 #include "client.h"
26 #include "../client/qmenu.h"
27 
28 extern cvar_t *vid_hudscale;
29 
30 static int m_main_cursor;
31 
34 
35 #define NUM_CURSOR_FRAMES 15
36 
37 static char *menu_in_sound = "misc/menu1.wav";
38 static char *menu_move_sound = "misc/menu2.wav";
39 static char *menu_out_sound = "misc/menu3.wav";
40 
41 void M_Menu_Main_f (void);
42  void M_Menu_Game_f (void);
43  void M_Menu_LoadGame_f (void);
44  void M_Menu_SaveGame_f (void);
45  void M_Menu_PlayerConfig_f (void);
46  void M_Menu_DownloadOptions_f (void);
47  void M_Menu_Credits_f( void );
48  void M_Menu_Multiplayer_f( void );
49  void M_Menu_JoinServer_f (void);
50  void M_Menu_AddressBook_f( void );
51  void M_Menu_StartServer_f (void);
52  void M_Menu_DMOptions_f (void);
53  void M_Menu_Video_f (void);
54  void M_Menu_Options_f (void);
55  void M_Menu_Keys_f (void);
56  void M_Menu_Quit_f (void);
57 
58  void M_Menu_Credits( void );
59 
60 qboolean m_entersound; // play after drawing a frame, so caching
61  // won't disrupt the sound
62 
64 const char *(*m_keyfunc) (int key);
65 
66 //=============================================================================
67 /* Support Routines */
68 
69 #define MAX_MENU_DEPTH 8
70 
71 
72 typedef struct
73 {
74  void (*draw) (void);
75  const char *(*key) (int k);
76 } menulayer_t;
77 
80 
81 static void M_Banner( char *name )
82 {
83  int w, h;
84 
85  re.DrawGetPicSize (&w, &h, name );
86  re.DrawPic( viddef.width / 2 - w / 2, viddef.height / 2 - 110 * vid_hudscale->value, name );
87 }
88 
89 void M_PushMenu ( void (*draw) (void), const char *(*key) (int k) )
90 {
91  int i;
92 
93  if (Cvar_VariableValue ("maxclients") == 1
94  && Com_ServerState ())
95  Cvar_Set ("paused", "1");
96 
97  // if this menu is already present, drop back to that level
98  // to avoid stacking menus by hotkeys
99  for (i=0 ; i<m_menudepth ; i++)
100  if (m_layers[i].draw == draw &&
101  m_layers[i].key == key)
102  {
103  m_menudepth = i;
104  }
105 
106  if (i == m_menudepth)
107  {
109  Com_Error (ERR_FATAL, "M_PushMenu: MAX_MENU_DEPTH");
112  m_menudepth++;
113  }
114 
115  m_drawfunc = draw;
116  m_keyfunc = key;
117 
118  m_entersound = true;
119 
121 }
122 
123 void M_ForceMenuOff (void)
124 {
125  m_drawfunc = 0;
126  m_keyfunc = 0;
128  m_menudepth = 0;
129  Key_ClearStates ();
130  Cvar_Set ("paused", "0");
131 }
132 
133 void M_PopMenu (void)
134 {
136  if (m_menudepth < 1)
137  Com_Error (ERR_FATAL, "M_PopMenu: depth < 1");
138  m_menudepth--;
139 
142 
143  if (!m_menudepth)
144  M_ForceMenuOff ();
145 }
146 
147 
148 const char *Default_MenuKey( menuframework_s *m, int key )
149 {
150  const char *sound = NULL;
151  menucommon_s *item;
152 
153  if ( m )
154  {
155  if ( ( item = Menu_ItemAtCursor( m ) ) != 0 )
156  {
157  if ( item->type == MTYPE_FIELD )
158  {
159  if ( Field_Key( ( menufield_s * ) item, key ) )
160  return NULL;
161  }
162  }
163  }
164 
165  switch ( key )
166  {
167  case K_ESCAPE:
168  M_PopMenu();
169  return menu_out_sound;
170  case K_KP_UPARROW:
171  case K_UPARROW:
172  if ( m )
173  {
174  m->cursor--;
175  Menu_AdjustCursor( m, -1 );
176  sound = menu_move_sound;
177  }
178  break;
179  case K_TAB:
180  if ( m )
181  {
182  m->cursor++;
183  Menu_AdjustCursor( m, 1 );
184  sound = menu_move_sound;
185  }
186  break;
187  case K_KP_DOWNARROW:
188  case K_DOWNARROW:
189  if ( m )
190  {
191  m->cursor++;
192  Menu_AdjustCursor( m, 1 );
193  sound = menu_move_sound;
194  }
195  break;
196  case K_KP_LEFTARROW:
197  case K_LEFTARROW:
198  if ( m )
199  {
200  Menu_SlideItem( m, -1 );
201  sound = menu_move_sound;
202  }
203  break;
204  case K_KP_RIGHTARROW:
205  case K_RIGHTARROW:
206  if ( m )
207  {
208  Menu_SlideItem( m, 1 );
209  sound = menu_move_sound;
210  }
211  break;
212 
213  case K_MOUSE1:
214  case K_MOUSE2:
215  case K_MOUSE3:
216  case K_JOY1:
217  case K_JOY2:
218  case K_JOY3:
219  case K_JOY4:
220  case K_AUX1:
221  case K_AUX2:
222  case K_AUX3:
223  case K_AUX4:
224  case K_AUX5:
225  case K_AUX6:
226  case K_AUX7:
227  case K_AUX8:
228  case K_AUX9:
229  case K_AUX10:
230  case K_AUX11:
231  case K_AUX12:
232  case K_AUX13:
233  case K_AUX14:
234  case K_AUX15:
235  case K_AUX16:
236  case K_AUX17:
237  case K_AUX18:
238  case K_AUX19:
239  case K_AUX20:
240  case K_AUX21:
241  case K_AUX22:
242  case K_AUX23:
243  case K_AUX24:
244  case K_AUX25:
245  case K_AUX26:
246  case K_AUX27:
247  case K_AUX28:
248  case K_AUX29:
249  case K_AUX30:
250  case K_AUX31:
251  case K_AUX32:
252 
253  case K_KP_ENTER:
254  case K_ENTER:
255  if ( m )
256  Menu_SelectItem( m );
257  sound = menu_move_sound;
258  break;
259  }
260 
261  return sound;
262 }
263 
264 //=============================================================================
265 
266 /*
267 ================
268 M_DrawCharacter
269 
270 Draws one solid graphics character
271 cx and cy are in 320*240 coordinates, and will be centered on
272 higher res screens.
273 ================
274 */
275 void M_DrawCharacter (int cx, int cy, int num)
276 {
277  re.DrawChar ( cx + ((viddef.width - 320)>>1), cy + ((viddef.height - 240)>>1), num);
278 }
279 
280 void M_Print (int cx, int cy, char *str)
281 {
282  while (*str)
283  {
284  M_DrawCharacter (cx, cy, (*str)+128);
285  str++;
286  cx += 8 * vid_hudscale->value;
287  }
288 }
289 
290 void M_PrintWhite (int cx, int cy, char *str)
291 {
292  while (*str)
293  {
294  M_DrawCharacter (cx, cy, *str);
295  str++;
296  cx += 8 * vid_hudscale->value;
297  }
298 }
299 
300 void M_DrawPic (int x, int y, char *pic)
301 {
302  re.DrawPic (x + ((viddef.width - 320)>>1), y + ((viddef.height - 240)>>1), pic);
303 }
304 
305 
306 /*
307 =============
308 M_DrawCursor
309 
310 Draws an animating cursor with the point at
311 x,y. The pic will extend to the left of x,
312 and both above and below y.
313 =============
314 */
315 void M_DrawCursor( int x, int y, int f )
316 {
317  char cursorname[80];
318  static qboolean cached;
319 
320  if ( !cached )
321  {
322  int i;
323 
324  for ( i = 0; i < NUM_CURSOR_FRAMES; i++ )
325  {
326  Com_sprintf( cursorname, sizeof( cursorname ), "m_cursor%d", i );
327 
328  re.RegisterPic( cursorname );
329  }
330  cached = true;
331  }
332 
333  Com_sprintf( cursorname, sizeof(cursorname), "m_cursor%d", f );
334  re.DrawPic( x, y, cursorname );
335 }
336 
337 void M_DrawTextBox (int x, int y, int width, int lines)
338 {
339  int cx, cy;
340  int n;
341 
342  // draw left side
343  cx = x;
344  cy = y;
345  M_DrawCharacter (cx, cy, 1);
346  for (n = 0; n < lines; n++)
347  {
348  cy += 8 * vid_hudscale->value;
349  M_DrawCharacter (cx, cy, 4);
350  }
351  M_DrawCharacter (cx, cy + 8 * vid_hudscale->value, 7);
352 
353  // draw middle
354  cx += 8 * vid_hudscale->value;
355  while (width > 0)
356  {
357  cy = y;
358  M_DrawCharacter (cx, cy, 2);
359  for (n = 0; n < lines; n++)
360  {
361  cy += 8 * vid_hudscale->value;
362  M_DrawCharacter (cx, cy, 5);
363  }
364  M_DrawCharacter (cx, cy + 8 * vid_hudscale->value, 8);
365  width -= 1;
366  cx += 8 * vid_hudscale->value;
367  }
368 
369  // draw right side
370  cy = y;
371  M_DrawCharacter (cx, cy, 3);
372  for (n = 0; n < lines; n++)
373  {
374  cy += 8 * vid_hudscale->value;
375  M_DrawCharacter (cx, cy, 6);
376  }
377  M_DrawCharacter (cx, cy + 8 * vid_hudscale->value, 9);
378 }
379 
380 
381 /*
382 =======================================================================
383 
384 MAIN MENU
385 
386 =======================================================================
387 */
388 #define MAIN_ITEMS 5
389 
390 
391 void M_Main_Draw (void)
392 {
393  int i;
394  int w, h;
395  int ystart;
396  int xoffset;
397  int widest = -1;
398  int totalheight = 0;
399  char litname[80];
400  char *names[] =
401  {
402  "m_main_game",
403  "m_main_multiplayer",
404  "m_main_options",
405  "m_main_video",
406  "m_main_quit",
407  0
408  };
409 
410  for ( i = 0; names[i] != 0; i++ )
411  {
412  re.DrawGetPicSize( &w, &h, names[i] );
413 
414  if ( w > widest )
415  widest = w;
416  totalheight += ( h + 12 );
417  }
418 
419  ystart = ( viddef.height / 2 - 110 * vid_hudscale->value);
420  xoffset = ( viddef.width - widest + 70 * vid_hudscale->value) / 2;
421 
422  for ( i = 0; names[i] != 0; i++ )
423  {
424  if ( i != m_main_cursor )
425  re.DrawPic( xoffset, ystart + (i * 40 + 13)*vid_hudscale->value, names[i] );
426  }
427  strcpy( litname, names[m_main_cursor] );
428  strcat( litname, "_sel" );
429  re.DrawPic( xoffset, ystart + (m_main_cursor * 40 + 13) * vid_hudscale->value, litname );
430 
432 
433  re.DrawGetPicSize( &w, &h, "m_main_plaque" );
434  re.DrawPic( xoffset - 30 * vid_hudscale->value - w, ystart, "m_main_plaque" );
435 
436  re.DrawPic( xoffset - 30 * vid_hudscale->value - w, ystart + h + 5*vid_hudscale->value, "m_main_logo" );
437 }
438 
439 
440 const char *M_Main_Key (int key)
441 {
442  const char *sound = menu_move_sound;
443 
444  switch (key)
445  {
446  case K_ESCAPE:
447  M_PopMenu ();
448  break;
449 
450  case K_KP_DOWNARROW:
451  case K_DOWNARROW:
452  if (++m_main_cursor >= MAIN_ITEMS)
453  m_main_cursor = 0;
454  return sound;
455 
456  case K_KP_UPARROW:
457  case K_UPARROW:
458  if (--m_main_cursor < 0)
460  return sound;
461 
462  case K_KP_ENTER:
463  case K_ENTER:
464  m_entersound = true;
465 
466  switch (m_main_cursor)
467  {
468  case 0:
469  M_Menu_Game_f ();
470  break;
471 
472  case 1:
474  break;
475 
476  case 2:
477  M_Menu_Options_f ();
478  break;
479 
480  case 3:
481  M_Menu_Video_f ();
482  break;
483 
484  case 4:
485  M_Menu_Quit_f ();
486  break;
487  }
488  }
489 
490  return NULL;
491 }
492 
493 
494 void M_Menu_Main_f (void)
495 {
497 }
498 
499 /*
500 =======================================================================
501 
502 MULTIPLAYER MENU
503 
504 =======================================================================
505 */
510 
511 static void Multiplayer_MenuDraw (void)
512 {
513  M_Banner( "m_banner_multiplayer" );
514 
517 }
518 
519 static void PlayerSetupFunc( void *unused )
520 {
522 }
523 
524 static void JoinNetworkServerFunc( void *unused )
525 {
527 }
528 
529 static void StartNetworkServerFunc( void *unused )
530 {
532 }
533 
535 {
538 
543  s_join_network_server_action.generic.name = " join network server";
545 
550  s_start_network_server_action.generic.name = " start network server";
552 
557  s_player_setup_action.generic.name = " player setup";
559 
563 
565 
567 }
568 
569 const char *Multiplayer_MenuKey( int key )
570 {
571  return Default_MenuKey( &s_multiplayer_menu, key );
572 }
573 
575 {
578 }
579 
580 /*
581 =======================================================================
582 
583 KEYS MENU
584 
585 =======================================================================
586 */
587 char *bindnames[][2] =
588 {
589 {"+attack", "attack"},
590 {"weapnext", "next weapon"},
591 {"weapprev", "prev weapon"},
592 {"weaplast", "last weapon"},
593 {"+forward", "walk forward"},
594 {"+back", "backpedal"},
595 {"+left", "turn left"},
596 {"+right", "turn right"},
597 {"+speed", "run"},
598 {"+moveleft", "step left"},
599 {"+moveright", "step right"},
600 {"+strafe", "sidestep"},
601 {"+lookup", "look up"},
602 {"+lookdown", "look down"},
603 {"centerview", "center view"},
604 {"+mlook", "mouse look"},
605 {"+klook", "keyboard look"},
606 {"+moveup", "up / jump"},
607 {"+movedown", "down / crouch"},
608 
609 {"inven", "inventory"},
610 {"invuse", "use item"},
611 {"invdrop", "drop item"},
612 {"invprev", "prev item"},
613 {"invnext", "next item"},
614 
615 {"cmd help", "help computer" },
616 { 0, 0 }
617 };
618 
620 static int bind_grab;
621 
647 
649 
650 static void M_UnbindCommand (char *command)
651 {
652  int j;
653  int l;
654  char *b;
655 
656  l = (int)strlen(command);
657 
658  for (j=0 ; j<256 ; j++)
659  {
660  b = keybindings[j];
661  if (!b)
662  continue;
663  if (!strncmp (b, command, l) )
664  Key_SetBinding (j, "");
665  }
666 }
667 
668 static void M_FindKeysForCommand (char *command, int *twokeys)
669 {
670  int count;
671  int j;
672  int l;
673  char *b;
674 
675  twokeys[0] = twokeys[1] = -1;
676  l = (int)strlen(command);
677  count = 0;
678 
679  for (j=0 ; j<256 ; j++)
680  {
681  b = keybindings[j];
682  if (!b)
683  continue;
684  if (!strncmp (b, command, l) )
685  {
686  twokeys[count] = j;
687  count++;
688  if (count == 2)
689  break;
690  }
691  }
692 }
693 
694 static void KeyCursorDrawFunc( menuframework_s *menu )
695 {
696  if ( bind_grab )
697  re.DrawChar( menu->x, menu->y + menu->cursor * 9 * vid_hudscale->value, '=' );
698  else
699  re.DrawChar( menu->x, menu->y + menu->cursor * 9 * vid_hudscale->value, 12 + ( ( int ) ( Sys_Milliseconds() / 250 ) & 1 ) );
700 }
701 
702 static void DrawKeyBindingFunc( void *self )
703 {
704  int keys[2];
705  menuaction_s *a = ( menuaction_s * ) self;
706 
708 
709  if (keys[0] == -1)
710  {
711  Menu_DrawString( a->generic.x + a->generic.parent->x + 16 * vid_hudscale->value, a->generic.y + a->generic.parent->y, "???" );
712  }
713  else
714  {
715  int x;
716  const char *name;
717 
718  name = Key_KeynumToString (keys[0]);
719 
721 
722  x = strlen(name) * 8 * vid_hudscale->value;
723 
724  if (keys[1] != -1)
725  {
726  Menu_DrawString( a->generic.x + a->generic.parent->x + 24 * vid_hudscale->value + x, a->generic.y + a->generic.parent->y, "or" );
727  Menu_DrawString( a->generic.x + a->generic.parent->x + 48 * vid_hudscale->value + x, a->generic.y + a->generic.parent->y, Key_KeynumToString (keys[1]) );
728  }
729  }
730 }
731 
732 static void KeyBindingFunc( void *self )
733 {
734  menuaction_s *a = ( menuaction_s * ) self;
735  int keys[2];
736 
737  M_FindKeysForCommand( bindnames[a->generic.localdata[0]][0], keys );
738 
739  if (keys[1] != -1)
741 
742  bind_grab = true;
743 
744  Menu_SetStatusBar( &s_keys_menu, "press a key or button for this action" );
745 }
746 
747 static void Keys_MenuInit( void )
748 {
749  int y = 0;
750  int i = 0;
751 
752  s_keys_menu.x = viddef.width * 0.50;
753  s_keys_menu.nitems = 0;
755 
763 
771 
779 
787 
795 
803 
811 
819 
827 
835 
843 
851 
859 
867 
875 
883 
891 
899 
907 
915 
923 
931 
939 
947 
955 
964  Menu_AddItem( &s_keys_menu, ( void * ) &s_keys_run_action );
975 
981 
983 
984  Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
986 }
987 
988 static void Keys_MenuDraw (void)
989 {
992 }
993 
994 static const char *Keys_MenuKey( int key )
995 {
997 
998  if ( bind_grab )
999  {
1000  if ( key != K_ESCAPE && key != '`' )
1001  {
1002  char cmd[1024];
1003 
1004  Com_sprintf (cmd, sizeof(cmd), "bind \"%s\" \"%s\"\n", Key_KeynumToString(key), bindnames[item->generic.localdata[0]][0]);
1005  Cbuf_InsertText (cmd);
1006  }
1007 
1008  Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
1009  bind_grab = false;
1010  return menu_out_sound;
1011  }
1012 
1013  switch ( key )
1014  {
1015  case K_KP_ENTER:
1016  case K_ENTER:
1017  KeyBindingFunc( item );
1018  return menu_in_sound;
1019  case K_BACKSPACE: // delete bindings
1020  case K_DEL: // delete bindings
1021  case K_KP_DEL:
1022  M_UnbindCommand( bindnames[item->generic.localdata[0]][0] );
1023  return menu_out_sound;
1024  default:
1025  return Default_MenuKey( &s_keys_menu, key );
1026  }
1027 }
1028 
1029 void M_Menu_Keys_f (void)
1030 {
1031  Keys_MenuInit();
1033 }
1034 
1035 
1036 /*
1037 =======================================================================
1038 
1039 CONTROLS MENU
1040 
1041 =======================================================================
1042 */
1044 extern cvar_t *in_joystick;
1045 
1063 
1064 static void CrosshairFunc( void *unused )
1065 {
1067 }
1068 
1069 static void JoystickFunc( void *unused )
1070 {
1071  Cvar_SetValue( "in_joystick", s_options_joystick_box.curvalue );
1072 }
1073 
1074 static void CustomizeControlsFunc( void *unused )
1075 {
1076  M_Menu_Keys_f();
1077 }
1078 
1079 static void AlwaysRunFunc( void *unused )
1080 {
1082 }
1083 
1084 static void FreeLookFunc( void *unused )
1085 {
1087 }
1088 
1089 static void MouseSpeedFunc( void *unused )
1090 {
1091  Cvar_SetValue( "sensitivity", s_options_sensitivity_slider.curvalue / 2.0F );
1092 }
1093 
1094 static void NoAltTabFunc( void *unused )
1095 {
1096  Cvar_SetValue( "win_noalttab", s_options_noalttab_box.curvalue );
1097 }
1098 
1099 static float ClampCvar( float min, float max, float value )
1100 {
1101  if ( value < min ) return min;
1102  if ( value > max ) return max;
1103  return value;
1104 }
1105 
1106 static void ControlsSetMenuItemValues( void )
1107 {
1110  s_options_quality_list.curvalue = !Cvar_VariableValue( "s_loadas8bit" );
1112 
1113  Cvar_SetValue( "cl_run", ClampCvar( 0, 1, cl_run->value ) );
1115 
1117 
1118  Cvar_SetValue( "lookspring", ClampCvar( 0, 1, lookspring->value ) );
1120 
1121  Cvar_SetValue( "lookstrafe", ClampCvar( 0, 1, lookstrafe->value ) );
1123 
1124  Cvar_SetValue( "freelook", ClampCvar( 0, 1, freelook->value ) );
1126 
1127  Cvar_SetValue( "crosshair", ClampCvar( 0, 3, crosshair->value ) );
1129 
1130  Cvar_SetValue( "in_joystick", ClampCvar( 0, 1, in_joystick->value ) );
1132 
1134 }
1135 
1136 static void ControlsResetDefaultsFunc( void *unused )
1137 {
1138  Cbuf_AddText ("exec default.cfg\n");
1139  Cbuf_Execute();
1140 
1142 }
1143 
1144 static void InvertMouseFunc( void *unused )
1145 {
1146  Cvar_SetValue( "m_pitch", -m_pitch->value );
1147 }
1148 
1149 static void LookspringFunc( void *unused )
1150 {
1151  Cvar_SetValue( "lookspring", !lookspring->value );
1152 }
1153 
1154 static void LookstrafeFunc( void *unused )
1155 {
1156  Cvar_SetValue( "lookstrafe", !lookstrafe->value );
1157 }
1158 
1159 static void UpdateVolumeFunc( void *unused )
1160 {
1162 }
1163 
1164 static void UpdateCDVolumeFunc( void *unused )
1165 {
1167 }
1168 
1169 static void ConsoleFunc( void *unused )
1170 {
1171  /*
1172  ** the proper way to do this is probably to have ToggleConsole_f accept a parameter
1173  */
1174  extern void Key_ClearTyping( void );
1175 
1176  if ( cl.attractloop )
1177  {
1178  Cbuf_AddText ("killserver\n");
1179  return;
1180  }
1181 
1182  Key_ClearTyping ();
1183  Con_ClearNotify ();
1184 
1185  M_ForceMenuOff ();
1187 }
1188 
1189 static void UpdateSoundQualityFunc( void *unused )
1190 {
1192  {
1193  Cvar_SetValue( "s_khz", 22 );
1194  Cvar_SetValue( "s_loadas8bit", false );
1195  }
1196  else
1197  {
1198  Cvar_SetValue( "s_khz", 11 );
1199  Cvar_SetValue( "s_loadas8bit", true );
1200  }
1201 
1203 
1204  update_sound_quality = true;
1205 }
1206 
1207 void Options_MenuInit( void )
1208 {
1209  static const char *cd_music_items[] =
1210  {
1211  "disabled",
1212  "enabled",
1213  0
1214  };
1215  static const char *quality_items[] =
1216  {
1217  "low", "high", 0
1218  };
1219 
1220  static const char *compatibility_items[] =
1221  {
1222  "max compatibility", "max performance", 0
1223  };
1224 
1225  static const char *yesno_names[] =
1226  {
1227  "no",
1228  "yes",
1229  0
1230  };
1231 
1232  static const char *crosshair_names[] =
1233  {
1234  "none",
1235  "cross",
1236  "dot",
1237  "angle",
1238  0
1239  };
1240 
1241  win_noalttab = Cvar_Get( "win_noalttab", "0", CVAR_ARCHIVE );
1242 
1243  /*
1244  ** configure controls menu and menu items
1245  */
1246  s_options_menu.x = viddef.width / 2;
1248  s_options_menu.nitems = 0;
1249 
1253  s_options_sfxvolume_slider.generic.name = "effects volume";
1258 
1262  s_options_cdvolume_box.generic.name = "CD music";
1264  s_options_cdvolume_box.itemnames = cd_music_items;
1266 
1270  s_options_quality_list.generic.name = "sound quality";
1272  s_options_quality_list.itemnames = quality_items;
1273  s_options_quality_list.curvalue = !Cvar_VariableValue( "s_loadas8bit" );
1274 
1278  s_options_compatibility_list.generic.name = "sound compatibility";
1280  s_options_compatibility_list.itemnames = compatibility_items;
1282 
1286  s_options_sensitivity_slider.generic.name = "mouse speed";
1290 
1294  s_options_alwaysrun_box.generic.name = "always run";
1296  s_options_alwaysrun_box.itemnames = yesno_names;
1297 
1301  s_options_invertmouse_box.generic.name = "invert mouse";
1303  s_options_invertmouse_box.itemnames = yesno_names;
1304 
1308  s_options_lookspring_box.generic.name = "lookspring";
1310  s_options_lookspring_box.itemnames = yesno_names;
1311 
1315  s_options_lookstrafe_box.generic.name = "lookstrafe";
1317  s_options_lookstrafe_box.itemnames = yesno_names;
1318 
1322  s_options_freelook_box.generic.name = "free look";
1324  s_options_freelook_box.itemnames = yesno_names;
1325 
1329  s_options_crosshair_box.generic.name = "crosshair";
1331  s_options_crosshair_box.itemnames = crosshair_names;
1332 
1336  s_options_joystick_box.generic.name = "use joystick";
1338  s_options_joystick_box.itemnames = yesno_names;
1339 
1343  s_options_customize_options_action.generic.name = "customize controls";
1345 
1349  s_options_defaults_action.generic.name = "reset defaults";
1351 
1355  s_options_console_action.generic.name = "go to console";
1357 
1359 
1375 }
1376 
1377 void Options_MenuDraw (void)
1378 {
1379  M_Banner( "m_banner_options" );
1382 
1384  {
1385  M_DrawTextBox(8 - 152 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value, 36, 3);
1386  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 8 * vid_hudscale->value, "Restarting the sound system. This");
1387  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 16 * vid_hudscale->value, "could take up to a minute, so");
1388  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 24 * vid_hudscale->value, "please be patient.");
1389 
1390  CL_Snd_Restart_f();
1391  update_sound_quality = false;
1392  }
1393 }
1394 
1395 const char *Options_MenuKey( int key )
1396 {
1397  return Default_MenuKey( &s_options_menu, key );
1398 }
1399 
1400 void M_Menu_Options_f (void)
1401 {
1402  Options_MenuInit();
1404 }
1405 
1406 /*
1407 =======================================================================
1408 
1409 VIDEO MENU
1410 
1411 =======================================================================
1412 */
1413 
1414 void M_Menu_Video_f (void)
1415 {
1416  VID_MenuInit();
1418 }
1419 
1420 /*
1421 =============================================================================
1422 
1423 END GAME MENU
1424 
1425 =============================================================================
1426 */
1428 static const char **credits;
1429 static char *creditsIndex[256];
1430 static char *creditsBuffer;
1431 static const char *idcredits[] =
1432 {
1433  "+QUAKE II BY ID SOFTWARE",
1434  "",
1435  "+PROGRAMMING",
1436  "John Carmack",
1437  "John Cash",
1438  "Brian Hook",
1439  "",
1440  "+ART",
1441  "Adrian Carmack",
1442  "Kevin Cloud",
1443  "Paul Steed",
1444  "",
1445  "+LEVEL DESIGN",
1446  "Tim Willits",
1447  "American McGee",
1448  "Christian Antkow",
1449  "Paul Jaquays",
1450  "Brandon James",
1451  "",
1452  "+BIZ",
1453  "Todd Hollenshead",
1454  "Barrett (Bear) Alexander",
1455  "Donna Jackson",
1456  "",
1457  "",
1458  "+SPECIAL THANKS",
1459  "Ben Donges for beta testing",
1460  "",
1461  "",
1462  "",
1463  "",
1464  "",
1465  "",
1466  "+ADDITIONAL SUPPORT",
1467  "",
1468  "+LINUX PORT AND CTF",
1469  "Dave \"Zoid\" Kirsch",
1470  "",
1471  "+CINEMATIC SEQUENCES",
1472  "Ending Cinematic by Blur Studio - ",
1473  "Venice, CA",
1474  "",
1475  "Environment models for Introduction",
1476  "Cinematic by Karl Dolgener",
1477  "",
1478  "Assistance with environment design",
1479  "by Cliff Iwai",
1480  "",
1481  "+SOUND EFFECTS AND MUSIC",
1482  "Sound Design by Soundelux Media Labs.",
1483  "Music Composed and Produced by",
1484  "Soundelux Media Labs. Special thanks",
1485  "to Bill Brown, Tom Ozanich, Brian",
1486  "Celano, Jeff Eisner, and The Soundelux",
1487  "Players.",
1488  "",
1489  "\"Level Music\" by Sonic Mayhem",
1490  "www.sonicmayhem.com",
1491  "",
1492  "\"Quake II Theme Song\"",
1493  "(C) 1997 Rob Zombie. All Rights",
1494  "Reserved.",
1495  "",
1496  "Track 10 (\"Climb\") by Jer Sypult",
1497  "",
1498  "Voice of computers by",
1499  "Carly Staehlin-Taylor",
1500  "",
1501  "+THANKS TO ACTIVISION",
1502  "+IN PARTICULAR:",
1503  "",
1504  "John Tam",
1505  "Steve Rosenthal",
1506  "Marty Stratton",
1507  "Henk Hartong",
1508  "",
1509  "Quake II(tm) (C)1997 Id Software, Inc.",
1510  "All Rights Reserved. Distributed by",
1511  "Activision, Inc. under license.",
1512  "Quake II(tm), the Id Software name,",
1513  "the \"Q II\"(tm) logo and id(tm)",
1514  "logo are trademarks of Id Software,",
1515  "Inc. Activision(R) is a registered",
1516  "trademark of Activision, Inc. All",
1517  "other trademarks and trade names are",
1518  "properties of their respective owners.",
1519  0
1520 };
1521 
1522 static const char *xatcredits[] =
1523 {
1524  "+QUAKE II MISSION PACK: THE RECKONING",
1525  "+BY",
1526  "+XATRIX ENTERTAINMENT, INC.",
1527  "",
1528  "+DESIGN AND DIRECTION",
1529  "Drew Markham",
1530  "",
1531  "+PRODUCED BY",
1532  "Greg Goodrich",
1533  "",
1534  "+PROGRAMMING",
1535  "Rafael Paiz",
1536  "",
1537  "+LEVEL DESIGN / ADDITIONAL GAME DESIGN",
1538  "Alex Mayberry",
1539  "",
1540  "+LEVEL DESIGN",
1541  "Mal Blackwell",
1542  "Dan Koppel",
1543  "",
1544  "+ART DIRECTION",
1545  "Michael \"Maxx\" Kaufman",
1546  "",
1547  "+COMPUTER GRAPHICS SUPERVISOR AND",
1548  "+CHARACTER ANIMATION DIRECTION",
1549  "Barry Dempsey",
1550  "",
1551  "+SENIOR ANIMATOR AND MODELER",
1552  "Jason Hoover",
1553  "",
1554  "+CHARACTER ANIMATION AND",
1555  "+MOTION CAPTURE SPECIALIST",
1556  "Amit Doron",
1557  "",
1558  "+ART",
1559  "Claire Praderie-Markham",
1560  "Viktor Antonov",
1561  "Corky Lehmkuhl",
1562  "",
1563  "+INTRODUCTION ANIMATION",
1564  "Dominique Drozdz",
1565  "",
1566  "+ADDITIONAL LEVEL DESIGN",
1567  "Aaron Barber",
1568  "Rhett Baldwin",
1569  "",
1570  "+3D CHARACTER ANIMATION TOOLS",
1571  "Gerry Tyra, SA Technology",
1572  "",
1573  "+ADDITIONAL EDITOR TOOL PROGRAMMING",
1574  "Robert Duffy",
1575  "",
1576  "+ADDITIONAL PROGRAMMING",
1577  "Ryan Feltrin",
1578  "",
1579  "+PRODUCTION COORDINATOR",
1580  "Victoria Sylvester",
1581  "",
1582  "+SOUND DESIGN",
1583  "Gary Bradfield",
1584  "",
1585  "+MUSIC BY",
1586  "Sonic Mayhem",
1587  "",
1588  "",
1589  "",
1590  "+SPECIAL THANKS",
1591  "+TO",
1592  "+OUR FRIENDS AT ID SOFTWARE",
1593  "",
1594  "John Carmack",
1595  "John Cash",
1596  "Brian Hook",
1597  "Adrian Carmack",
1598  "Kevin Cloud",
1599  "Paul Steed",
1600  "Tim Willits",
1601  "Christian Antkow",
1602  "Paul Jaquays",
1603  "Brandon James",
1604  "Todd Hollenshead",
1605  "Barrett (Bear) Alexander",
1606  "Dave \"Zoid\" Kirsch",
1607  "Donna Jackson",
1608  "",
1609  "",
1610  "",
1611  "+THANKS TO ACTIVISION",
1612  "+IN PARTICULAR:",
1613  "",
1614  "Marty Stratton",
1615  "Henk \"The Original Ripper\" Hartong",
1616  "Kevin Kraff",
1617  "Jamey Gottlieb",
1618  "Chris Hepburn",
1619  "",
1620  "+AND THE GAME TESTERS",
1621  "",
1622  "Tim Vanlaw",
1623  "Doug Jacobs",
1624  "Steven Rosenthal",
1625  "David Baker",
1626  "Chris Campbell",
1627  "Aaron Casillas",
1628  "Steve Elwell",
1629  "Derek Johnstone",
1630  "Igor Krinitskiy",
1631  "Samantha Lee",
1632  "Michael Spann",
1633  "Chris Toft",
1634  "Juan Valdes",
1635  "",
1636  "+THANKS TO INTERGRAPH COMPUTER SYTEMS",
1637  "+IN PARTICULAR:",
1638  "",
1639  "Michael T. Nicolaou",
1640  "",
1641  "",
1642  "Quake II Mission Pack: The Reckoning",
1643  "(tm) (C)1998 Id Software, Inc. All",
1644  "Rights Reserved. Developed by Xatrix",
1645  "Entertainment, Inc. for Id Software,",
1646  "Inc. Distributed by Activision Inc.",
1647  "under license. Quake(R) is a",
1648  "registered trademark of Id Software,",
1649  "Inc. Quake II Mission Pack: The",
1650  "Reckoning(tm), Quake II(tm), the Id",
1651  "Software name, the \"Q II\"(tm) logo",
1652  "and id(tm) logo are trademarks of Id",
1653  "Software, Inc. Activision(R) is a",
1654  "registered trademark of Activision,",
1655  "Inc. Xatrix(R) is a registered",
1656  "trademark of Xatrix Entertainment,",
1657  "Inc. All other trademarks and trade",
1658  "names are properties of their",
1659  "respective owners.",
1660  0
1661 };
1662 
1663 static const char *roguecredits[] =
1664 {
1665  "+QUAKE II MISSION PACK 2: GROUND ZERO",
1666  "+BY",
1667  "+ROGUE ENTERTAINMENT, INC.",
1668  "",
1669  "+PRODUCED BY",
1670  "Jim Molinets",
1671  "",
1672  "+PROGRAMMING",
1673  "Peter Mack",
1674  "Patrick Magruder",
1675  "",
1676  "+LEVEL DESIGN",
1677  "Jim Molinets",
1678  "Cameron Lamprecht",
1679  "Berenger Fish",
1680  "Robert Selitto",
1681  "Steve Tietze",
1682  "Steve Thoms",
1683  "",
1684  "+ART DIRECTION",
1685  "Rich Fleider",
1686  "",
1687  "+ART",
1688  "Rich Fleider",
1689  "Steve Maines",
1690  "Won Choi",
1691  "",
1692  "+ANIMATION SEQUENCES",
1693  "Creat Studios",
1694  "Steve Maines",
1695  "",
1696  "+ADDITIONAL LEVEL DESIGN",
1697  "Rich Fleider",
1698  "Steve Maines",
1699  "Peter Mack",
1700  "",
1701  "+SOUND",
1702  "James Grunke",
1703  "",
1704  "+GROUND ZERO THEME",
1705  "+AND",
1706  "+MUSIC BY",
1707  "Sonic Mayhem",
1708  "",
1709  "+VWEP MODELS",
1710  "Brent \"Hentai\" Dill",
1711  "",
1712  "",
1713  "",
1714  "+SPECIAL THANKS",
1715  "+TO",
1716  "+OUR FRIENDS AT ID SOFTWARE",
1717  "",
1718  "John Carmack",
1719  "John Cash",
1720  "Brian Hook",
1721  "Adrian Carmack",
1722  "Kevin Cloud",
1723  "Paul Steed",
1724  "Tim Willits",
1725  "Christian Antkow",
1726  "Paul Jaquays",
1727  "Brandon James",
1728  "Todd Hollenshead",
1729  "Barrett (Bear) Alexander",
1730  "Katherine Anna Kang",
1731  "Donna Jackson",
1732  "Dave \"Zoid\" Kirsch",
1733  "",
1734  "",
1735  "",
1736  "+THANKS TO ACTIVISION",
1737  "+IN PARTICULAR:",
1738  "",
1739  "Marty Stratton",
1740  "Henk Hartong",
1741  "Mitch Lasky",
1742  "Steve Rosenthal",
1743  "Steve Elwell",
1744  "",
1745  "+AND THE GAME TESTERS",
1746  "",
1747  "The Ranger Clan",
1748  "Dave \"Zoid\" Kirsch",
1749  "Nihilistic Software",
1750  "Robert Duffy",
1751  "",
1752  "And Countless Others",
1753  "",
1754  "",
1755  "",
1756  "Quake II Mission Pack 2: Ground Zero",
1757  "(tm) (C)1998 Id Software, Inc. All",
1758  "Rights Reserved. Developed by Rogue",
1759  "Entertainment, Inc. for Id Software,",
1760  "Inc. Distributed by Activision Inc.",
1761  "under license. Quake(R) is a",
1762  "registered trademark of Id Software,",
1763  "Inc. Quake II Mission Pack 2: Ground",
1764  "Zero(tm), Quake II(tm), the Id",
1765  "Software name, the \"Q II\"(tm) logo",
1766  "and id(tm) logo are trademarks of Id",
1767  "Software, Inc. Activision(R) is a",
1768  "registered trademark of Activision,",
1769  "Inc. Rogue(R) is a registered",
1770  "trademark of Rogue Entertainment,",
1771  "Inc. All other trademarks and trade",
1772  "names are properties of their",
1773  "respective owners.",
1774  0
1775 };
1776 
1777 
1779 {
1780  int i, y;
1781 
1782  /*
1783  ** draw the credits
1784  */
1785  for ( i = 0, y = viddef.height - ( ( cls.realtime - credits_start_time ) / 40.0F ); credits[i] && y < viddef.height; y += 10 * vid_hudscale->value, i++ )
1786  {
1787  int j, stringoffset = 0;
1788  int bold = false;
1789 
1790  if ( y <= -8 )
1791  continue;
1792 
1793  if ( credits[i][0] == '+' )
1794  {
1795  bold = true;
1796  stringoffset = 1;
1797  }
1798  else
1799  {
1800  bold = false;
1801  stringoffset = 0;
1802  }
1803 
1804  for ( j = 0; credits[i][j+stringoffset]; j++ )
1805  {
1806  int x;
1807 
1808  x = ( viddef.width - strlen( credits[i] ) * 8 * vid_hudscale->value - stringoffset * 8 * vid_hudscale->value) / 2 + ( j + stringoffset ) * 8 * vid_hudscale->value;
1809 
1810  if ( bold )
1811  re.DrawChar( x, y, credits[i][j+stringoffset] + 128 );
1812  else
1813  re.DrawChar( x, y, credits[i][j+stringoffset] );
1814  }
1815  }
1816 
1817  if ( y < 0 )
1819 }
1820 
1821 const char *M_Credits_Key( int key )
1822 {
1823  switch (key)
1824  {
1825  case K_ESCAPE:
1826  if (creditsBuffer)
1828  M_PopMenu ();
1829  break;
1830  }
1831 
1832  return menu_out_sound;
1833 
1834 }
1835 
1836 extern int Developer_searchpath (int who);
1837 
1838 void M_Menu_Credits_f( void )
1839 {
1840  int n;
1841  int count;
1842  char *p;
1843  int isdeveloper = 0;
1844 
1845  creditsBuffer = NULL;
1846  count = FS_LoadFile ("credits", (void **)&creditsBuffer);
1847  if (count != -1)
1848  {
1849  p = creditsBuffer;
1850  for (n = 0; n < 255; n++)
1851  {
1852  creditsIndex[n] = p;
1853  while (*p != '\r' && *p != '\n')
1854  {
1855  p++;
1856  if (--count == 0)
1857  break;
1858  }
1859  if (*p == '\r')
1860  {
1861  *p++ = 0;
1862  if (--count == 0)
1863  break;
1864  }
1865  *p++ = 0;
1866  if (--count == 0)
1867  break;
1868  }
1869  creditsIndex[++n] = 0;
1870  credits = (const char**)creditsIndex;
1871  }
1872  else
1873  {
1874  isdeveloper = Developer_searchpath (1);
1875 
1876  if (isdeveloper == 1) // xatrix
1877  credits = xatcredits;
1878  else if (isdeveloper == 2) // ROGUE
1880  else
1881  {
1882  credits = idcredits;
1883  }
1884 
1885  }
1886 
1889 }
1890 
1891 /*
1892 =============================================================================
1893 
1894 GAME MENU
1895 
1896 =============================================================================
1897 */
1898 
1899 static int m_game_cursor;
1900 
1909 
1910 static void StartGame( void )
1911 {
1912  // disable updates and start the cinematic going
1913  cl.servercount = -1;
1914  M_ForceMenuOff ();
1915  Cvar_SetValue( "deathmatch", 0 );
1916  Cvar_SetValue( "coop", 0 );
1917 
1918  Cvar_SetValue( "gamerules", 0 ); //PGM
1919 
1920  Cbuf_AddText ("loading ; killserver ; wait ; newgame\n");
1921  cls.key_dest = key_game;
1922 }
1923 
1924 static void EasyGameFunc( void *data )
1925 {
1926  Cvar_ForceSet( "skill", "0" );
1927  StartGame();
1928 }
1929 
1930 static void MediumGameFunc( void *data )
1931 {
1932  Cvar_ForceSet( "skill", "1" );
1933  StartGame();
1934 }
1935 
1936 static void HardGameFunc( void *data )
1937 {
1938  Cvar_ForceSet( "skill", "2" );
1939  StartGame();
1940 }
1941 
1942 static void LoadGameFunc( void *unused )
1943 {
1944  M_Menu_LoadGame_f ();
1945 }
1946 
1947 static void SaveGameFunc( void *unused )
1948 {
1950 }
1951 
1952 static void CreditsFunc( void *unused )
1953 {
1954  M_Menu_Credits_f();
1955 }
1956 
1957 void Game_MenuInit( void )
1958 {
1959  s_game_menu.x = viddef.width * 0.50;
1960  s_game_menu.nitems = 0;
1961 
1966  s_easy_game_action.generic.name = "easy";
1968 
1973  s_medium_game_action.generic.name = "medium";
1975 
1980  s_hard_game_action.generic.name = "hard";
1982 
1984 
1989  s_load_game_action.generic.name = "load game";
1991 
1996  s_save_game_action.generic.name = "save game";
1998 
2003  s_credits_action.generic.name = "credits";
2005 
2006  Menu_AddItem( &s_game_menu, ( void * ) &s_easy_game_action );
2008  Menu_AddItem( &s_game_menu, ( void * ) &s_hard_game_action );
2009  Menu_AddItem( &s_game_menu, ( void * ) &s_blankline );
2010  Menu_AddItem( &s_game_menu, ( void * ) &s_load_game_action );
2011  Menu_AddItem( &s_game_menu, ( void * ) &s_save_game_action );
2012  Menu_AddItem( &s_game_menu, ( void * ) &s_blankline );
2013  Menu_AddItem( &s_game_menu, ( void * ) &s_credits_action );
2014 
2016 }
2017 
2018 void Game_MenuDraw( void )
2019 {
2020  M_Banner( "m_banner_game" );
2022  Menu_Draw( &s_game_menu );
2023 }
2024 
2025 const char *Game_MenuKey( int key )
2026 {
2027  return Default_MenuKey( &s_game_menu, key );
2028 }
2029 
2030 void M_Menu_Game_f (void)
2031 {
2032  Game_MenuInit();
2034  m_game_cursor = 1;
2035 }
2036 
2037 /*
2038 =============================================================================
2039 
2040 LOADGAME MENU
2041 
2042 =============================================================================
2043 */
2044 
2045 #define MAX_SAVEGAMES 15
2046 
2048 
2051 
2054 
2056 {
2057  int i;
2058  FILE *f;
2059  char name[MAX_OSPATH];
2060 
2061  for (i=0 ; i<MAX_SAVEGAMES ; i++)
2062  {
2063  Com_sprintf (name, sizeof(name), "%s/save/save%i/server.ssv", FS_Gamedir(), i);
2064  f = fopen (name, "rb");
2065  if (!f)
2066  {
2067  strcpy (m_savestrings[i], "<EMPTY>");
2068  m_savevalid[i] = false;
2069  }
2070  else
2071  {
2072  FS_Read (m_savestrings[i], sizeof(m_savestrings[i]), f);
2073  fclose (f);
2074  m_savevalid[i] = true;
2075  }
2076  }
2077 }
2078 
2079 void LoadGameCallback( void *self )
2080 {
2081  menuaction_s *a = ( menuaction_s * ) self;
2082 
2083  if ( m_savevalid[ a->generic.localdata[0] ] )
2084  Cbuf_AddText (va("load save%i\n", a->generic.localdata[0] ) );
2085  M_ForceMenuOff ();
2086 }
2087 
2088 void LoadGame_MenuInit( void )
2089 {
2090  int i;
2091 
2094  s_loadgame_menu.nitems = 0;
2095 
2097 
2098  for ( i = 0; i < MAX_SAVEGAMES; i++ )
2099  {
2104 
2106  s_loadgame_actions[i].generic.y = ( i ) * 10 * vid_hudscale->value;
2107  if (i>0) // separate from autosave
2109 
2111 
2113  }
2114 }
2115 
2116 void LoadGame_MenuDraw( void )
2117 {
2118  M_Banner( "m_banner_load_game" );
2119 // Menu_AdjustCursor( &s_loadgame_menu, 1 );
2121 }
2122 
2123 const char *LoadGame_MenuKey( int key )
2124 {
2125  if ( key == K_ESCAPE || key == K_ENTER )
2126  {
2128  if ( s_savegame_menu.cursor < 0 )
2129  s_savegame_menu.cursor = 0;
2130  }
2131  return Default_MenuKey( &s_loadgame_menu, key );
2132 }
2133 
2135 {
2138 }
2139 
2140 
2141 /*
2142 =============================================================================
2143 
2144 SAVEGAME MENU
2145 
2146 =============================================================================
2147 */
2150 
2151 void SaveGameCallback( void *self )
2152 {
2153  menuaction_s *a = ( menuaction_s * ) self;
2154 
2155  Cbuf_AddText (va("save save%i\n", a->generic.localdata[0] ));
2156  M_ForceMenuOff ();
2157 }
2158 
2159 void SaveGame_MenuDraw( void )
2160 {
2161  M_Banner( "m_banner_save_game" );
2164 }
2165 
2166 void SaveGame_MenuInit( void )
2167 {
2168  int i;
2169 
2172  s_savegame_menu.nitems = 0;
2173 
2175 
2176  // don't include the autosave slot
2177  for ( i = 0; i < MAX_SAVEGAMES-1; i++ )
2178  {
2183 
2185  s_savegame_actions[i].generic.y = ( i ) * 10 * vid_hudscale->value;
2186 
2188 
2190  }
2191 }
2192 
2193 const char *SaveGame_MenuKey( int key )
2194 {
2195  if ( key == K_ENTER || key == K_ESCAPE )
2196  {
2198  if ( s_loadgame_menu.cursor < 0 )
2199  s_loadgame_menu.cursor = 0;
2200  }
2201  return Default_MenuKey( &s_savegame_menu, key );
2202 }
2203 
2205 {
2206  if (!Com_ServerState())
2207  return; // not playing a game
2208 
2211  Create_Savestrings ();
2212 }
2213 
2214 
2215 /*
2216 =============================================================================
2217 
2218 JOIN SERVER MENU
2219 
2220 =============================================================================
2221 */
2222 #define MAX_LOCAL_SERVERS 8
2223 
2229 
2231 #define NO_SERVER_STRING "<no server>"
2232 
2233 // user readable information
2235 
2236 // network address
2238 
2239 void M_AddToServerList (netadr_t adr, char *info)
2240 {
2241  int i;
2242 
2244  return;
2245  while ( *info == ' ' )
2246  info++;
2247 
2248  // ignore if duplicated
2249  for (i=0 ; i<m_num_servers ; i++)
2250  if (!strcmp(info, local_server_names[i]))
2251  return;
2252 
2254  strncpy (local_server_names[m_num_servers], info, sizeof(local_server_names[0])-1);
2255  m_num_servers++;
2256 }
2257 
2258 
2259 void JoinServerFunc( void *self )
2260 {
2261  char buffer[128];
2262  int index;
2263 
2264  index = ( menuaction_s * ) self - s_joinserver_server_actions;
2265 
2266  if ( Q_stricmp( local_server_names[index], NO_SERVER_STRING ) == 0 )
2267  return;
2268 
2269  if (index >= m_num_servers)
2270  return;
2271 
2272  Com_sprintf (buffer, sizeof(buffer), "connect %s\n", NET_AdrToString (local_server_netadr[index]));
2273  Cbuf_AddText (buffer);
2274  M_ForceMenuOff ();
2275 }
2276 
2277 void AddressBookFunc( void *self )
2278 {
2280 }
2281 
2282 void NullCursorDraw( void *self )
2283 {
2284 }
2285 
2286 void SearchLocalGames( void )
2287 {
2288  int i;
2289 
2290  m_num_servers = 0;
2291  for (i=0 ; i<MAX_LOCAL_SERVERS ; i++)
2293 
2294  search_local_games = true;
2295 }
2296 
2297 void SearchLocalGamesFunc( void *self )
2298 {
2299  SearchLocalGames();
2300 }
2301 
2303 {
2304  int i;
2305 
2306  s_joinserver_menu.x = viddef.width * 0.50 - 120 * vid_hudscale->value;
2308 
2315 
2317  s_joinserver_search_action.generic.name = "refresh server list";
2322  s_joinserver_search_action.generic.statusbar = "search for servers";
2323 
2325  s_joinserver_server_title.generic.name = "connect to...";
2328 
2329  for ( i = 0; i < MAX_LOCAL_SERVERS; i++ )
2330  {
2338  s_joinserver_server_actions[i].generic.statusbar = "press ENTER to connect";
2339  }
2340 
2344 
2345  for ( i = 0; i < 8; i++ )
2347 
2349 
2350  SearchLocalGames();
2351 }
2352 
2354 {
2355  M_Banner( "m_banner_join_server" );
2357 
2358  if (search_local_games)
2359  {
2360  M_DrawTextBox(8 - 152 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value, 36, 3);
2361  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 8 * vid_hudscale->value, "Searching for local servers, this");
2362  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 16 * vid_hudscale->value, "could take up to a minute, so");
2363  M_Print(32 - 136 * (vid_hudscale->value - 1.f), 120 - 48 * vid_hudscale->value + 24 * vid_hudscale->value, "please be patient.");
2364 
2365  // send out info packets
2366  CL_PingServers_f();
2367  search_local_games = false;
2368  }
2369 }
2370 
2371 
2372 const char *JoinServer_MenuKey( int key )
2373 {
2374  return Default_MenuKey( &s_joinserver_menu, key );
2375 }
2376 
2378 {
2381 }
2382 
2383 
2384 /*
2385 =============================================================================
2386 
2387 START SERVER MENU
2388 
2389 =============================================================================
2390 */
2392 static char **mapnames;
2393 static int nummaps;
2394 
2403 
2404 void DMOptionsFunc( void *self )
2405 {
2406  if (s_rules_box.curvalue == 1)
2407  return;
2409 }
2410 
2411 void RulesChangeFunc ( void *self )
2412 {
2413  // DM
2414  if (s_rules_box.curvalue == 0)
2415  {
2418  }
2419  else if(s_rules_box.curvalue == 1) // coop // PGM
2420  {
2421  s_maxclients_field.generic.statusbar = "4 maximum for cooperative";
2422  if (atoi(s_maxclients_field.buffer) > 4)
2423  strcpy( s_maxclients_field.buffer, "4" );
2424  s_startserver_dmoptions_action.generic.statusbar = "N/A for cooperative";
2425  }
2426 //=====
2427 //PGM
2428  // ROGUE GAMES
2429  else if(Developer_searchpath(2) == 2)
2430  {
2431  if (s_rules_box.curvalue == 2) // tag
2432  {
2435  }
2436 /*
2437  else if(s_rules_box.curvalue == 3) // deathball
2438  {
2439  s_maxclients_field.generic.statusbar = NULL;
2440  s_startserver_dmoptions_action.generic.statusbar = NULL;
2441  }
2442 */
2443  }
2444 //PGM
2445 //=====
2446 }
2447 
2448 void StartServerActionFunc( void *self )
2449 {
2450  char startmap[1024];
2451  int timelimit;
2452  int fraglimit;
2453  int maxclients;
2454  char *spot;
2455 
2456  strcpy( startmap, strchr( mapnames[s_startmap_list.curvalue], '\n' ) + 1 );
2457 
2461 
2462  Cvar_SetValue( "maxclients", ClampCvar( 0, maxclients, maxclients ) );
2463  Cvar_SetValue ("timelimit", ClampCvar( 0, timelimit, timelimit ) );
2464  Cvar_SetValue ("fraglimit", ClampCvar( 0, fraglimit, fraglimit ) );
2465  Cvar_Set("hostname", s_hostname_field.buffer );
2466 // Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
2467 // Cvar_SetValue ("coop", s_rules_box.curvalue );
2468 
2469 //PGM
2470  if((s_rules_box.curvalue < 2) || (Developer_searchpath(2) != 2))
2471  {
2472  Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
2473  Cvar_SetValue ("coop", s_rules_box.curvalue );
2474  Cvar_SetValue ("gamerules", 0 );
2475  }
2476  else
2477  {
2478  Cvar_SetValue ("deathmatch", 1 ); // deathmatch is always true for rogue games, right?
2479  Cvar_SetValue ("coop", 0 ); // FIXME - this might need to depend on which game we're running
2480  Cvar_SetValue ("gamerules", s_rules_box.curvalue );
2481  }
2482 //PGM
2483 
2484  spot = NULL;
2485  if (s_rules_box.curvalue == 1) // PGM
2486  {
2487  if(Q_stricmp(startmap, "bunk1") == 0)
2488  spot = "start";
2489  else if(Q_stricmp(startmap, "mintro") == 0)
2490  spot = "start";
2491  else if(Q_stricmp(startmap, "fact1") == 0)
2492  spot = "start";
2493  else if(Q_stricmp(startmap, "power1") == 0)
2494  spot = "pstart";
2495  else if(Q_stricmp(startmap, "biggun") == 0)
2496  spot = "bstart";
2497  else if(Q_stricmp(startmap, "hangar1") == 0)
2498  spot = "unitstart";
2499  else if(Q_stricmp(startmap, "city1") == 0)
2500  spot = "unitstart";
2501  else if(Q_stricmp(startmap, "boss1") == 0)
2502  spot = "bosstart";
2503  }
2504 
2505  if (spot)
2506  {
2507  if (Com_ServerState())
2508  Cbuf_AddText ("disconnect\n");
2509  Cbuf_AddText (va("gamemap \"*%s$%s\"\n", startmap, spot));
2510  }
2511  else
2512  {
2513  Cbuf_AddText (va("map %s\n", startmap));
2514  }
2515 
2516  M_ForceMenuOff ();
2517 
2518  if (mapnames)
2519  {
2520  int i;
2521 
2522  for (i = 0; i < nummaps; i++)
2523  free(mapnames[i]);
2524  free(mapnames);
2525  }
2526  mapnames = 0;
2527  nummaps = 0;
2528 }
2529 
2531 {
2532  static const char *dm_coop_names[] =
2533  {
2534  "deathmatch",
2535  "cooperative",
2536  0
2537  };
2538 //=======
2539 //PGM
2540  static const char *dm_coop_names_rogue[] =
2541  {
2542  "deathmatch",
2543  "cooperative",
2544  "tag",
2545 // "deathball",
2546  0
2547  };
2548 //PGM
2549 //=======
2550  char *buffer;
2551  char mapsname[1024];
2552  char *s;
2553  int length;
2554  int i;
2555  FILE *fp;
2556 
2557  /*
2558  ** load the list of map names
2559  */
2560  Com_sprintf( mapsname, sizeof( mapsname ), "%s/maps.lst", FS_Gamedir() );
2561  if ( ( fp = fopen( mapsname, "rb" ) ) == 0 )
2562  {
2563  if ( ( length = FS_LoadFile( "maps.lst", ( void ** ) &buffer ) ) == -1 )
2564  Com_Error( ERR_DROP, "couldn't find maps.lst\n" );
2565  }
2566  else
2567  {
2568 #ifdef _WIN32
2569  length = filelength( fileno( fp ) );
2570 #else
2571  fseek(fp, 0, SEEK_END);
2572  length = ftell(fp);
2573  fseek(fp, 0, SEEK_SET);
2574 #endif
2575  buffer = malloc( length );
2576  fread( buffer, length, 1, fp );
2577  }
2578 
2579  s = buffer;
2580 
2581  i = 0;
2582  while ( i < length )
2583  {
2584  if ( s[i] == '\r' )
2585  nummaps++;
2586  i++;
2587  }
2588 
2589  if ( nummaps == 0 )
2590  Com_Error( ERR_DROP, "no maps in maps.lst\n" );
2591 
2592  mapnames = malloc( sizeof( char * ) * ( nummaps + 1 ) );
2593  memset( mapnames, 0, sizeof( char * ) * ( nummaps + 1 ) );
2594 
2595  s = buffer;
2596 
2597  for ( i = 0; i < nummaps; i++ )
2598  {
2599  char shortname[MAX_TOKEN_CHARS];
2600  char longname[MAX_TOKEN_CHARS];
2601  char scratch[200];
2602  int j, l;
2603 
2604  strcpy( shortname, COM_Parse( &s ) );
2605  l = (int)strlen(shortname);
2606  for (j=0 ; j<l ; j++)
2607  shortname[j] = toupper(shortname[j]);
2608  strcpy( longname, COM_Parse( &s ) );
2609  Com_sprintf( scratch, sizeof( scratch ), "%s\n%s", longname, shortname );
2610 
2611  mapnames[i] = malloc( strlen( scratch ) + 1 );
2612  strcpy( mapnames[i], scratch );
2613  }
2614  mapnames[nummaps] = 0;
2615 
2616  if ( fp != 0 )
2617  {
2618  fp = 0;
2619  free( buffer );
2620  }
2621  else
2622  {
2623  FS_FreeFile( buffer );
2624  }
2625 
2626  /*
2627  ** initialize the menu stuff
2628  */
2629  s_startserver_menu.x = viddef.width * 0.50;
2631 
2635  s_startmap_list.generic.name = "initial map";
2636  s_startmap_list.itemnames = (const char**)mapnames;
2637 
2639  s_rules_box.generic.x = 0;
2641  s_rules_box.generic.name = "rules";
2642 
2643 //PGM - rogue games only available with rogue DLL.
2644  if(Developer_searchpath(2) == 2)
2645  s_rules_box.itemnames = dm_coop_names_rogue;
2646  else
2647  s_rules_box.itemnames = dm_coop_names;
2648 //PGM
2649 
2650  if (Cvar_VariableValue("coop"))
2651  s_rules_box.curvalue = 1;
2652  else
2653  s_rules_box.curvalue = 0;
2655 
2657  s_timelimit_field.generic.name = "time limit";
2661  s_timelimit_field.generic.statusbar = "0 = no limit";
2664  strcpy( s_timelimit_field.buffer, Cvar_VariableString("timelimit") );
2665 
2667  s_fraglimit_field.generic.name = "frag limit";
2671  s_fraglimit_field.generic.statusbar = "0 = no limit";
2674  strcpy( s_fraglimit_field.buffer, Cvar_VariableString("fraglimit") );
2675 
2676  /*
2677  ** maxclients determines the maximum number of players that can join
2678  ** the game. If maxclients is only "1" then we should default the menu
2679  ** option to 8 players, otherwise use whatever its current value is.
2680  ** Clamping will be done when the server is actually started.
2681  */
2683  s_maxclients_field.generic.name = "max players";
2690  if ( Cvar_VariableValue( "maxclients" ) == 1 )
2691  strcpy( s_maxclients_field.buffer, "8" );
2692  else
2693  strcpy( s_maxclients_field.buffer, Cvar_VariableString("maxclients") );
2694 
2696  s_hostname_field.generic.name = "hostname";
2701  s_hostname_field.length = 12;
2703  strcpy( s_hostname_field.buffer, Cvar_VariableString("hostname") );
2704 
2706  s_startserver_dmoptions_action.generic.name = " deathmatch flags";
2712 
2719 
2728 
2730 
2731  // call this now to set proper inital state
2732  RulesChangeFunc ( NULL );
2733 }
2734 
2736 {
2738 }
2739 
2740 const char *StartServer_MenuKey( int key )
2741 {
2742  if ( key == K_ESCAPE )
2743  {
2744  if ( mapnames )
2745  {
2746  int i;
2747 
2748  for ( i = 0; i < nummaps; i++ )
2749  free( mapnames[i] );
2750  free( mapnames );
2751  }
2752  mapnames = 0;
2753  nummaps = 0;
2754  }
2755 
2756  return Default_MenuKey( &s_startserver_menu, key );
2757 }
2758 
2760 {
2763 }
2764 
2765 /*
2766 =============================================================================
2767 
2768 DMOPTIONS BOOK MENU
2769 
2770 =============================================================================
2771 */
2772 static char dmoptions_statusbar[128];
2773 
2775 
2791 
2792 //ROGUE
2797 //ROGUE
2798 
2799 static void DMFlagCallback( void *self )
2800 {
2801  menulist_s *f = ( menulist_s * ) self;
2802  int flags;
2803  int bit = 0;
2804 
2805  flags = Cvar_VariableValue( "dmflags" );
2806 
2807  if ( f == &s_friendlyfire_box )
2808  {
2809  if ( f->curvalue )
2811  else
2813  goto setvalue;
2814  }
2815  else if ( f == &s_falls_box )
2816  {
2817  if ( f->curvalue )
2818  flags &= ~DF_NO_FALLING;
2819  else
2820  flags |= DF_NO_FALLING;
2821  goto setvalue;
2822  }
2823  else if ( f == &s_weapons_stay_box )
2824  {
2825  bit = DF_WEAPONS_STAY;
2826  }
2827  else if ( f == &s_instant_powerups_box )
2828  {
2829  bit = DF_INSTANT_ITEMS;
2830  }
2831  else if ( f == &s_allow_exit_box )
2832  {
2833  bit = DF_ALLOW_EXIT;
2834  }
2835  else if ( f == &s_powerups_box )
2836  {
2837  if ( f->curvalue )
2838  flags &= ~DF_NO_ITEMS;
2839  else
2840  flags |= DF_NO_ITEMS;
2841  goto setvalue;
2842  }
2843  else if ( f == &s_health_box )
2844  {
2845  if ( f->curvalue )
2846  flags &= ~DF_NO_HEALTH;
2847  else
2848  flags |= DF_NO_HEALTH;
2849  goto setvalue;
2850  }
2851  else if ( f == &s_spawn_farthest_box )
2852  {
2853  bit = DF_SPAWN_FARTHEST;
2854  }
2855  else if ( f == &s_teamplay_box )
2856  {
2857  if ( f->curvalue == 1 )
2858  {
2859  flags |= DF_SKINTEAMS;
2860  flags &= ~DF_MODELTEAMS;
2861  }
2862  else if ( f->curvalue == 2 )
2863  {
2864  flags |= DF_MODELTEAMS;
2865  flags &= ~DF_SKINTEAMS;
2866  }
2867  else
2868  {
2869  flags &= ~( DF_MODELTEAMS | DF_SKINTEAMS );
2870  }
2871 
2872  goto setvalue;
2873  }
2874  else if ( f == &s_samelevel_box )
2875  {
2876  bit = DF_SAME_LEVEL;
2877  }
2878  else if ( f == &s_force_respawn_box )
2879  {
2880  bit = DF_FORCE_RESPAWN;
2881  }
2882  else if ( f == &s_armor_box )
2883  {
2884  if ( f->curvalue )
2885  flags &= ~DF_NO_ARMOR;
2886  else
2887  flags |= DF_NO_ARMOR;
2888  goto setvalue;
2889  }
2890  else if ( f == &s_infinite_ammo_box )
2891  {
2892  bit = DF_INFINITE_AMMO;
2893  }
2894  else if ( f == &s_fixed_fov_box )
2895  {
2896  bit = DF_FIXED_FOV;
2897  }
2898  else if ( f == &s_quad_drop_box )
2899  {
2900  bit = DF_QUAD_DROP;
2901  }
2902 
2903 //=======
2904 //ROGUE
2905  else if (Developer_searchpath(2) == 2)
2906  {
2907  if ( f == &s_no_mines_box)
2908  {
2909  bit = DF_NO_MINES;
2910  }
2911  else if ( f == &s_no_nukes_box)
2912  {
2913  bit = DF_NO_NUKES;
2914  }
2915  else if ( f == &s_stack_double_box)
2916  {
2917  bit = DF_NO_STACK_DOUBLE;
2918  }
2919  else if ( f == &s_no_spheres_box)
2920  {
2921  bit = DF_NO_SPHERES;
2922  }
2923  }
2924 //ROGUE
2925 //=======
2926 
2927  if ( f )
2928  {
2929  if ( f->curvalue == 0 )
2930  flags &= ~bit;
2931  else
2932  flags |= bit;
2933  }
2934 
2935 setvalue:
2936  Cvar_SetValue ("dmflags", flags);
2937 
2938  Com_sprintf( dmoptions_statusbar, sizeof( dmoptions_statusbar ), "dmflags = %d", flags );
2939 
2940 }
2941 
2943 {
2944  static const char *yes_no_names[] =
2945  {
2946  "no", "yes", 0
2947  };
2948  static const char *teamplay_names[] =
2949  {
2950  "disabled", "by skin", "by model", 0
2951  };
2952  int dmflags = Cvar_VariableValue( "dmflags" );
2953  int y = 0;
2954 
2955  s_dmoptions_menu.x = viddef.width * 0.50;
2957 
2959  s_falls_box.generic.x = 0;
2961  s_falls_box.generic.name = "falling damage";
2963  s_falls_box.itemnames = yes_no_names;
2965 
2969  s_weapons_stay_box.generic.name = "weapons stay";
2971  s_weapons_stay_box.itemnames = yes_no_names;
2973 
2977  s_instant_powerups_box.generic.name = "instant powerups";
2979  s_instant_powerups_box.itemnames = yes_no_names;
2981 
2983  s_powerups_box.generic.x = 0;
2985  s_powerups_box.generic.name = "allow powerups";
2987  s_powerups_box.itemnames = yes_no_names;
2989 
2991  s_health_box.generic.x = 0;
2994  s_health_box.generic.name = "allow health";
2995  s_health_box.itemnames = yes_no_names;
2997 
2999  s_armor_box.generic.x = 0;
3000  s_armor_box.generic.y = y += 10 * vid_hudscale->value;
3001  s_armor_box.generic.name = "allow armor";
3003  s_armor_box.itemnames = yes_no_names;
3004  s_armor_box.curvalue = ( dmflags & DF_NO_ARMOR ) == 0;
3005 
3009  s_spawn_farthest_box.generic.name = "spawn farthest";
3011  s_spawn_farthest_box.itemnames = yes_no_names;
3013 
3017  s_samelevel_box.generic.name = "same map";
3019  s_samelevel_box.itemnames = yes_no_names;
3021 
3025  s_force_respawn_box.generic.name = "force respawn";
3027  s_force_respawn_box.itemnames = yes_no_names;
3029 
3031  s_teamplay_box.generic.x = 0;
3033  s_teamplay_box.generic.name = "teamplay";
3035  s_teamplay_box.itemnames = teamplay_names;
3036 
3040  s_allow_exit_box.generic.name = "allow exit";
3042  s_allow_exit_box.itemnames = yes_no_names;
3044 
3048  s_infinite_ammo_box.generic.name = "infinite ammo";
3050  s_infinite_ammo_box.itemnames = yes_no_names;
3052 
3056  s_fixed_fov_box.generic.name = "fixed FOV";
3058  s_fixed_fov_box.itemnames = yes_no_names;
3060 
3064  s_quad_drop_box.generic.name = "quad drop";
3066  s_quad_drop_box.itemnames = yes_no_names;
3068 
3072  s_friendlyfire_box.generic.name = "friendly fire";
3074  s_friendlyfire_box.itemnames = yes_no_names;
3076 
3077 //============
3078 //ROGUE
3079  if(Developer_searchpath(2) == 2)
3080  {
3082  s_no_mines_box.generic.x = 0;
3084  s_no_mines_box.generic.name = "remove mines";
3086  s_no_mines_box.itemnames = yes_no_names;
3088 
3090  s_no_nukes_box.generic.x = 0;
3092  s_no_nukes_box.generic.name = "remove nukes";
3094  s_no_nukes_box.itemnames = yes_no_names;
3096 
3100  s_stack_double_box.generic.name = "2x/4x stacking off";
3102  s_stack_double_box.itemnames = yes_no_names;
3104 
3108  s_no_spheres_box.generic.name = "remove spheres";
3110  s_no_spheres_box.itemnames = yes_no_names;
3112 
3113  }
3114 //ROGUE
3115 //============
3116 
3132 
3133 //=======
3134 //ROGUE
3135  if(Developer_searchpath(2) == 2)
3136  {
3141  }
3142 //ROGUE
3143 //=======
3144 
3146 
3147  // set the original dmflags statusbar
3148  DMFlagCallback( 0 );
3150 }
3151 
3153 {
3155 }
3156 
3157 const char *DMOptions_MenuKey( int key )
3158 {
3159  return Default_MenuKey( &s_dmoptions_menu, key );
3160 }
3161 
3163 {
3166 }
3167 
3168 /*
3169 =============================================================================
3170 
3171 DOWNLOADOPTIONS BOOK MENU
3172 
3173 =============================================================================
3174 */
3176 
3183 
3184 static void DownloadCallback( void *self )
3185 {
3186  menulist_s *f = ( menulist_s * ) self;
3187 
3188  if (f == &s_allow_download_box)
3189  {
3190  Cvar_SetValue("allow_download", f->curvalue);
3191  }
3192 
3193  else if (f == &s_allow_download_maps_box)
3194  {
3195  Cvar_SetValue("allow_download_maps", f->curvalue);
3196  }
3197 
3198  else if (f == &s_allow_download_models_box)
3199  {
3200  Cvar_SetValue("allow_download_models", f->curvalue);
3201  }
3202 
3203  else if (f == &s_allow_download_players_box)
3204  {
3205  Cvar_SetValue("allow_download_players", f->curvalue);
3206  }
3207 
3208  else if (f == &s_allow_download_sounds_box)
3209  {
3210  Cvar_SetValue("allow_download_sounds", f->curvalue);
3211  }
3212 }
3213 
3215 {
3216  static const char *yes_no_names[] =
3217  {
3218  "no", "yes", 0
3219  };
3220  int y = 0;
3221 
3224 
3226  s_download_title.generic.name = "Download Options";
3227  s_download_title.generic.x = 48;
3229 
3233  s_allow_download_box.generic.name = "allow downloading";
3235  s_allow_download_box.itemnames = yes_no_names;
3236  s_allow_download_box.curvalue = (Cvar_VariableValue("allow_download") != 0);
3237 
3243  s_allow_download_maps_box.itemnames = yes_no_names;
3244  s_allow_download_maps_box.curvalue = (Cvar_VariableValue("allow_download_maps") != 0);
3245 
3249  s_allow_download_players_box.generic.name = "player models/skins";
3251  s_allow_download_players_box.itemnames = yes_no_names;
3252  s_allow_download_players_box.curvalue = (Cvar_VariableValue("allow_download_players") != 0);
3253 
3259  s_allow_download_models_box.itemnames = yes_no_names;
3260  s_allow_download_models_box.curvalue = (Cvar_VariableValue("allow_download_models") != 0);
3261 
3267  s_allow_download_sounds_box.itemnames = yes_no_names;
3268  s_allow_download_sounds_box.curvalue = (Cvar_VariableValue("allow_download_sounds") != 0);
3269 
3276 
3278 
3279  // skip over title
3280  if (s_downloadoptions_menu.cursor == 0)
3282 }
3283 
3285 {
3287 }
3288 
3289 const char *DownloadOptions_MenuKey( int key )
3290 {
3291  return Default_MenuKey( &s_downloadoptions_menu, key );
3292 }
3293 
3295 {
3298 }
3299 /*
3300 =============================================================================
3301 
3302 ADDRESS BOOK MENU
3303 
3304 =============================================================================
3305 */
3306 #define NUM_ADDRESSBOOK_ENTRIES 9
3307 
3310 
3312 {
3313  int i;
3314 
3318 
3319  for ( i = 0; i < NUM_ADDRESSBOOK_ENTRIES; i++ )
3320  {
3321  cvar_t *adr;
3322  char buffer[20];
3323 
3324  Com_sprintf( buffer, sizeof( buffer ), "adr%d", i );
3325 
3326  adr = Cvar_Get( buffer, "", CVAR_ARCHIVE );
3327 
3337 
3338  strcpy( s_addressbook_fields[i].buffer, adr->string );
3339 
3341  }
3342 }
3343 
3344 const char *AddressBook_MenuKey( int key )
3345 {
3346  if ( key == K_ESCAPE )
3347  {
3348  int index;
3349  char buffer[20];
3350 
3351  for ( index = 0; index < NUM_ADDRESSBOOK_ENTRIES; index++ )
3352  {
3353  Com_sprintf( buffer, sizeof( buffer ), "adr%d", index );
3355  }
3356  }
3357  return Default_MenuKey( &s_addressbook_menu, key );
3358 }
3359 
3361 {
3362  M_Banner( "m_banner_addressbook" );
3364 }
3365 
3367 {
3370 }
3371 
3372 /*
3373 =============================================================================
3374 
3375 PLAYER CONFIG MENU
3376 
3377 =============================================================================
3378 */
3390 
3391 #define MAX_DISPLAYNAME 16
3392 #define MAX_PLAYERMODELS 1024
3393 
3394 typedef struct
3395 {
3396  int nskins;
3398  char displayname[MAX_DISPLAYNAME];
3399  char directory[MAX_QPATH];
3401 
3405 
3406 static int rate_tbl[] = { 2500, 3200, 5000, 10000, 25000, 0 };
3407 static const char *rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN",
3408  "Dual ISDN/Cable", "T1/LAN", "User defined", 0 };
3409 
3410 void DownloadOptionsFunc( void *self )
3411 {
3413 }
3414 
3415 static void HandednessCallback( void *unused )
3416 {
3418 }
3419 
3420 static void RateCallback( void *unused )
3421 {
3422  if (s_player_rate_box.curvalue != sizeof(rate_tbl) / sizeof(*rate_tbl) - 1)
3424 }
3425 
3426 static void ModelCallback( void *unused )
3427 {
3430 }
3431 
3432 static void FreeFileList( char **list, int n )
3433 {
3434  int i;
3435 
3436  for ( i = 0; i < n; i++ )
3437  {
3438  if ( list[i] )
3439  {
3440  free( list[i] );
3441  list[i] = 0;
3442  }
3443  }
3444  free( list );
3445 }
3446 
3447 static qboolean IconOfSkinExists( char *skin, char **pcxfiles, int npcxfiles )
3448 {
3449  int i;
3450  char scratch[1024];
3451 
3452  strcpy( scratch, skin );
3453  *strrchr( scratch, '.' ) = 0;
3454  strcat( scratch, "_i.pcx" );
3455 
3456  for ( i = 0; i < npcxfiles; i++ )
3457  {
3458  if ( strcmp( pcxfiles[i], scratch ) == 0 )
3459  return true;
3460  }
3461 
3462  return false;
3463 }
3464 
3466 {
3467  char findname[1024];
3468  char scratch[1024];
3469  int ndirs = 0, npms = 0;
3470  char **dirnames;
3471  char *path = NULL;
3472  int i;
3473 
3474  extern char **FS_ListFiles( char *, int *, unsigned, unsigned );
3475 
3476  s_numplayermodels = 0;
3477 
3478  /*
3479  ** get a list of directories
3480  */
3481  do
3482  {
3483  path = FS_NextPath( path );
3484  Com_sprintf( findname, sizeof(findname), "%s/players/*.*", path );
3485 
3486  if ( ( dirnames = FS_ListFiles( findname, &ndirs, SFF_SUBDIR, 0 ) ) != 0 )
3487  break;
3488  } while ( path );
3489 
3490  if ( !dirnames )
3491  return false;
3492 
3493  /*
3494  ** go through the subdirectories
3495  */
3496  npms = ndirs;
3497  if ( npms > MAX_PLAYERMODELS )
3498  npms = MAX_PLAYERMODELS;
3499 
3500  for ( i = 0; i < npms; i++ )
3501  {
3502  int k, s;
3503  char *a, *b, *c;
3504  char **pcxnames;
3505  char **skinnames;
3506  int npcxfiles;
3507  int nskins = 0;
3508 
3509  if ( dirnames[i] == 0 )
3510  continue;
3511 
3512  // verify the existence of tris.md2
3513  strcpy( scratch, dirnames[i] );
3514  strcat( scratch, "/tris.md2" );
3515  if ( !Sys_FindFirst( scratch, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM ) )
3516  {
3517  free( dirnames[i] );
3518  dirnames[i] = 0;
3519  Sys_FindClose();
3520  continue;
3521  }
3522  Sys_FindClose();
3523 
3524  // verify the existence of at least one pcx skin
3525  strcpy( scratch, dirnames[i] );
3526  strcat( scratch, "/*.pcx" );
3527  pcxnames = FS_ListFiles( scratch, &npcxfiles, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM );
3528 
3529  if ( !pcxnames )
3530  {
3531  free( dirnames[i] );
3532  dirnames[i] = 0;
3533  continue;
3534  }
3535 
3536  // count valid skins, which consist of a skin with a matching "_i" icon
3537  for ( k = 0; k < npcxfiles-1; k++ )
3538  {
3539  if ( !strstr( pcxnames[k], "_i.pcx" ) )
3540  {
3541  if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
3542  {
3543  nskins++;
3544  }
3545  }
3546  }
3547  if ( !nskins )
3548  continue;
3549 
3550  skinnames = malloc( sizeof( char * ) * ( nskins + 1 ) );
3551  memset( skinnames, 0, sizeof( char * ) * ( nskins + 1 ) );
3552 
3553  // copy the valid skins
3554  for ( s = 0, k = 0; k < npcxfiles-1; k++ )
3555  {
3556  char *a, *b, *c;
3557 
3558  if ( !strstr( pcxnames[k], "_i.pcx" ) )
3559  {
3560  if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
3561  {
3562  a = strrchr( pcxnames[k], '/' );
3563  b = strrchr( pcxnames[k], '\\' );
3564 
3565  if ( a > b )
3566  c = a;
3567  else
3568  c = b;
3569 
3570  strcpy( scratch, c + 1 );
3571 
3572  if ( strrchr( scratch, '.' ) )
3573  *strrchr( scratch, '.' ) = 0;
3574 
3575  skinnames[s] = strdup( scratch );
3576  s++;
3577  }
3578  }
3579  }
3580 
3581  // at this point we have a valid player model
3582  s_pmi[s_numplayermodels].nskins = nskins;
3584 
3585  // make short name for the model
3586  a = strrchr( dirnames[i], '/' );
3587  b = strrchr( dirnames[i], '\\' );
3588 
3589  if ( a > b )
3590  c = a;
3591  else
3592  c = b;
3593 
3594  strncpy( s_pmi[s_numplayermodels].displayname, c + 1, MAX_DISPLAYNAME-1 );
3595  strcpy( s_pmi[s_numplayermodels].directory, c + 1 );
3596 
3597  FreeFileList( pcxnames, npcxfiles );
3598 
3600  }
3601  if ( dirnames )
3602  FreeFileList( dirnames, ndirs );
3603 
3604  return true;
3605 }
3606 
3607 static int pmicmpfnc( const void *_a, const void *_b )
3608 {
3609  const playermodelinfo_s *a = ( const playermodelinfo_s * ) _a;
3610  const playermodelinfo_s *b = ( const playermodelinfo_s * ) _b;
3611 
3612  /*
3613  ** sort by male, female, then alphabetical
3614  */
3615  if ( strcmp( a->directory, "male" ) == 0 )
3616  return -1;
3617  else if ( strcmp( b->directory, "male" ) == 0 )
3618  return 1;
3619 
3620  if ( strcmp( a->directory, "female" ) == 0 )
3621  return -1;
3622  else if ( strcmp( b->directory, "female" ) == 0 )
3623  return 1;
3624 
3625  return strcmp( a->directory, b->directory );
3626 }
3627 
3628 
3630 {
3631  extern cvar_t *name;
3632  extern cvar_t *team;
3633  extern cvar_t *skin;
3634  char currentdirectory[1024];
3635  char currentskin[1024];
3636  int i = 0;
3637 
3638  int currentdirectoryindex = 0;
3639  int currentskinindex = 0;
3640 
3641  cvar_t *hand = Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );
3642 
3643  static const char *handedness[] = { "right", "left", "center", 0 };
3644 
3646 
3647  if (s_numplayermodels == 0)
3648  return false;
3649 
3650  if ( hand->value < 0 || hand->value > 2 )
3651  Cvar_SetValue( "hand", 0 );
3652 
3653  strcpy( currentdirectory, skin->string );
3654 
3655  if ( strchr( currentdirectory, '/' ) )
3656  {
3657  strcpy( currentskin, strchr( currentdirectory, '/' ) + 1 );
3658  *strchr( currentdirectory, '/' ) = 0;
3659  }
3660  else if ( strchr( currentdirectory, '\\' ) )
3661  {
3662  strcpy( currentskin, strchr( currentdirectory, '\\' ) + 1 );
3663  *strchr( currentdirectory, '\\' ) = 0;
3664  }
3665  else
3666  {
3667  strcpy( currentdirectory, "male" );
3668  strcpy( currentskin, "grunt" );
3669  }
3670 
3671  qsort( s_pmi, s_numplayermodels, sizeof( s_pmi[0] ), pmicmpfnc );
3672 
3673  memset( s_pmnames, 0, sizeof( s_pmnames ) );
3674  for ( i = 0; i < s_numplayermodels; i++ )
3675  {
3677  if ( Q_stricmp( s_pmi[i].directory, currentdirectory ) == 0 )
3678  {
3679  int j;
3680 
3681  currentdirectoryindex = i;
3682 
3683  for ( j = 0; j < s_pmi[i].nskins; j++ )
3684  {
3685  if ( Q_stricmp( s_pmi[i].skindisplaynames[j], currentskin ) == 0 )
3686  {
3687  currentskinindex = j;
3688  break;
3689  }
3690  }
3691  }
3692  }
3693 
3697 
3699  s_player_name_field.generic.name = "name";
3705  strcpy( s_player_name_field.buffer, name->string );
3706  s_player_name_field.cursor = (int)strlen( name->string );
3707 
3709  s_player_model_title.generic.name = "model";
3712 
3718  s_player_model_box.curvalue = currentdirectoryindex;
3719  s_player_model_box.itemnames = (const char**)s_pmnames;
3720 
3722  s_player_skin_title.generic.name = "skin";
3725 
3732  s_player_skin_box.curvalue = currentskinindex;
3733  s_player_skin_box.itemnames = (const char**)s_pmi[currentdirectoryindex].skindisplaynames;
3734 
3736  s_player_hand_title.generic.name = "handedness";
3739 
3747  s_player_handedness_box.itemnames = handedness;
3748 
3749  for (i = 0; i < sizeof(rate_tbl) / sizeof(*rate_tbl) - 1; i++)
3750  if (Cvar_VariableValue("rate") == rate_tbl[i])
3751  break;
3752 
3754  s_player_rate_title.generic.name = "connect speed";
3757 
3766 
3768  s_player_download_action.generic.name = "download options";
3774 
3779  {
3782  }
3788 
3789  return true;
3790 }
3791 
3793 {
3794  extern float CalcFov( float fov_x, float w, float h );
3795  refdef_t refdef;
3796  char scratch[MAX_QPATH];
3797 
3798  memset( &refdef, 0, sizeof( refdef ) );
3799 
3800  refdef.x = viddef.width / 2;
3801  refdef.y = viddef.height / 2 - 72 * vid_hudscale->value;
3802  refdef.width = 144 * vid_hudscale->value;
3803  refdef.height = 168 * vid_hudscale->value;
3804  refdef.fov_x = 40;
3805  refdef.fov_y = CalcFov( refdef.fov_x, refdef.width, refdef.height );
3806  refdef.time = cls.realtime*0.001;
3807 
3809  {
3810  static int yaw;
3811  entity_t entity;
3812 
3813  memset( &entity, 0, sizeof( entity ) );
3814 
3815  Com_sprintf( scratch, sizeof( scratch ), "players/%s/tris.md2", s_pmi[s_player_model_box.curvalue].directory );
3816  entity.model = re.RegisterModel( scratch );
3818  entity.skin = re.RegisterSkin( scratch );
3819  entity.flags = RF_FULLBRIGHT;
3820  entity.origin[0] = 80;
3821  entity.origin[1] = 0;
3822  entity.origin[2] = 0;
3823  VectorCopy( entity.origin, entity.oldorigin );
3824  entity.frame = 0;
3825  entity.oldframe = 0;
3826  entity.backlerp = 0.0;
3827  entity.angles[1] = yaw++;
3828  if ( ++yaw > 360 )
3829  yaw -= 360;
3830 
3831  refdef.areabits = 0;
3832  refdef.num_entities = 1;
3833  refdef.entities = &entity;
3834  refdef.lightstyles = 0;
3835  refdef.rdflags = RDF_NOWORLDMODEL;
3836 
3838 
3839  M_DrawTextBox((refdef.x) * (320.0F / viddef.width) - 8 * vid_hudscale->value, (viddef.height / 2) * (240.0F / viddef.height) - 77 * vid_hudscale->value, refdef.width / (8 * vid_hudscale->value), refdef.height / (8 * vid_hudscale->value));
3840  refdef.height += 4 * vid_hudscale->value;
3841 
3842  re.RenderFrame( &refdef );
3843 
3844  Com_sprintf( scratch, sizeof( scratch ), "/players/%s/%s_i.pcx",
3847  re.DrawPic( s_player_config_menu.x - 40 * vid_hudscale->value, refdef.y, scratch );
3848  }
3849 }
3850 
3851 const char *PlayerConfig_MenuKey (int key)
3852 {
3853  int i;
3854 
3855  if ( key == K_ESCAPE )
3856  {
3857  char scratch[1024];
3858 
3859  Cvar_Set( "name", s_player_name_field.buffer );
3860 
3861  Com_sprintf( scratch, sizeof( scratch ), "%s/%s",
3864 
3865  Cvar_Set( "skin", scratch );
3866 
3867  for ( i = 0; i < s_numplayermodels; i++ )
3868  {
3869  int j;
3870 
3871  for ( j = 0; j < s_pmi[i].nskins; j++ )
3872  {
3873  if ( s_pmi[i].skindisplaynames[j] )
3874  free( s_pmi[i].skindisplaynames[j] );
3875  s_pmi[i].skindisplaynames[j] = 0;
3876  }
3877  free( s_pmi[i].skindisplaynames );
3878  s_pmi[i].skindisplaynames = 0;
3879  s_pmi[i].nskins = 0;
3880  }
3881  }
3882  return Default_MenuKey( &s_player_config_menu, key );
3883 }
3884 
3885 
3887 {
3888  if (!PlayerConfig_MenuInit())
3889  {
3890  Menu_SetStatusBar( &s_multiplayer_menu, "No valid player models found" );
3891  return;
3892  }
3895 }
3896 
3897 
3898 /*
3899 =======================================================================
3900 
3901 GALLERY MENU
3902 
3903 =======================================================================
3904 */
3905 #if 0
3906 void M_Menu_Gallery_f( void )
3907 {
3908  extern void Gallery_MenuDraw( void );
3909  extern const char *Gallery_MenuKey( int key );
3910 
3911  M_PushMenu( Gallery_MenuDraw, Gallery_MenuKey );
3912 }
3913 #endif
3914 
3915 /*
3916 =======================================================================
3917 
3918 QUIT MENU
3919 
3920 =======================================================================
3921 */
3922 
3923 const char *M_Quit_Key (int key)
3924 {
3925  switch (key)
3926  {
3927  case K_ESCAPE:
3928  case 'n':
3929  case 'N':
3930  M_PopMenu ();
3931  break;
3932 
3933  case 'Y':
3934  case 'y':
3936  CL_Quit_f ();
3937  break;
3938 
3939  default:
3940  break;
3941  }
3942 
3943  return NULL;
3944 
3945 }
3946 
3947 
3948 void M_Quit_Draw (void)
3949 {
3950  int w, h;
3951 
3952  re.DrawGetPicSize (&w, &h, "quit");
3953  re.DrawPic ( (viddef.width-w)/2, (viddef.height-h)/2, "quit");
3954 }
3955 
3956 
3957 void M_Menu_Quit_f (void)
3958 {
3960 }
3961 
3962 
3963 
3964 //=============================================================================
3965 /* Menu Subsystem */
3966 
3967 
3968 /*
3969 =================
3970 M_Init
3971 =================
3972 */
3973 void M_Init (void)
3974 {
3975  Cmd_AddCommand ("menu_main", M_Menu_Main_f);
3976  Cmd_AddCommand ("menu_game", M_Menu_Game_f);
3977  Cmd_AddCommand ("menu_loadgame", M_Menu_LoadGame_f);
3978  Cmd_AddCommand ("menu_savegame", M_Menu_SaveGame_f);
3979  Cmd_AddCommand ("menu_joinserver", M_Menu_JoinServer_f);
3980  Cmd_AddCommand ("menu_addressbook", M_Menu_AddressBook_f);
3981  Cmd_AddCommand ("menu_startserver", M_Menu_StartServer_f);
3982  Cmd_AddCommand ("menu_dmoptions", M_Menu_DMOptions_f);
3983  Cmd_AddCommand ("menu_playerconfig", M_Menu_PlayerConfig_f);
3984  Cmd_AddCommand ("menu_downloadoptions", M_Menu_DownloadOptions_f);
3985  Cmd_AddCommand ("menu_credits", M_Menu_Credits_f );
3986  Cmd_AddCommand ("menu_multiplayer", M_Menu_Multiplayer_f );
3987  Cmd_AddCommand ("menu_video", M_Menu_Video_f);
3988  Cmd_AddCommand ("menu_options", M_Menu_Options_f);
3989  Cmd_AddCommand ("menu_keys", M_Menu_Keys_f);
3990  Cmd_AddCommand ("menu_quit", M_Menu_Quit_f);
3991 }
3992 
3993 
3994 /*
3995 =================
3996 M_Draw
3997 =================
3998 */
3999 void M_Draw (void)
4000 {
4001  if (cls.key_dest != key_menu)
4002  return;
4003 
4004  // repaint everything next frame
4005  SCR_DirtyScreen ();
4006 
4007  // dim everything behind it down
4008  if (cl.cinematictime > 0)
4009  re.DrawFill (0,0,viddef.width, viddef.height, 0);
4010  else
4011  re.DrawFadeScreen ();
4012 
4013  m_drawfunc ();
4014 
4015  // delay playing the enter sound until after the
4016  // menu has been drawn, to avoid delay while
4017  // caching images
4018  if (m_entersound)
4019  {
4021  m_entersound = false;
4022  }
4023 }
4024 
4025 
4026 /*
4027 =================
4028 M_Keydown
4029 =================
4030 */
4031 void M_Keydown (int key)
4032 {
4033  const char *s;
4034 
4035  if (m_keyfunc)
4036  if ( ( s = m_keyfunc( key ) ) != 0 )
4037  S_StartLocalSound( ( char * ) s );
4038 }
4039 
4040 
K_KP_ENTER
#define K_KP_ENTER
Definition: keys.h:70
M_Credits_Key
const char * M_Credits_Key(int key)
Definition: menu.c:1821
K_AUX11
#define K_AUX11
Definition: keys.h:108
K_AUX5
#define K_AUX5
Definition: keys.h:102
crosshair
cvar_t * crosshair
Definition: cl_view.c:33
s_join_network_server_action
static menuaction_s s_join_network_server_action
Definition: menu.c:507
sensitivity
cvar_t * sensitivity
Definition: cl_main.c:65
s_startmap_list
static menulist_s s_startmap_list
Definition: menu.c:2401
AddressBookFunc
void AddressBookFunc(void *self)
Definition: menu.c:2277
s_options_alwaysrun_box
static menulist_s s_options_alwaysrun_box
Definition: menu.c:1052
M_Menu_Multiplayer_f
void M_Menu_Multiplayer_f(void)
Definition: menu.c:574
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:159
nummaps
static int nummaps
Definition: menu.c:2393
s_medium_game_action
static menuaction_s s_medium_game_action
Definition: menu.c:1903
s_keys_backpedal_action
static menuaction_s s_keys_backpedal_action
Definition: menu.c:628
K_AUX8
#define K_AUX8
Definition: keys.h:105
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:350
M_Menu_JoinServer_f
void M_Menu_JoinServer_f(void)
Definition: menu.c:2377
menuseparator_s
Definition: qmenu.h:118
s_dmoptions_menu
static menuframework_s s_dmoptions_menu
Definition: menu.c:2774
value
GLfloat value
Definition: qgl_win.c:63
s_joinserver_server_title
static menuseparator_s s_joinserver_server_title
Definition: menu.c:2225
s_player_handedness_box
static menulist_s s_player_handedness_box
Definition: menu.c:3383
entity_s::skin
struct image_s * skin
Definition: ref.h:75
s_quad_drop_box
static menulist_s s_quad_drop_box
Definition: menu.c:2790
s_player_setup_action
static menuaction_s s_player_setup_action
Definition: menu.c:509
s_samelevel_box
static menulist_s s_samelevel_box
Definition: menu.c:2784
M_Print
void M_Print(int cx, int cy, char *str)
Definition: menu.c:280
MAIN_ITEMS
#define MAIN_ITEMS
Definition: menu.c:388
CreditsFunc
static void CreditsFunc(void *unused)
Definition: menu.c:1952
client_state_t::servercount
int servercount
Definition: client.h:154
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
entity_s::origin
float origin[3]
Definition: ref.h:57
entity_s::model
struct model_s * model
Definition: ref.h:51
K_JOY4
#define K_JOY4
Definition: keys.h:92
s_joinserver_address_book_action
static menuaction_s s_joinserver_address_book_action
Definition: menu.c:2227
s_player_skin_box
static menulist_s s_player_skin_box
Definition: menu.c:3382
s_hard_game_action
static menuaction_s s_hard_game_action
Definition: menu.c:1904
K_KP_RIGHTARROW
#define K_KP_RIGHTARROW
Definition: keys.h:66
s_startserver_start_action
static menuaction_s s_startserver_start_action
Definition: menu.c:2395
DF_WEAPONS_STAY
#define DF_WEAPONS_STAY
Definition: q_shared.h:1026
K_AUX21
#define K_AUX21
Definition: keys.h:118
Multiplayer_MenuKey
const char * Multiplayer_MenuKey(int key)
Definition: menu.c:569
Keys_MenuInit
static void Keys_MenuInit(void)
Definition: menu.c:747
refdef_t
Definition: ref.h:102
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
NO_SERVER_STRING
#define NO_SERVER_STRING
Definition: menu.c:2231
JoinServer_MenuDraw
void JoinServer_MenuDraw(void)
Definition: menu.c:2353
playermodelinfo_s::directory
char directory[MAX_QPATH]
Definition: menu.c:3399
DF_NO_FALLING
#define DF_NO_FALLING
Definition: q_shared.h:1027
client_state_t::attractloop
qboolean attractloop
Definition: client.h:153
Multiplayer_MenuDraw
static void Multiplayer_MenuDraw(void)
Definition: menu.c:511
StartServerActionFunc
void StartServerActionFunc(void *self)
Definition: menu.c:2448
M_Init
void M_Init(void)
Definition: menu.c:3973
M_Main_Draw
void M_Main_Draw(void)
Definition: menu.c:391
MAX_MENU_DEPTH
#define MAX_MENU_DEPTH
Definition: menu.c:69
AlwaysRunFunc
static void AlwaysRunFunc(void *unused)
Definition: menu.c:1079
s_allow_exit_box
static menulist_s s_allow_exit_box
Definition: menu.c:2787
InvertMouseFunc
static void InvertMouseFunc(void *unused)
Definition: menu.c:1144
MAX_DISPLAYNAME
#define MAX_DISPLAYNAME
Definition: menu.c:3391
maxclients
cvar_t * maxclients
Definition: g_main.c:44
DMOptions_MenuDraw
void DMOptions_MenuDraw(void)
Definition: menu.c:3152
Multiplayer_MenuInit
void Multiplayer_MenuInit(void)
Definition: menu.c:534
FreeLookFunc
static void FreeLookFunc(void *unused)
Definition: menu.c:1084
menucommon_s::localdata
int localdata[4]
Definition: qmenu.h:71
Key_SetBinding
void Key_SetBinding(int keynum, char *binding)
Definition: keys.c:506
DownloadOptions_MenuInit
void DownloadOptions_MenuInit(void)
Definition: menu.c:3214
menufield_s::generic
menucommon_s generic
Definition: qmenu.h:84
menufield_s::visible_length
int visible_length
Definition: qmenu.h:89
StartServer_MenuKey
const char * StartServer_MenuKey(int key)
Definition: menu.c:2740
K_MOUSE2
#define K_MOUSE2
Definition: keys.h:83
cl_run
cvar_t * cl_run
Definition: cl_input.c:230
K_JOY2
#define K_JOY2
Definition: keys.h:90
RulesChangeFunc
void RulesChangeFunc(void *self)
Definition: menu.c:2411
StartGame
static void StartGame(void)
Definition: menu.c:1910
s_player_rate_title
static menuseparator_s s_player_rate_title
Definition: menu.c:3388
ModelCallback
static void ModelCallback(void *unused)
Definition: menu.c:3426
s_startserver_dmoptions_action
static menuaction_s s_startserver_dmoptions_action
Definition: menu.c:2396
DownloadOptions_MenuKey
const char * DownloadOptions_MenuKey(int key)
Definition: menu.c:3289
CL_PingServers_f
void CL_PingServers_f(void)
Definition: cl_main.c:802
menucommon_s::type
int type
Definition: qmenu.h:66
refdef_t::areabits
byte * areabits
Definition: ref.h:112
K_JOY1
#define K_JOY1
Definition: keys.h:89
s_keys_attack_action
static menuaction_s s_keys_attack_action
Definition: menu.c:623
s_options_lookstrafe_box
static menulist_s s_options_lookstrafe_box
Definition: menu.c:1055
M_Menu_Main_f
void M_Menu_Main_f(void)
Definition: menu.c:494
s_rules_box
static menulist_s s_rules_box
Definition: menu.c:2402
s_loadgame_actions
static menuaction_s s_loadgame_actions[MAX_SAVEGAMES]
Definition: menu.c:2050
M_Quit_Key
const char * M_Quit_Key(int key)
Definition: menu.c:3923
s_options_joystick_box
static menulist_s s_options_joystick_box
Definition: menu.c:1058
menu_out_sound
static char * menu_out_sound
Definition: menu.c:39
M_DrawTextBox
void M_DrawTextBox(int x, int y, int width, int lines)
Definition: menu.c:337
_tag_menuframework::y
int y
Definition: qmenu.h:51
s_player_name_field
static menufield_s s_player_name_field
Definition: menu.c:3380
menuslider_s::generic
menucommon_s generic
Definition: qmenu.h:95
roguecredits
static const char * roguecredits[]
Definition: menu.c:1663
JoinNetworkServerFunc
static void JoinNetworkServerFunc(void *unused)
Definition: menu.c:524
menufield_s::length
int length
Definition: qmenu.h:88
MediumGameFunc
static void MediumGameFunc(void *data)
Definition: menu.c:1930
model_s::flags
int flags
Definition: r_model.h:180
RateCallback
static void RateCallback(void *unused)
Definition: menu.c:3420
K_BACKSPACE
#define K_BACKSPACE
Definition: keys.h:32
s_options_defaults_action
static menuaction_s s_options_defaults_action
Definition: menu.c:1047
K_MOUSE1
#define K_MOUSE1
Definition: keys.h:82
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:160
refexport_t::DrawFill
void(* DrawFill)(int x, int y, int w, int h, int c)
Definition: ref.h:171
K_AUX14
#define K_AUX14
Definition: keys.h:111
s_options_console_action
static menulist_s s_options_console_action
Definition: menu.c:1062
xoffset
GLint GLint xoffset
Definition: qgl_win.c:118
Create_Savestrings
void Create_Savestrings(void)
Definition: menu.c:2055
s_powerups_box
static menulist_s s_powerups_box
Definition: menu.c:2780
M_Menu_SaveGame_f
void M_Menu_SaveGame_f(void)
Definition: menu.c:2204
M_Menu_StartServer_f
void M_Menu_StartServer_f(void)
Definition: menu.c:2759
cvar_s::string
char * string
Definition: q_shared.h:327
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
K_ENTER
#define K_ENTER
Definition: keys.h:26
search_local_games
static qboolean search_local_games
Definition: menu.c:33
i
int i
Definition: q_shared.c:305
PlayerConfig_MenuKey
const char * PlayerConfig_MenuKey(int key)
Definition: menu.c:3851
s_start_network_server_action
static menuaction_s s_start_network_server_action
Definition: menu.c:508
refdef_t::y
int y
Definition: ref.h:104
DF_INFINITE_AMMO
#define DF_INFINITE_AMMO
Definition: q_shared.h:1037
DMOptions_MenuInit
void DMOptions_MenuInit(void)
Definition: menu.c:2942
ControlsResetDefaultsFunc
static void ControlsResetDefaultsFunc(void *unused)
Definition: menu.c:1136
LoadGame_MenuInit
void LoadGame_MenuInit(void)
Definition: menu.c:2088
UpdateVolumeFunc
static void UpdateVolumeFunc(void *unused)
Definition: menu.c:1159
ClampCvar
static float ClampCvar(float min, float max, float value)
Definition: menu.c:1099
UpdateCDVolumeFunc
static void UpdateCDVolumeFunc(void *unused)
Definition: menu.c:1164
K_AUX16
#define K_AUX16
Definition: keys.h:113
menucommon_s::flags
unsigned flags
Definition: qmenu.h:72
menucommon_s::x
int x
Definition: qmenu.h:68
m_num_servers
int m_num_servers
Definition: menu.c:2230
s_options_customize_options_action
static menuaction_s s_options_customize_options_action
Definition: menu.c:1048
M_Quit_Draw
void M_Quit_Draw(void)
Definition: menu.c:3948
EasyGameFunc
static void EasyGameFunc(void *data)
Definition: menu.c:1924
idcredits
static const char * idcredits[]
Definition: menu.c:1431
s_friendlyfire_box
static menulist_s s_friendlyfire_box
Definition: menu.c:2776
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
PlayerConfig_ScanDirectories
static qboolean PlayerConfig_ScanDirectories(void)
Definition: menu.c:3465
QMF_LEFT_JUSTIFY
#define QMF_LEFT_JUSTIFY
Definition: qmenu.h:45
s_stack_double_box
static menulist_s s_stack_double_box
Definition: menu.c:2795
DownloadOptions_MenuDraw
void DownloadOptions_MenuDraw(void)
Definition: menu.c:3284
client_state_t::cinematictime
int cinematictime
Definition: client.h:145
DownloadOptionsFunc
void DownloadOptionsFunc(void *self)
Definition: menu.c:3410
FS_NextPath
char * FS_NextPath(char *prevpath)
Definition: files.c:821
MAX_TOKEN_CHARS
#define MAX_TOKEN_CHARS
Definition: q_shared.h:78
credits_start_time
static int credits_start_time
Definition: menu.c:1427
s_keys_step_right_action
static menuaction_s s_keys_step_right_action
Definition: menu.c:633
creditsIndex
static char * creditsIndex[256]
Definition: menu.c:1429
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:161
refdef_t::rdflags
int rdflags
Definition: ref.h:110
s_game_menu
static menuframework_s s_game_menu
Definition: menu.c:1901
M_PrintWhite
void M_PrintWhite(int cx, int cy, char *str)
Definition: menu.c:290
menucommon_s::ownerdraw
void(* ownerdraw)(void *self)
Definition: qmenu.h:78
DF_SPAWN_FARTHEST
#define DF_SPAWN_FARTHEST
Definition: q_shared.h:1033
s_options_invertmouse_box
static menulist_s s_options_invertmouse_box
Definition: menu.c:1053
width
GLint GLsizei width
Definition: qgl_win.c:115
keys_cursor
int keys_cursor
Definition: menu.c:619
menuaction_s::generic
menucommon_s generic
Definition: qmenu.h:115
DF_NO_ITEMS
#define DF_NO_ITEMS
Definition: q_shared.h:1025
entity_s::flags
int flags
Definition: ref.h:76
SCR_DirtyScreen
void SCR_DirtyScreen(void)
Definition: cl_scrn.c:681
SaveGame_MenuInit
void SaveGame_MenuInit(void)
Definition: menu.c:2166
K_AUX18
#define K_AUX18
Definition: keys.h:115
DF_ALLOW_EXIT
#define DF_ALLOW_EXIT
Definition: q_shared.h:1036
Keys_MenuKey
static const char * Keys_MenuKey(int key)
Definition: menu.c:994
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
s_keys_change_weapon_action
static menuaction_s s_keys_change_weapon_action
Definition: menu.c:624
Menu_Center
void Menu_Center(menuframework_s *menu)
Definition: qmenu.c:336
HandednessCallback
static void HandednessCallback(void *unused)
Definition: menu.c:3415
cvar_s
Definition: q_shared.h:324
s_credits_action
static menuaction_s s_credits_action
Definition: menu.c:1907
DF_FORCE_RESPAWN
#define DF_FORCE_RESPAWN
Definition: q_shared.h:1034
DF_FIXED_FOV
#define DF_FIXED_FOV
Definition: q_shared.h:1039
win_noalttab
static cvar_t * win_noalttab
Definition: menu.c:1043
s_startserver_menu
static menuframework_s s_startserver_menu
Definition: menu.c:2391
key_menu
@ key_menu
Definition: client.h:200
SaveGameCallback
void SaveGameCallback(void *self)
Definition: menu.c:2151
freelook
cvar_t * freelook
Definition: cl_main.c:24
s_pmnames
static char * s_pmnames[MAX_PLAYERMODELS]
Definition: menu.c:3403
DF_NO_NUKES
#define DF_NO_NUKES
Definition: q_shared.h:1047
K_AUX7
#define K_AUX7
Definition: keys.h:104
QMF_GRAYED
#define QMF_GRAYED
Definition: qmenu.h:46
menuslider_s::minvalue
float minvalue
Definition: qmenu.h:97
s_keys_look_down_action
static menuaction_s s_keys_look_down_action
Definition: menu.c:636
s_allow_download_models_box
static menulist_s s_allow_download_models_box
Definition: menu.c:3180
viddef
viddef_t viddef
Definition: vid_dll.c:54
LookstrafeFunc
static void LookstrafeFunc(void *unused)
Definition: menu.c:1154
j
GLint j
Definition: qgl_win.c:150
m_menudepth
int m_menudepth
Definition: menu.c:79
DMOptionsFunc
void DMOptionsFunc(void *self)
Definition: menu.c:2404
K_JOY3
#define K_JOY3
Definition: keys.h:91
CustomizeControlsFunc
static void CustomizeControlsFunc(void *unused)
Definition: menu.c:1074
K_AUX27
#define K_AUX27
Definition: keys.h:124
m_layers
menulayer_t m_layers[MAX_MENU_DEPTH]
Definition: menu.c:78
s_weapons_stay_box
static menulist_s s_weapons_stay_box
Definition: menu.c:2778
va
char * va(char *format,...)
Definition: q_shared.c:1050
K_MOUSE3
#define K_MOUSE3
Definition: keys.h:84
s_keys_inv_next_action
static menuaction_s s_keys_inv_next_action
Definition: menu.c:646
M_Menu_Credits
void M_Menu_Credits(void)
NUM_CURSOR_FRAMES
#define NUM_CURSOR_FRAMES
Definition: menu.c:35
Menu_DrawString
void Menu_DrawString(int x, int y, const char *string)
Definition: qmenu.c:434
DF_INSTANT_ITEMS
#define DF_INSTANT_ITEMS
Definition: q_shared.h:1028
Cvar_ForceSet
cvar_t * Cvar_ForceSet(char *var_name, char *value)
Definition: cvar.c:268
ControlsSetMenuItemValues
static void ControlsSetMenuItemValues(void)
Definition: menu.c:1106
M_AddToServerList
void M_AddToServerList(netadr_t adr, char *info)
Definition: menu.c:2239
menufield_s::cursor
int cursor
Definition: qmenu.h:87
DF_NO_HEALTH
#define DF_NO_HEALTH
Definition: q_shared.h:1024
s_savegame_actions
static menuaction_s s_savegame_actions[MAX_SAVEGAMES]
Definition: menu.c:2149
K_AUX30
#define K_AUX30
Definition: keys.h:127
M_Menu_Keys_f
void M_Menu_Keys_f(void)
Definition: menu.c:1029
refexport_t::DrawFadeScreen
void(* DrawFadeScreen)(void)
Definition: ref.h:172
s_armor_box
static menulist_s s_armor_box
Definition: menu.c:2786
M_Menu_DownloadOptions_f
void M_Menu_DownloadOptions_f(void)
Definition: menu.c:3294
Menu_Draw
void Menu_Draw(menuframework_s *menu)
Definition: qmenu.c:346
Game_MenuDraw
void Game_MenuDraw(void)
Definition: menu.c:2018
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:622
menulayer_t::key
const char *(* key)(int k)
Definition: menu.c:75
K_AUX6
#define K_AUX6
Definition: keys.h:103
menulayer_t
Definition: menu.c:72
s_keys_look_up_action
static menuaction_s s_keys_look_up_action
Definition: menu.c:635
K_AUX29
#define K_AUX29
Definition: keys.h:126
menu_in_sound
static char * menu_in_sound
Definition: menu.c:37
s_joinserver_server_actions
static menuaction_s s_joinserver_server_actions[MAX_LOCAL_SERVERS]
Definition: menu.c:2228
s_teamplay_box
static menulist_s s_teamplay_box
Definition: menu.c:2783
MAX_LOCAL_SERVERS
#define MAX_LOCAL_SERVERS
Definition: menu.c:2222
menucommon_s::y
int y
Definition: qmenu.h:68
skin
cvar_t * skin
Definition: cl_main.c:80
M_Menu_Credits_f
void M_Menu_Credits_f(void)
Definition: menu.c:1838
creditsBuffer
static char * creditsBuffer
Definition: menu.c:1430
CL_Snd_Restart_f
void CL_Snd_Restart_f(void)
Definition: cl_main.c:1098
menucommon_s
Definition: qmenu.h:64
m_savevalid
qboolean m_savevalid[MAX_SAVEGAMES]
Definition: menu.c:2053
vid_hudscale
cvar_t * vid_hudscale
Definition: vid_dll.c:48
s_options_menu
static menuframework_s s_options_menu
Definition: menu.c:1046
rate_tbl
static int rate_tbl[]
Definition: menu.c:3406
Keys_MenuDraw
static void Keys_MenuDraw(void)
Definition: menu.c:988
timelimit
cvar_t * timelimit
Definition: g_main.c:40
s_loadgame_menu
static menuframework_s s_loadgame_menu
Definition: menu.c:2049
s_joinserver_menu
static menuframework_s s_joinserver_menu
Definition: menu.c:2224
viddef_t::width
unsigned width
Definition: vid.h:29
Sys_FindFirst
char * Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
Definition: q_shwin.c:173
s_numplayermodels
static int s_numplayermodels
Definition: menu.c:3404
s_instant_powerups_box
static menulist_s s_instant_powerups_box
Definition: menu.c:2779
s_keys_move_down_action
static menuaction_s s_keys_move_down_action
Definition: menu.c:641
s_keys_mouse_look_action
static menuaction_s s_keys_mouse_look_action
Definition: menu.c:638
LoadGameCallback
void LoadGameCallback(void *self)
Definition: menu.c:2079
Developer_searchpath
int Developer_searchpath(int who)
Definition: files.c:159
menulist_s
Definition: qmenu.h:104
DF_SKINTEAMS
#define DF_SKINTEAMS
Definition: q_shared.h:1030
JoystickFunc
static void JoystickFunc(void *unused)
Definition: menu.c:1069
KeyCursorDrawFunc
static void KeyCursorDrawFunc(menuframework_s *menu)
Definition: menu.c:694
HardGameFunc
static void HardGameFunc(void *data)
Definition: menu.c:1936
AddressBook_MenuKey
const char * AddressBook_MenuKey(int key)
Definition: menu.c:3344
s_keys_walk_forward_action
static menuaction_s s_keys_walk_forward_action
Definition: menu.c:627
s_options_compatibility_list
static menulist_s s_options_compatibility_list
Definition: menu.c:1061
DF_SAME_LEVEL
#define DF_SAME_LEVEL
Definition: q_shared.h:1029
Menu_ItemAtCursor
void * Menu_ItemAtCursor(menuframework_s *m)
Definition: qmenu.c:474
Menu_SelectItem
qboolean Menu_SelectItem(menuframework_s *s)
Definition: qmenu.c:482
K_AUX24
#define K_AUX24
Definition: keys.h:121
M_PopMenu
void M_PopMenu(void)
Definition: menu.c:133
min
#define min(a, b)
Definition: vk_local.h:72
DF_QUAD_DROP
#define DF_QUAD_DROP
Definition: q_shared.h:1038
Menu_AdjustCursor
void Menu_AdjustCursor(menuframework_s *m, int dir)
Definition: qmenu.c:288
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
menucommon_s::callback
void(* callback)(void *self)
Definition: qmenu.h:76
Key_KeynumToString
char * Key_KeynumToString(int keynum)
Definition: keys.c:479
s_no_mines_box
static menulist_s s_no_mines_box
Definition: menu.c:2793
key_game
@ key_game
Definition: client.h:200
entity_s::oldframe
int oldframe
Definition: ref.h:64
K_AUX17
#define K_AUX17
Definition: keys.h:114
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:398
s_fixed_fov_box
static menulist_s s_fixed_fov_box
Definition: menu.c:2789
K_LEFTARROW
#define K_LEFTARROW
Definition: keys.h:35
menuslider_s::maxvalue
float maxvalue
Definition: qmenu.h:98
s_keys_change_weapon_last_action
static menuaction_s s_keys_change_weapon_last_action
Definition: menu.c:626
lookspring
cvar_t * lookspring
Definition: cl_main.c:63
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
viddef_t::height
unsigned height
Definition: vid.h:29
M_Banner
static void M_Banner(char *name)
Definition: menu.c:81
K_AUX22
#define K_AUX22
Definition: keys.h:119
_tag_menuframework::cursordraw
void(* cursordraw)(struct _tag_menuframework *m)
Definition: qmenu.h:60
s_falls_box
static menulist_s s_falls_box
Definition: menu.c:2777
lookstrafe
cvar_t * lookstrafe
Definition: cl_main.c:64
_tag_menuframework::cursor
int cursor
Definition: qmenu.h:52
s_keys_keyboard_look_action
static menuaction_s s_keys_keyboard_look_action
Definition: menu.c:639
s_no_nukes_box
static menulist_s s_no_nukes_box
Definition: menu.c:2794
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
cvar_s::value
float value
Definition: q_shared.h:331
m_game_cursor
static int m_game_cursor
Definition: menu.c:1899
PlayerConfig_MenuDraw
void PlayerConfig_MenuDraw(void)
Definition: menu.c:3792
VID_MenuDraw
void VID_MenuDraw(void)
Definition: vid_menu.c:646
Cvar_SetValue
void Cvar_SetValue(char *var_name, float value)
Definition: cvar.c:317
entity_s::backlerp
float backlerp
Definition: ref.h:69
m_drawfunc
void(* m_drawfunc)(void)
Definition: menu.c:63
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:81
K_DOWNARROW
#define K_DOWNARROW
Definition: keys.h:34
K_KP_DEL
#define K_KP_DEL
Definition: keys.h:72
M_ForceMenuOff
void M_ForceMenuOff(void)
Definition: menu.c:123
K_KP_UPARROW
#define K_KP_UPARROW
Definition: keys.h:62
ConsoleFunc
static void ConsoleFunc(void *unused)
Definition: menu.c:1169
UpdateSoundQualityFunc
static void UpdateSoundQualityFunc(void *unused)
Definition: menu.c:1189
K_AUX28
#define K_AUX28
Definition: keys.h:125
M_Menu_DMOptions_f
void M_Menu_DMOptions_f(void)
Definition: menu.c:3162
key_console
@ key_console
Definition: client.h:200
Options_MenuInit
void Options_MenuInit(void)
Definition: menu.c:1207
credits
static const char ** credits
Definition: menu.c:1428
NULL
#define NULL
Definition: q_shared.h:67
refexport_t::DrawGetPicSize
void(* DrawGetPicSize)(int *w, int *h, char *name)
Definition: ref.h:166
FS_ListFiles
char ** FS_ListFiles(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
Definition: files.c:694
menucommon_s::cursor_offset
int cursor_offset
Definition: qmenu.h:70
CalcFov
float CalcFov(float fov_x, float width, float height)
Definition: cl_view.c:367
local_server_netadr
static netadr_t local_server_netadr[MAX_LOCAL_SERVERS]
Definition: menu.c:2237
refdef_t::time
float time
Definition: ref.h:109
s_options_sensitivity_slider
static menuslider_s s_options_sensitivity_slider
Definition: menu.c:1049
xatcredits
static const char * xatcredits[]
Definition: menu.c:1522
s_hostname_field
static menufield_s s_hostname_field
Definition: menu.c:2400
JoinServerFunc
void JoinServerFunc(void *self)
Definition: menu.c:2259
MTYPE_ACTION
#define MTYPE_ACTION
Definition: qmenu.h:27
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
menuaction_s
Definition: qmenu.h:113
M_Menu_AddressBook_f
void M_Menu_AddressBook_f(void)
Definition: menu.c:3366
s_options_lookspring_box
static menulist_s s_options_lookspring_box
Definition: menu.c:1054
Con_ClearNotify
void Con_ClearNotify(void)
Definition: console.c:208
s_options_freelook_box
static menulist_s s_options_freelook_box
Definition: menu.c:1050
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:167
refdef_t::height
int height
Definition: ref.h:104
in_joystick
cvar_t * in_joystick
Definition: in_win.c:56
DF_NO_MINES
#define DF_NO_MINES
Definition: q_shared.h:1045
rate_names
static const char * rate_names[]
Definition: menu.c:3407
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:158
pmicmpfnc
static int pmicmpfnc(const void *_a, const void *_b)
Definition: menu.c:3607
dmoptions_statusbar
static char dmoptions_statusbar[128]
Definition: menu.c:2772
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1180
s_keys_move_up_action
static menuaction_s s_keys_move_up_action
Definition: menu.c:640
K_AUX31
#define K_AUX31
Definition: keys.h:128
s_health_box
static menulist_s s_health_box
Definition: menu.c:2781
s_keys_change_weapon_prev_action
static menuaction_s s_keys_change_weapon_prev_action
Definition: menu.c:625
s_save_game_action
static menuaction_s s_save_game_action
Definition: menu.c:1906
menulayer_t::draw
void(* draw)(void)
Definition: menu.c:74
K_AUX15
#define K_AUX15
Definition: keys.h:112
name
cvar_t * name
Definition: cl_main.c:79
SaveGame_MenuDraw
void SaveGame_MenuDraw(void)
Definition: menu.c:2159
mapnames
static char ** mapnames
Definition: menu.c:2392
StartServer_MenuDraw
void StartServer_MenuDraw(void)
Definition: menu.c:2735
NullCursorDraw
void NullCursorDraw(void *self)
Definition: menu.c:2282
_tag_menuframework
Definition: qmenu.h:49
K_RIGHTARROW
#define K_RIGHTARROW
Definition: keys.h:36
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
_tag_menuframework::nitems
int nitems
Definition: qmenu.h:54
bindnames
char * bindnames[][2]
Definition: menu.c:587
LoadGameFunc
static void LoadGameFunc(void *unused)
Definition: menu.c:1942
K_AUX32
#define K_AUX32
Definition: keys.h:129
playermodelinfo_s::displayname
char displayname[MAX_DISPLAYNAME]
Definition: menu.c:3398
s_player_model_title
static menuseparator_s s_player_model_title
Definition: menu.c:3386
menulist_s::curvalue
int curvalue
Definition: qmenu.h:108
s_options_crosshair_box
static menulist_s s_options_crosshair_box
Definition: menu.c:1056
s_options_noalttab_box
static menulist_s s_options_noalttab_box
Definition: menu.c:1051
s_options_sfxvolume_slider
static menuslider_s s_options_sfxvolume_slider
Definition: menu.c:1057
s
static fixed16_t s
Definition: r_scan.c:30
s_keys_inv_use_action
static menuaction_s s_keys_inv_use_action
Definition: menu.c:643
y
GLint y
Definition: qgl_win.c:115
K_AUX23
#define K_AUX23
Definition: keys.h:120
re
refexport_t re
Definition: vid_dll.c:32
VID_MenuInit
void VID_MenuInit(void)
Definition: vid_menu.c:290
MouseSpeedFunc
static void MouseSpeedFunc(void *unused)
Definition: menu.c:1089
ystart
static int ystart
Definition: r_polyse.c:99
M_Menu_LoadGame_f
void M_Menu_LoadGame_f(void)
Definition: menu.c:2134
s_keys_step_left_action
static menuaction_s s_keys_step_left_action
Definition: menu.c:632
MTYPE_SLIDER
#define MTYPE_SLIDER
Definition: qmenu.h:25
s_keys_sidestep_action
static menuaction_s s_keys_sidestep_action
Definition: menu.c:634
s_maxclients_field
static menufield_s s_maxclients_field
Definition: menu.c:2399
entity_s::frame
int frame
Definition: ref.h:58
DrawKeyBindingFunc
static void DrawKeyBindingFunc(void *self)
Definition: menu.c:702
s_keys_help_computer_action
static menuaction_s s_keys_help_computer_action
Definition: menu.c:648
AddressBook_MenuInit
void AddressBook_MenuInit(void)
Definition: menu.c:3311
bind_grab
static int bind_grab
Definition: menu.c:620
K_AUX10
#define K_AUX10
Definition: keys.h:107
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
s_keys_run_action
static menuaction_s s_keys_run_action
Definition: menu.c:631
Menu_SetStatusBar
void Menu_SetStatusBar(menuframework_s *m, const char *string)
Definition: qmenu.c:506
s_download_title
static menuseparator_s s_download_title
Definition: menu.c:3177
Key_ClearTyping
void Key_ClearTyping(void)
Definition: console.c:57
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:114
s_allow_download_maps_box
static menulist_s s_allow_download_maps_box
Definition: menu.c:3179
s_force_respawn_box
static menulist_s s_force_respawn_box
Definition: menu.c:2785
FreeFileList
static void FreeFileList(char **list, int n)
Definition: menu.c:3432
M_FindKeysForCommand
static void M_FindKeysForCommand(char *command, int *twokeys)
Definition: menu.c:668
DownloadCallback
static void DownloadCallback(void *self)
Definition: menu.c:3184
s_player_hand_title
static menuseparator_s s_player_hand_title
Definition: menu.c:3387
DF_NO_STACK_DOUBLE
#define DF_NO_STACK_DOUBLE
Definition: q_shared.h:1046
playermodelinfo_s::skindisplaynames
char ** skindisplaynames
Definition: menu.c:3397
_tag_menuframework::x
int x
Definition: qmenu.h:51
m_pitch
cvar_t * m_pitch
Definition: cl_main.c:67
K_AUX26
#define K_AUX26
Definition: keys.h:123
s_joinserver_search_action
static menuaction_s s_joinserver_search_action
Definition: menu.c:2226
K_AUX25
#define K_AUX25
Definition: keys.h:122
MAX_SAVEGAMES
#define MAX_SAVEGAMES
Definition: menu.c:2045
menucommon_s::statusbar
const char * statusbar
Definition: qmenu.h:74
menuslider_s::curvalue
float curvalue
Definition: qmenu.h:99
refdef_t::num_entities
int num_entities
Definition: ref.h:116
DMOptions_MenuKey
const char * DMOptions_MenuKey(int key)
Definition: menu.c:3157
playermodelinfo_s::nskins
int nskins
Definition: menu.c:3396
Cbuf_InsertText
void Cbuf_InsertText(char *text)
Definition: cmd.c:114
K_AUX1
#define K_AUX1
Definition: keys.h:98
menuslider_s
Definition: qmenu.h:93
K_AUX2
#define K_AUX2
Definition: keys.h:99
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:559
M_Keydown
void M_Keydown(int key)
Definition: menu.c:4031
s_player_skin_title
static menuseparator_s s_player_skin_title
Definition: menu.c:3385
Game_MenuInit
void Game_MenuInit(void)
Definition: menu.c:1957
menucommon_s::name
const char * name
Definition: qmenu.h:67
entity_s
Definition: ref.h:49
StartNetworkServerFunc
static void StartNetworkServerFunc(void *unused)
Definition: menu.c:529
menu_move_sound
static char * menu_move_sound
Definition: menu.c:38
menufield_s
Definition: qmenu.h:82
Options_MenuDraw
void Options_MenuDraw(void)
Definition: menu.c:1377
RF_FULLBRIGHT
#define RF_FULLBRIGHT
Definition: q_shared.h:602
Field_Key
qboolean Field_Key(menufield_s *f, int key)
Definition: qmenu.c:135
Com_ServerState
int Com_ServerState(void)
Definition: common.c:256
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:317
StartServer_MenuInit
void StartServer_MenuInit(void)
Definition: menu.c:2530
M_PushMenu
void M_PushMenu(void(*draw)(void), const char *(*key)(int k))
Definition: menu.c:89
menulist_s::itemnames
const char ** itemnames
Definition: qmenu.h:110
M_Menu_PlayerConfig_f
void M_Menu_PlayerConfig_f(void)
Definition: menu.c:3886
Cbuf_Execute
void Cbuf_Execute(void)
Definition: cmd.c:194
s_infinite_ammo_box
static menulist_s s_infinite_ammo_box
Definition: menu.c:2788
MTYPE_SPINCONTROL
#define MTYPE_SPINCONTROL
Definition: qmenu.h:28
m_savestrings
char m_savestrings[MAX_SAVEGAMES][32]
Definition: menu.c:2052
NoAltTabFunc
static void NoAltTabFunc(void *unused)
Definition: menu.c:1094
M_Menu_Video_f
void M_Menu_Video_f(void)
Definition: menu.c:1414
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
refdef_t::fov_x
float fov_x
Definition: ref.h:105
M_Credits_MenuDraw
void M_Credits_MenuDraw(void)
Definition: menu.c:1778
M_DrawCursor
void M_DrawCursor(int x, int y, int f)
Definition: menu.c:315
K_DEL
#define K_DEL
Definition: keys.h:54
SearchLocalGames
void SearchLocalGames(void)
Definition: menu.c:2286
refdef_t::fov_y
float fov_y
Definition: ref.h:105
Sys_FindClose
void Sys_FindClose(void)
Definition: q_shwin.c:206
s_keys_turn_right_action
static menuaction_s s_keys_turn_right_action
Definition: menu.c:630
s_pmi
static playermodelinfo_s s_pmi[MAX_PLAYERMODELS]
Definition: menu.c:3402
s_addressbook_menu
static menuframework_s s_addressbook_menu
Definition: menu.c:3308
CrosshairFunc
static void CrosshairFunc(void *unused)
Definition: menu.c:1064
KeyBindingFunc
static void KeyBindingFunc(void *self)
Definition: menu.c:732
Menu_SlideItem
void Menu_SlideItem(menuframework_s *s, int dir)
Definition: qmenu.c:511
LookspringFunc
static void LookspringFunc(void *unused)
Definition: menu.c:1149
K_AUX20
#define K_AUX20
Definition: keys.h:117
Cvar_Set
cvar_t * Cvar_Set(char *var_name, char *value)
Definition: cvar.c:278
Default_MenuKey
const char * Default_MenuKey(menuframework_s *m, int key)
Definition: menu.c:148
netadr_t
Definition: qcommon.h:551
s_downloadoptions_menu
static menuframework_s s_downloadoptions_menu
Definition: menu.c:3175
K_AUX19
#define K_AUX19
Definition: keys.h:116
s_allow_download_sounds_box
static menulist_s s_allow_download_sounds_box
Definition: menu.c:3182
s_options_cdvolume_box
static menulist_s s_options_cdvolume_box
Definition: menu.c:1059
MTYPE_FIELD
#define MTYPE_FIELD
Definition: qmenu.h:30
DMFlagCallback
static void DMFlagCallback(void *self)
Definition: menu.c:2799
LoadGame_MenuKey
const char * LoadGame_MenuKey(int key)
Definition: menu.c:2123
Game_MenuKey
const char * Game_MenuKey(int key)
Definition: menu.c:2025
DF_MODELTEAMS
#define DF_MODELTEAMS
Definition: q_shared.h:1031
m_main_cursor
static int m_main_cursor
Definition: menu.c:30
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:437
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:205
NUM_ADDRESSBOOK_ENTRIES
#define NUM_ADDRESSBOOK_ENTRIES
Definition: menu.c:3306
m_keyfunc
const char *(* m_keyfunc)(int key)
Definition: menu.c:64
refdef_t::width
int width
Definition: ref.h:104
s_keys_turn_left_action
static menuaction_s s_keys_turn_left_action
Definition: menu.c:629
s_multiplayer_menu
static menuframework_s s_multiplayer_menu
Definition: menu.c:506
m_entersound
qboolean m_entersound
Definition: menu.c:60
K_KP_DOWNARROW
#define K_KP_DOWNARROW
Definition: keys.h:68
refexport_t::DrawChar
void(* DrawChar)(int x, int y, int c)
Definition: ref.h:169
s_timelimit_field
static menufield_s s_timelimit_field
Definition: menu.c:2397
S_StartLocalSound
void S_StartLocalSound(char *sound)
Definition: snd_dma.c:738
s_allow_download_box
static menulist_s s_allow_download_box
Definition: menu.c:3178
s_player_config_menu
static menuframework_s s_player_config_menu
Definition: menu.c:3379
K_ESCAPE
#define K_ESCAPE
Definition: keys.h:27
DF_NO_SPHERES
#define DF_NO_SPHERES
Definition: q_shared.h:1048
K_TAB
#define K_TAB
Definition: keys.h:25
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
menuseparator_s::generic
menucommon_s generic
Definition: qmenu.h:120
SaveGameFunc
static void SaveGameFunc(void *unused)
Definition: menu.c:1947
JoinServer_MenuKey
const char * JoinServer_MenuKey(int key)
Definition: menu.c:2372
SFF_HIDDEN
#define SFF_HIDDEN
Definition: q_shared.h:287
K_AUX9
#define K_AUX9
Definition: keys.h:106
CL_Quit_f
void CL_Quit_f(void)
Definition: cl_main.c:386
K_AUX13
#define K_AUX13
Definition: keys.h:110
dmflags
cvar_t * dmflags
Definition: g_main.c:37
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
s_keys_inv_drop_action
static menuaction_s s_keys_inv_drop_action
Definition: menu.c:644
refdef_t::entities
entity_t * entities
Definition: ref.h:117
refdef_t::x
int x
Definition: ref.h:104
s_allow_download_players_box
static menulist_s s_allow_download_players_box
Definition: menu.c:3181
M_Menu_Quit_f
void M_Menu_Quit_f(void)
Definition: menu.c:3957
cls
client_static_t cls
Definition: cl_main.c:90
Key_ClearStates
void Key_ClearStates(void)
Definition: keys.c:935
IconOfSkinExists
static qboolean IconOfSkinExists(char *skin, char **pcxfiles, int npcxfiles)
Definition: menu.c:3447
fraglimit
cvar_t * fraglimit
Definition: g_main.c:39
PlayerSetupFunc
static void PlayerSetupFunc(void *unused)
Definition: menu.c:519
LoadGame_MenuDraw
void LoadGame_MenuDraw(void)
Definition: menu.c:2116
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
K_UPARROW
#define K_UPARROW
Definition: keys.h:33
keybindings
char * keybindings[256]
Definition: keys.c:40
hand
cvar_t * hand
Definition: cl_main.c:84
s_keys_center_view_action
static menuaction_s s_keys_center_view_action
Definition: menu.c:637
s_keys_menu
static menuframework_s s_keys_menu
Definition: menu.c:622
s_savegame_menu
static menuframework_s s_savegame_menu
Definition: menu.c:2047
menulist_s::generic
menucommon_s generic
Definition: qmenu.h:106
playermodelinfo_s
Definition: menu.c:3394
M_Menu_Game_f
void M_Menu_Game_f(void)
Definition: menu.c:2030
MTYPE_SEPARATOR
#define MTYPE_SEPARATOR
Definition: qmenu.h:29
Menu_AddItem
void Menu_AddItem(menuframework_s *menu, void *item)
Definition: qmenu.c:266
s_keys_inventory_action
static menuaction_s s_keys_inventory_action
Definition: menu.c:642
AddressBook_MenuDraw
void AddressBook_MenuDraw(void)
Definition: menu.c:3360
M_DrawCharacter
void M_DrawCharacter(int cx, int cy, int num)
Definition: menu.c:275
s_no_spheres_box
static menulist_s s_no_spheres_box
Definition: menu.c:2796
cl
client_state_t cl
Definition: cl_main.c:91
s_blankline
static menuseparator_s s_blankline
Definition: menu.c:1908
PlayerConfig_MenuInit
qboolean PlayerConfig_MenuInit(void)
Definition: menu.c:3629
s_fraglimit_field
static menufield_s s_fraglimit_field
Definition: menu.c:2398
K_AUX12
#define K_AUX12
Definition: keys.h:109
s_player_download_action
static menuaction_s s_player_download_action
Definition: menu.c:3389
K_AUX3
#define K_AUX3
Definition: keys.h:100
menucommon_s::parent
menuframework_s * parent
Definition: qmenu.h:69
DF_NO_ARMOR
#define DF_NO_ARMOR
Definition: q_shared.h:1035
s_load_game_action
static menuaction_s s_load_game_action
Definition: menu.c:1905
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:289
max
#define max(a, b)
Definition: vk_local.h:75
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
SaveGame_MenuKey
const char * SaveGame_MenuKey(int key)
Definition: menu.c:2193
s_spawn_farthest_box
static menulist_s s_spawn_farthest_box
Definition: menu.c:2782
SearchLocalGamesFunc
void SearchLocalGamesFunc(void *self)
Definition: menu.c:2297
menufield_s::buffer
char buffer[80]
Definition: qmenu.h:86
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
M_Main_Key
const char * M_Main_Key(int key)
Definition: menu.c:440
Options_MenuKey
const char * Options_MenuKey(int key)
Definition: menu.c:1395
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:164
K_KP_LEFTARROW
#define K_KP_LEFTARROW
Definition: keys.h:64
s_addressbook_fields
static menufield_s s_addressbook_fields[NUM_ADDRESSBOOK_ENTRIES]
Definition: menu.c:3309
client.h
s_options_quality_list
static menulist_s s_options_quality_list
Definition: menu.c:1060
M_Menu_Options_f
void M_Menu_Options_f(void)
Definition: menu.c:1400
entity_s::angles
float angles[3]
Definition: ref.h:52
K_AUX4
#define K_AUX4
Definition: keys.h:101
s_keys_inv_prev_action
static menuaction_s s_keys_inv_prev_action
Definition: menu.c:645
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:290
s_player_model_box
static menulist_s s_player_model_box
Definition: menu.c:3381
M_UnbindCommand
static void M_UnbindCommand(char *command)
Definition: menu.c:650
void
void(APIENTRY *qglAccum)(GLenum op
count
GLint GLsizei count
Definition: qgl_win.c:128
M_DrawPic
void M_DrawPic(int x, int y, char *pic)
Definition: menu.c:300
MAX_PLAYERMODELS
#define MAX_PLAYERMODELS
Definition: menu.c:3392
DF_NO_FRIENDLY_FIRE
#define DF_NO_FRIENDLY_FIRE
Definition: q_shared.h:1032
QMF_NUMBERSONLY
#define QMF_NUMBERSONLY
Definition: qmenu.h:47
update_sound_quality
static qboolean update_sound_quality
Definition: menu.c:32
JoinServer_MenuInit
void JoinServer_MenuInit(void)
Definition: menu.c:2302
s_easy_game_action
static menuaction_s s_easy_game_action
Definition: menu.c:1902
s_player_rate_box
static menulist_s s_player_rate_box
Definition: menu.c:3384
local_server_names
static char local_server_names[MAX_LOCAL_SERVERS][80]
Definition: menu.c:2234
client_static_t::realtime
int realtime
Definition: client.h:208
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
M_Draw
void M_Draw(void)
Definition: menu.c:3999
VID_MenuKey
const char * VID_MenuKey(int key)
Definition: vid_menu.c:679