icculus quake2 doxygen  1.0 dev
menu.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 #include <ctype.h>
21 #ifdef _WIN32
22 #include <io.h>
23 #endif
24 #include "client.h"
25 #include "../client/qmenu.h"
26 
27 static int m_main_cursor;
28 
29 #define NUM_CURSOR_FRAMES 15
30 
31 static char *menu_in_sound = "misc/menu1.wav";
32 static char *menu_move_sound = "misc/menu2.wav";
33 static char *menu_out_sound = "misc/menu3.wav";
34 
35 void M_Menu_Main_f (void);
36  void M_Menu_Game_f (void);
37  void M_Menu_LoadGame_f (void);
38  void M_Menu_SaveGame_f (void);
39  void M_Menu_PlayerConfig_f (void);
40  void M_Menu_DownloadOptions_f (void);
41  void M_Menu_Credits_f( void );
42  void M_Menu_Multiplayer_f( void );
43  void M_Menu_JoinServer_f (void);
44  void M_Menu_AddressBook_f( void );
45  void M_Menu_StartServer_f (void);
46  void M_Menu_DMOptions_f (void);
47  void M_Menu_Video_f (void);
48  void M_Menu_Options_f (void);
49  void M_Menu_Keys_f (void);
50  void M_Menu_Quit_f (void);
51 
52  void M_Menu_Credits( void );
53 
54 qboolean m_entersound; // play after drawing a frame, so caching
55  // won't disrupt the sound
56 
58 const char *(*m_keyfunc) (int key);
59 
60 //=============================================================================
61 /* Support Routines */
62 
63 #define MAX_MENU_DEPTH 8
64 
65 
66 typedef struct
67 {
68  void (*draw) (void);
69  const char *(*key) (int k);
70 } menulayer_t;
71 
74 
75 static void M_Banner( char *name )
76 {
77  int w, h;
78 
79  re.DrawGetPicSize (&w, &h, name );
80  re.DrawPic( viddef.width / 2 - w / 2, viddef.height / 2 - 110, name );
81 }
82 
83 void M_PushMenu ( void (*draw) (void), const char *(*key) (int k) )
84 {
85  int i;
86 
87  if (Cvar_VariableValue ("maxclients") == 1
88  && Com_ServerState ())
89  Cvar_Set ("paused", "1");
90 
91  // if this menu is already present, drop back to that level
92  // to avoid stacking menus by hotkeys
93  for (i=0 ; i<m_menudepth ; i++)
94  if (m_layers[i].draw == draw &&
95  m_layers[i].key == key)
96  {
97  m_menudepth = i;
98  }
99 
100  if (i == m_menudepth)
101  {
103  Com_Error (ERR_FATAL, "M_PushMenu: MAX_MENU_DEPTH");
106  m_menudepth++;
107  }
108 
109  m_drawfunc = draw;
110  m_keyfunc = key;
111 
112  m_entersound = true;
113 
115 }
116 
117 void M_ForceMenuOff (void)
118 {
119  m_drawfunc = 0;
120  m_keyfunc = 0;
122  m_menudepth = 0;
123  Key_ClearStates ();
124  Cvar_Set ("paused", "0");
125 }
126 
127 void M_PopMenu (void)
128 {
130  if (m_menudepth < 1)
131  Com_Error (ERR_FATAL, "M_PopMenu: depth < 1");
132  m_menudepth--;
133 
136 
137  if (!m_menudepth)
138  M_ForceMenuOff ();
139 }
140 
141 
142 const char *Default_MenuKey( menuframework_s *m, int key )
143 {
144  const char *sound = NULL;
145  menucommon_s *item;
146 
147  if ( m )
148  {
149  if ( ( item = Menu_ItemAtCursor( m ) ) != 0 )
150  {
151  if ( item->type == MTYPE_FIELD )
152  {
153  if ( Field_Key( ( menufield_s * ) item, key ) )
154  return NULL;
155  }
156  }
157  }
158 
159  switch ( key )
160  {
161  case K_ESCAPE:
162  M_PopMenu();
163  return menu_out_sound;
164  case K_KP_UPARROW:
165  case K_UPARROW:
166  if ( m )
167  {
168  m->cursor--;
169  Menu_AdjustCursor( m, -1 );
170  sound = menu_move_sound;
171  }
172  break;
173  case K_TAB:
174  if ( m )
175  {
176  m->cursor++;
177  Menu_AdjustCursor( m, 1 );
178  sound = menu_move_sound;
179  }
180  break;
181  case K_KP_DOWNARROW:
182  case K_DOWNARROW:
183  if ( m )
184  {
185  m->cursor++;
186  Menu_AdjustCursor( m, 1 );
187  sound = menu_move_sound;
188  }
189  break;
190  case K_KP_LEFTARROW:
191  case K_LEFTARROW:
192  if ( m )
193  {
194  Menu_SlideItem( m, -1 );
195  sound = menu_move_sound;
196  }
197  break;
198  case K_KP_RIGHTARROW:
199  case K_RIGHTARROW:
200  if ( m )
201  {
202  Menu_SlideItem( m, 1 );
203  sound = menu_move_sound;
204  }
205  break;
206 
207  case K_MOUSE1:
208  case K_MOUSE2:
209  case K_MOUSE3:
210  case K_MOUSE4:
211  case K_MOUSE5:
212  case K_JOY1:
213  case K_JOY2:
214  case K_JOY3:
215  case K_JOY4:
216  case K_AUX1:
217  case K_AUX2:
218  case K_AUX3:
219  case K_AUX4:
220  case K_AUX5:
221  case K_AUX6:
222  case K_AUX7:
223  case K_AUX8:
224  case K_AUX9:
225  case K_AUX10:
226  case K_AUX11:
227  case K_AUX12:
228  case K_AUX13:
229  case K_AUX14:
230  case K_AUX15:
231  case K_AUX16:
232  case K_AUX17:
233  case K_AUX18:
234  case K_AUX19:
235  case K_AUX20:
236  case K_AUX21:
237  case K_AUX22:
238  case K_AUX23:
239  case K_AUX24:
240  case K_AUX25:
241  case K_AUX26:
242  case K_AUX27:
243  case K_AUX28:
244  case K_AUX29:
245  case K_AUX30:
246  case K_AUX31:
247  case K_AUX32:
248 
249  case K_KP_ENTER:
250  case K_ENTER:
251  if ( m )
252  Menu_SelectItem( m );
253  sound = menu_move_sound;
254  break;
255  }
256 
257  return sound;
258 }
259 
260 //=============================================================================
261 
262 /*
263 ================
264 M_DrawCharacter
265 
266 Draws one solid graphics character
267 cx and cy are in 320*240 coordinates, and will be centered on
268 higher res screens.
269 ================
270 */
271 void M_DrawCharacter (int cx, int cy, int num)
272 {
273 #ifdef QMAX
274  re.DrawChar ( cx + ((viddef.width - 320)>>1), cy + ((viddef.height - 240)>>1), num, 1);
275 #else
276  re.DrawChar ( cx + ((viddef.width - 320)>>1), cy + ((viddef.height - 240)>>1), num);
277 #endif
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;
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;
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;
349  M_DrawCharacter (cx, cy, 4);
350  }
351  M_DrawCharacter (cx, cy+8, 7);
352 
353  // draw middle
354  cx += 8;
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;
362  M_DrawCharacter (cx, cy, 5);
363  }
364  M_DrawCharacter (cx, cy+8, 8);
365  width -= 1;
366  cx += 8;
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;
375  M_DrawCharacter (cx, cy, 6);
376  }
377  M_DrawCharacter (cx, cy+8, 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 );
420  xoffset = ( viddef.width - widest + 70 ) / 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, names[i] );
426  }
427  strcpy( litname, names[m_main_cursor] );
428  strcat( litname, "_sel" );
429  re.DrawPic( xoffset, ystart + m_main_cursor * 40 + 13, litname );
430 
431  M_DrawCursor( xoffset - 25, ystart + m_main_cursor * 40 + 11, (int)(cls.realtime / 100)%NUM_CURSOR_FRAMES );
432 
433  re.DrawGetPicSize( &w, &h, "m_main_plaque" );
434  re.DrawPic( xoffset - 30 - w, ystart, "m_main_plaque" );
435 
436  re.DrawPic( xoffset - 30 - w, ystart + h + 5, "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 {
536  s_multiplayer_menu.x = viddef.width * 0.50 - 64;
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", "previous weapon"},
592 {"+forward", "walk forward"},
593 {"+back", "backpedal"},
594 {"+left", "turn left"},
595 {"+right", "turn right"},
596 {"+speed", "run"},
597 {"+moveleft", "step left"},
598 {"+moveright", "step right"},
599 {"+strafe", "sidestep"},
600 {"+lookup", "look up"},
601 {"+lookdown", "look down"},
602 {"centerview", "center view"},
603 {"+mlook", "mouse look"},
604 {"+klook", "keyboard look"},
605 {"+moveup", "up / jump"},
606 {"+movedown", "down / crouch"},
607 
608 {"inven", "inventory"},
609 {"invuse", "use item"},
610 {"invdrop", "drop item"},
611 {"invprev", "prev item"},
612 {"invnext", "next item"},
613 
614 {"cmd help", "help computer" },
615 { 0, 0 }
616 };
617 
619 static int bind_grab;
620 
644 
646 
647 static void M_UnbindCommand (char *command)
648 {
649  int j;
650  int l;
651  char *b;
652 
653  l = strlen(command);
654 
655  for (j=0 ; j<256 ; j++)
656  {
657  b = keybindings[j];
658  if (!b)
659  continue;
660  if (!strncmp (b, command, l) )
661  Key_SetBinding (j, "");
662  }
663 }
664 
665 static void M_FindKeysForCommand (char *command, int *twokeys)
666 {
667  int count;
668  int j;
669  int l;
670  char *b;
671 
672  twokeys[0] = twokeys[1] = -1;
673  l = strlen(command);
674  count = 0;
675 
676  for (j=0 ; j<256 ; j++)
677  {
678  b = keybindings[j];
679  if (!b)
680  continue;
681  if (!strncmp (b, command, l) )
682  {
683  twokeys[count] = j;
684  count++;
685  if (count == 2)
686  break;
687  }
688  }
689 }
690 
691 static void KeyCursorDrawFunc( menuframework_s *menu )
692 {
693 #ifdef QMAX
694  if ( bind_grab )
695  re.DrawChar( menu->x, menu->y + menu->cursor * 9, '=' , 1);
696  else
697  re.DrawChar( menu->x, menu->y + menu->cursor * 9, 12 + ( ( int ) ( Sys_Milliseconds() / 250 ) & 1 ) , 1);
698 #else
699  if ( bind_grab )
700  re.DrawChar( menu->x, menu->y + menu->cursor * 9, '=' );
701  else
702  re.DrawChar( menu->x, menu->y + menu->cursor * 9, 12 + ( ( int ) ( Sys_Milliseconds() / 250 ) & 1 ) );
703 #endif
704 }
705 
706 static void DrawKeyBindingFunc( void *self )
707 {
708  int keys[2];
709  menuaction_s *a = ( menuaction_s * ) self;
710 
712 
713  if (keys[0] == -1)
714  {
715  Menu_DrawString( a->generic.x + a->generic.parent->x + 16, a->generic.y + a->generic.parent->y, "???" );
716  }
717  else
718  {
719  int x;
720  const char *name;
721 
722  name = Key_KeynumToString (keys[0]);
723 
724  Menu_DrawString( a->generic.x + a->generic.parent->x + 16, a->generic.y + a->generic.parent->y, name );
725 
726  x = strlen(name) * 8;
727 
728  if (keys[1] != -1)
729  {
730  Menu_DrawString( a->generic.x + a->generic.parent->x + 24 + x, a->generic.y + a->generic.parent->y, "or" );
731  Menu_DrawString( a->generic.x + a->generic.parent->x + 48 + x, a->generic.y + a->generic.parent->y, Key_KeynumToString (keys[1]) );
732  }
733  }
734 }
735 
736 static void KeyBindingFunc( void *self )
737 {
738  menuaction_s *a = ( menuaction_s * ) self;
739  int keys[2];
740 
741  M_FindKeysForCommand( bindnames[a->generic.localdata[0]][0], keys );
742 
743  if (keys[1] != -1)
745 
746  bind_grab = true;
747 
748  Menu_SetStatusBar( &s_keys_menu, "press a key or button for this action" );
749 }
750 
751 static void Keys_MenuInit( void )
752 {
753  int y = 0;
754  int i = 0;
755 
756  s_keys_menu.x = viddef.width * 0.50;
757  s_keys_menu.nitems = 0;
759 
767 
775 
783 
791 
799 
807 
811  s_keys_run_action.generic.y = y += 9;
815 
823 
831 
839 
847 
855 
863 
871 
879 
887 
895 
903 
911 
919 
927 
935 
943 
950  Menu_AddItem( &s_keys_menu, ( void * ) &s_keys_run_action );
961 
967 
969 
970  Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
972 }
973 
974 static void Keys_MenuDraw (void)
975 {
978 }
979 
980 static const char *Keys_MenuKey( int key )
981 {
983 
984  if ( bind_grab )
985  {
986  if ( key != K_ESCAPE && key != '`' )
987  {
988  char cmd[1024];
989 
990  Com_sprintf (cmd, sizeof(cmd), "bind \"%s\" \"%s\"\n", Key_KeynumToString(key), bindnames[item->generic.localdata[0]][0]);
991  Cbuf_InsertText (cmd);
992  }
993 
994  Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
995  bind_grab = false;
996  return menu_out_sound;
997  }
998 
999  switch ( key )
1000  {
1001  case K_KP_ENTER:
1002  case K_ENTER:
1003  KeyBindingFunc( item );
1004  return menu_in_sound;
1005  case K_BACKSPACE: // delete bindings
1006  case K_DEL: // delete bindings
1007  case K_KP_DEL:
1008  M_UnbindCommand( bindnames[item->generic.localdata[0]][0] );
1009  return menu_out_sound;
1010  default:
1011  return Default_MenuKey( &s_keys_menu, key );
1012  }
1013 }
1014 
1015 void M_Menu_Keys_f (void)
1016 {
1017  Keys_MenuInit();
1019 }
1020 
1021 
1022 /*
1023 =======================================================================
1024 
1025 CONTROLS MENU
1026 
1027 =======================================================================
1028 */
1030 extern cvar_t *in_joystick;
1031 
1050 
1051 static void CrosshairFunc( void *unused )
1052 {
1054 }
1055 
1056 static void JoystickFunc( void *unused )
1057 {
1058  Cvar_SetValue( "in_joystick", s_options_joystick_box.curvalue );
1059 }
1060 
1061 static void CustomizeControlsFunc( void *unused )
1062 {
1063  M_Menu_Keys_f();
1064 }
1065 
1066 static void AlwaysRunFunc( void *unused )
1067 {
1069 }
1070 
1071 static void FreeLookFunc( void *unused )
1072 {
1074 }
1075 
1076 static void MouseSpeedFunc( void *unused )
1077 {
1078  Cvar_SetValue( "sensitivity", s_options_sensitivity_slider.curvalue / 2.0F );
1079 }
1080 
1081 #if 0
1082 static void NoAltTabFunc( void *unused )
1083 {
1084  Cvar_SetValue( "win_noalttab", s_options_noalttab_box.curvalue );
1085 }
1086 #endif
1087 
1088 static float ClampCvar( float min, float max, float value )
1089 {
1090  if ( value < min ) return min;
1091  if ( value > max ) return max;
1092  return value;
1093 }
1094 
1095 static void ControlsSetMenuItemValues( void )
1096 {
1099 
1101 
1102  s_options_quality_list.curvalue = !Cvar_VariableValue( "s_loadas8bit" );
1104 
1105  Cvar_SetValue( "cl_run", ClampCvar( 0, 1, cl_run->value ) );
1107 
1109 
1110  Cvar_SetValue( "lookspring", ClampCvar( 0, 1, lookspring->value ) );
1112 
1113  Cvar_SetValue( "lookstrafe", ClampCvar( 0, 1, lookstrafe->value ) );
1115 
1116  Cvar_SetValue( "freelook", ClampCvar( 0, 1, freelook->value ) );
1118 
1119  Cvar_SetValue( "crosshair", ClampCvar( 0, 3, crosshair->value ) );
1121 
1122  Cvar_SetValue( "in_joystick", ClampCvar( 0, 1, in_joystick->value ) );
1124 
1126 }
1127 
1128 static void ControlsResetDefaultsFunc( void *unused )
1129 {
1130  Cbuf_AddText ("exec default.cfg\n");
1131  Cbuf_Execute();
1132 
1134 }
1135 
1136 static void InvertMouseFunc( void *unused )
1137 {
1138  Cvar_SetValue( "m_pitch", -m_pitch->value );
1139 }
1140 
1141 static void LookspringFunc( void *unused )
1142 {
1143  Cvar_SetValue( "lookspring", !lookspring->value );
1144 }
1145 
1146 static void LookstrafeFunc( void *unused )
1147 {
1148  Cvar_SetValue( "lookstrafe", !lookstrafe->value );
1149 }
1150 
1151 static void UpdateVolumeFunc( void *unused )
1152 {
1154 }
1155 
1156 static void CDShuffleFunc(void *unused)
1157 {
1159 }
1160 
1161 static void UpdateCDVolumeFunc( void *unused )
1162 {
1165  {
1166  CDAudio_Init();
1168  {
1170  }
1171  else
1172  {
1173  CDAudio_Play(atoi(cl.configstrings[CS_CDTRACK]), true);
1174  }
1175  }
1176  else
1177  {
1178  CDAudio_Stop();
1179  }
1180 }
1181 
1182 static void ConsoleFunc( void *unused )
1183 {
1184  /*
1185  ** the proper way to do this is probably to have ToggleConsole_f accept a parameter
1186  */
1187  extern void Key_ClearTyping( void );
1188 
1189  if ( cl.attractloop )
1190  {
1191  Cbuf_AddText ("killserver\n");
1192  return;
1193  }
1194 
1195  Key_ClearTyping ();
1196  Con_ClearNotify ();
1197 
1198  M_ForceMenuOff ();
1200 }
1201 
1202 static void UpdateSoundQualityFunc( void *unused )
1203 {
1205  {
1206  Cvar_SetValue( "s_khz", 22 );
1207  Cvar_SetValue( "s_loadas8bit", false );
1208  }
1209  else
1210  {
1211  Cvar_SetValue( "s_khz", 11 );
1212  Cvar_SetValue( "s_loadas8bit", true );
1213  }
1214 
1216 
1217  M_DrawTextBox( 8, 120 - 48, 36, 3 );
1218  M_Print( 16 + 16, 120 - 48 + 8, "Restarting the sound system. This" );
1219  M_Print( 16 + 16, 120 - 48 + 16, "could take up to a minute, so" );
1220  M_Print( 16 + 16, 120 - 48 + 24, "please be patient." );
1221 
1222  // the text box won't show up unless we do a buffer swap
1223  re.EndFrame();
1224 
1225  CL_Snd_Restart_f();
1226 }
1227 
1228 void Options_MenuInit( void )
1229 {
1230  static const char *cd_music_items[] =
1231  {
1232  "disabled",
1233  "enabled",
1234  0
1235  };
1236 
1237  static const char *cd_shuffle[] =
1238  {
1239  "disabled",
1240  "enabled",
1241  0
1242  };
1243 
1244  static const char *quality_items[] =
1245  {
1246  "low", "high", 0
1247  };
1248 
1249  static const char *compatibility_items[] =
1250  {
1251  "max compatibility", "max performance", 0
1252  };
1253 
1254  static const char *yesno_names[] =
1255  {
1256  "no",
1257  "yes",
1258  0
1259  };
1260 
1261  static const char *crosshair_names[] =
1262  {
1263  "none",
1264  "cross",
1265  "dot",
1266  "angle",
1267  0
1268  };
1269 
1270  win_noalttab = Cvar_Get( "win_noalttab", "0", CVAR_ARCHIVE );
1271 
1272  /*
1273  ** configure controls menu and menu items
1274  */
1275  s_options_menu.x = viddef.width / 2;
1276  s_options_menu.y = viddef.height / 2 - 58;
1277  s_options_menu.nitems = 0;
1278 
1282  s_options_sfxvolume_slider.generic.name = "effects volume";
1287 
1291  s_options_cdvolume_box.generic.name = "CD music";
1293  s_options_cdvolume_box.itemnames = cd_music_items;
1295 
1299  s_options_cdshuffle_box.generic.name = "CD shuffle";
1301  s_options_cdshuffle_box.itemnames = cd_shuffle;
1303 
1307  s_options_quality_list.generic.name = "sound quality";
1309  s_options_quality_list.itemnames = quality_items;
1310  s_options_quality_list.curvalue = !Cvar_VariableValue( "s_loadas8bit" );
1311 
1315  s_options_compatibility_list.generic.name = "sound compatibility";
1317  s_options_compatibility_list.itemnames = compatibility_items;
1319 
1323  s_options_sensitivity_slider.generic.name = "mouse speed";
1327 
1331  s_options_alwaysrun_box.generic.name = "always run";
1333  s_options_alwaysrun_box.itemnames = yesno_names;
1334 
1338  s_options_invertmouse_box.generic.name = "invert mouse";
1340  s_options_invertmouse_box.itemnames = yesno_names;
1341 
1345  s_options_lookspring_box.generic.name = "lookspring";
1347  s_options_lookspring_box.itemnames = yesno_names;
1348 
1352  s_options_lookstrafe_box.generic.name = "lookstrafe";
1354  s_options_lookstrafe_box.itemnames = yesno_names;
1355 
1359  s_options_freelook_box.generic.name = "free look";
1361  s_options_freelook_box.itemnames = yesno_names;
1362 
1366  s_options_crosshair_box.generic.name = "crosshair";
1368  s_options_crosshair_box.itemnames = crosshair_names;
1369 #if 0
1373  s_options_noalttab_box.generic.name = "disable alt-tab";
1374  s_options_noalttab_box.generic.callback = NoAltTabFunc;
1375  s_options_noalttab_box.itemnames = yesno_names;
1376 #endif
1380  s_options_joystick_box.generic.name = "use joystick";
1382  s_options_joystick_box.itemnames = yesno_names;
1383 
1387  s_options_customize_options_action.generic.name = "customize controls";
1389 
1393  s_options_defaults_action.generic.name = "reset defaults";
1395 
1399  s_options_console_action.generic.name = "go to console";
1401 
1403 
1420 }
1421 
1422 void Options_MenuDraw (void)
1423 {
1424  M_Banner( "m_banner_options" );
1427 }
1428 
1429 const char *Options_MenuKey( int key )
1430 {
1431  return Default_MenuKey( &s_options_menu, key );
1432 }
1433 
1434 void M_Menu_Options_f (void)
1435 {
1436  Options_MenuInit();
1438 }
1439 
1440 /*
1441 =======================================================================
1442 
1443 VIDEO MENU
1444 
1445 =======================================================================
1446 */
1447 
1448 void M_Menu_Video_f (void)
1449 {
1450  VID_MenuInit();
1452 }
1453 
1454 /*
1455 =============================================================================
1456 
1457 END GAME MENU
1458 
1459 =============================================================================
1460 */
1462 static const char **credits;
1463 static char *creditsIndex[256];
1464 static char *creditsBuffer;
1465 static const char *idcredits[] =
1466 {
1467  "+QUAKE II BY ID SOFTWARE",
1468  "",
1469  "+PROGRAMMING",
1470  "John Carmack",
1471  "John Cash",
1472  "Brian Hook",
1473  "",
1474  "+ART",
1475  "Adrian Carmack",
1476  "Kevin Cloud",
1477  "Paul Steed",
1478  "",
1479  "+LEVEL DESIGN",
1480  "Tim Willits",
1481  "American McGee",
1482  "Christian Antkow",
1483  "Paul Jaquays",
1484  "Brandon James",
1485  "",
1486  "+BIZ",
1487  "Todd Hollenshead",
1488  "Barrett (Bear) Alexander",
1489  "Donna Jackson",
1490  "",
1491  "",
1492  "+SPECIAL THANKS",
1493  "Ben Donges for beta testing",
1494  "",
1495  "",
1496  "",
1497  "",
1498  "",
1499  "",
1500  "+ADDITIONAL SUPPORT",
1501  "",
1502  "+LINUX PORT AND CTF",
1503  "Dave \"Zoid\" Kirsch",
1504  "",
1505  "+CINEMATIC SEQUENCES",
1506  "Ending Cinematic by Blur Studio - ",
1507  "Venice, CA",
1508  "",
1509  "Environment models for Introduction",
1510  "Cinematic by Karl Dolgener",
1511  "",
1512  "Assistance with environment design",
1513  "by Cliff Iwai",
1514  "",
1515  "+SOUND EFFECTS AND MUSIC",
1516  "Sound Design by Soundelux Media Labs.",
1517  "Music Composed and Produced by",
1518  "Soundelux Media Labs. Special thanks",
1519  "to Bill Brown, Tom Ozanich, Brian",
1520  "Celano, Jeff Eisner, and The Soundelux",
1521  "Players.",
1522  "",
1523  "\"Level Music\" by Sonic Mayhem",
1524  "www.sonicmayhem.com",
1525  "",
1526  "\"Quake II Theme Song\"",
1527  "(C) 1997 Rob Zombie. All Rights",
1528  "Reserved.",
1529  "",
1530  "Track 10 (\"Climb\") by Jer Sypult",
1531  "",
1532  "Voice of computers by",
1533  "Carly Staehlin-Taylor",
1534  "",
1535  "+THANKS TO ACTIVISION",
1536  "+IN PARTICULAR:",
1537  "",
1538  "John Tam",
1539  "Steve Rosenthal",
1540  "Marty Stratton",
1541  "Henk Hartong",
1542  "",
1543  "Quake II(tm) (C)1997 Id Software, Inc.",
1544  "All Rights Reserved. Distributed by",
1545  "Activision, Inc. under license.",
1546  "Quake II(tm), the Id Software name,",
1547  "the \"Q II\"(tm) logo and id(tm)",
1548  "logo are trademarks of Id Software,",
1549  "Inc. Activision(R) is a registered",
1550  "trademark of Activision, Inc. All",
1551  "other trademarks and trade names are",
1552  "properties of their respective owners.",
1553  0
1554 };
1555 
1556 static const char *xatcredits[] =
1557 {
1558  "+QUAKE II MISSION PACK: THE RECKONING",
1559  "+BY",
1560  "+XATRIX ENTERTAINMENT, INC.",
1561  "",
1562  "+DESIGN AND DIRECTION",
1563  "Drew Markham",
1564  "",
1565  "+PRODUCED BY",
1566  "Greg Goodrich",
1567  "",
1568  "+PROGRAMMING",
1569  "Rafael Paiz",
1570  "",
1571  "+LEVEL DESIGN / ADDITIONAL GAME DESIGN",
1572  "Alex Mayberry",
1573  "",
1574  "+LEVEL DESIGN",
1575  "Mal Blackwell",
1576  "Dan Koppel",
1577  "",
1578  "+ART DIRECTION",
1579  "Michael \"Maxx\" Kaufman",
1580  "",
1581  "+COMPUTER GRAPHICS SUPERVISOR AND",
1582  "+CHARACTER ANIMATION DIRECTION",
1583  "Barry Dempsey",
1584  "",
1585  "+SENIOR ANIMATOR AND MODELER",
1586  "Jason Hoover",
1587  "",
1588  "+CHARACTER ANIMATION AND",
1589  "+MOTION CAPTURE SPECIALIST",
1590  "Amit Doron",
1591  "",
1592  "+ART",
1593  "Claire Praderie-Markham",
1594  "Viktor Antonov",
1595  "Corky Lehmkuhl",
1596  "",
1597  "+INTRODUCTION ANIMATION",
1598  "Dominique Drozdz",
1599  "",
1600  "+ADDITIONAL LEVEL DESIGN",
1601  "Aaron Barber",
1602  "Rhett Baldwin",
1603  "",
1604  "+3D CHARACTER ANIMATION TOOLS",
1605  "Gerry Tyra, SA Technology",
1606  "",
1607  "+ADDITIONAL EDITOR TOOL PROGRAMMING",
1608  "Robert Duffy",
1609  "",
1610  "+ADDITIONAL PROGRAMMING",
1611  "Ryan Feltrin",
1612  "",
1613  "+PRODUCTION COORDINATOR",
1614  "Victoria Sylvester",
1615  "",
1616  "+SOUND DESIGN",
1617  "Gary Bradfield",
1618  "",
1619  "+MUSIC BY",
1620  "Sonic Mayhem",
1621  "",
1622  "",
1623  "",
1624  "+SPECIAL THANKS",
1625  "+TO",
1626  "+OUR FRIENDS AT ID SOFTWARE",
1627  "",
1628  "John Carmack",
1629  "John Cash",
1630  "Brian Hook",
1631  "Adrian Carmack",
1632  "Kevin Cloud",
1633  "Paul Steed",
1634  "Tim Willits",
1635  "Christian Antkow",
1636  "Paul Jaquays",
1637  "Brandon James",
1638  "Todd Hollenshead",
1639  "Barrett (Bear) Alexander",
1640  "Dave \"Zoid\" Kirsch",
1641  "Donna Jackson",
1642  "",
1643  "",
1644  "",
1645  "+THANKS TO ACTIVISION",
1646  "+IN PARTICULAR:",
1647  "",
1648  "Marty Stratton",
1649  "Henk \"The Original Ripper\" Hartong",
1650  "Kevin Kraff",
1651  "Jamey Gottlieb",
1652  "Chris Hepburn",
1653  "",
1654  "+AND THE GAME TESTERS",
1655  "",
1656  "Tim Vanlaw",
1657  "Doug Jacobs",
1658  "Steven Rosenthal",
1659  "David Baker",
1660  "Chris Campbell",
1661  "Aaron Casillas",
1662  "Steve Elwell",
1663  "Derek Johnstone",
1664  "Igor Krinitskiy",
1665  "Samantha Lee",
1666  "Michael Spann",
1667  "Chris Toft",
1668  "Juan Valdes",
1669  "",
1670  "+THANKS TO INTERGRAPH COMPUTER SYTEMS",
1671  "+IN PARTICULAR:",
1672  "",
1673  "Michael T. Nicolaou",
1674  "",
1675  "",
1676  "Quake II Mission Pack: The Reckoning",
1677  "(tm) (C)1998 Id Software, Inc. All",
1678  "Rights Reserved. Developed by Xatrix",
1679  "Entertainment, Inc. for Id Software,",
1680  "Inc. Distributed by Activision Inc.",
1681  "under license. Quake(R) is a",
1682  "registered trademark of Id Software,",
1683  "Inc. Quake II Mission Pack: The",
1684  "Reckoning(tm), Quake II(tm), the Id",
1685  "Software name, the \"Q II\"(tm) logo",
1686  "and id(tm) logo are trademarks of Id",
1687  "Software, Inc. Activision(R) is a",
1688  "registered trademark of Activision,",
1689  "Inc. Xatrix(R) is a registered",
1690  "trademark of Xatrix Entertainment,",
1691  "Inc. All other trademarks and trade",
1692  "names are properties of their",
1693  "respective owners.",
1694  0
1695 };
1696 
1697 static const char *roguecredits[] =
1698 {
1699  "+QUAKE II MISSION PACK 2: GROUND ZERO",
1700  "+BY",
1701  "+ROGUE ENTERTAINMENT, INC.",
1702  "",
1703  "+PRODUCED BY",
1704  "Jim Molinets",
1705  "",
1706  "+PROGRAMMING",
1707  "Peter Mack",
1708  "Patrick Magruder",
1709  "",
1710  "+LEVEL DESIGN",
1711  "Jim Molinets",
1712  "Cameron Lamprecht",
1713  "Berenger Fish",
1714  "Robert Selitto",
1715  "Steve Tietze",
1716  "Steve Thoms",
1717  "",
1718  "+ART DIRECTION",
1719  "Rich Fleider",
1720  "",
1721  "+ART",
1722  "Rich Fleider",
1723  "Steve Maines",
1724  "Won Choi",
1725  "",
1726  "+ANIMATION SEQUENCES",
1727  "Creat Studios",
1728  "Steve Maines",
1729  "",
1730  "+ADDITIONAL LEVEL DESIGN",
1731  "Rich Fleider",
1732  "Steve Maines",
1733  "Peter Mack",
1734  "",
1735  "+SOUND",
1736  "James Grunke",
1737  "",
1738  "+GROUND ZERO THEME",
1739  "+AND",
1740  "+MUSIC BY",
1741  "Sonic Mayhem",
1742  "",
1743  "+VWEP MODELS",
1744  "Brent \"Hentai\" Dill",
1745  "",
1746  "",
1747  "",
1748  "+SPECIAL THANKS",
1749  "+TO",
1750  "+OUR FRIENDS AT ID SOFTWARE",
1751  "",
1752  "John Carmack",
1753  "John Cash",
1754  "Brian Hook",
1755  "Adrian Carmack",
1756  "Kevin Cloud",
1757  "Paul Steed",
1758  "Tim Willits",
1759  "Christian Antkow",
1760  "Paul Jaquays",
1761  "Brandon James",
1762  "Todd Hollenshead",
1763  "Barrett (Bear) Alexander",
1764  "Katherine Anna Kang",
1765  "Donna Jackson",
1766  "Dave \"Zoid\" Kirsch",
1767  "",
1768  "",
1769  "",
1770  "+THANKS TO ACTIVISION",
1771  "+IN PARTICULAR:",
1772  "",
1773  "Marty Stratton",
1774  "Henk Hartong",
1775  "Mitch Lasky",
1776  "Steve Rosenthal",
1777  "Steve Elwell",
1778  "",
1779  "+AND THE GAME TESTERS",
1780  "",
1781  "The Ranger Clan",
1782  "Dave \"Zoid\" Kirsch",
1783  "Nihilistic Software",
1784  "Robert Duffy",
1785  "",
1786  "And Countless Others",
1787  "",
1788  "",
1789  "",
1790  "Quake II Mission Pack 2: Ground Zero",
1791  "(tm) (C)1998 Id Software, Inc. All",
1792  "Rights Reserved. Developed by Rogue",
1793  "Entertainment, Inc. for Id Software,",
1794  "Inc. Distributed by Activision Inc.",
1795  "under license. Quake(R) is a",
1796  "registered trademark of Id Software,",
1797  "Inc. Quake II Mission Pack 2: Ground",
1798  "Zero(tm), Quake II(tm), the Id",
1799  "Software name, the \"Q II\"(tm) logo",
1800  "and id(tm) logo are trademarks of Id",
1801  "Software, Inc. Activision(R) is a",
1802  "registered trademark of Activision,",
1803  "Inc. Rogue(R) is a registered",
1804  "trademark of Rogue Entertainment,",
1805  "Inc. All other trademarks and trade",
1806  "names are properties of their",
1807  "respective owners.",
1808  0
1809 };
1810 
1811 
1813 {
1814  int i, y;
1815 
1816  /*
1817  ** draw the credits
1818  */
1819  for ( i = 0, y = viddef.height - ( ( cls.realtime - credits_start_time ) / 40.0F ); credits[i] && y < viddef.height; y += 10, i++ )
1820  {
1821  int j, stringoffset = 0;
1822  int bold = false;
1823 
1824  if ( y <= -8 )
1825  continue;
1826 
1827  if ( credits[i][0] == '+' )
1828  {
1829  bold = true;
1830  stringoffset = 1;
1831  }
1832  else
1833  {
1834  bold = false;
1835  stringoffset = 0;
1836  }
1837 
1838  for ( j = 0; credits[i][j+stringoffset]; j++ )
1839  {
1840  int x;
1841 
1842  x = ( viddef.width - strlen( credits[i] ) * 8 - stringoffset * 8 ) / 2 + ( j + stringoffset ) * 8;
1843 
1844  if ( bold )
1845 #ifdef QMAX
1846  re.DrawChar( x, y, credits[i][j+stringoffset] + 128,1);
1847 #else
1848  re.DrawChar( x, y, credits[i][j+stringoffset] + 128 );
1849 #endif
1850  else
1851 #ifdef QMAX
1852  re.DrawChar( x, y, credits[i][j+stringoffset],1);
1853 #else
1854  re.DrawChar( x, y, credits[i][j+stringoffset]);
1855 #endif
1856  }
1857  }
1858 
1859  if ( y < 0 )
1861 }
1862 
1863 const char *M_Credits_Key( int key )
1864 {
1865  switch (key)
1866  {
1867  case K_ESCAPE:
1868  if (creditsBuffer)
1870  M_PopMenu ();
1871  break;
1872  }
1873 
1874  return menu_out_sound;
1875 
1876 }
1877 
1878 extern int Developer_searchpath (int who);
1879 
1880 void M_Menu_Credits_f( void )
1881 {
1882  int n;
1883  int count;
1884  char *p;
1885  int isdeveloper = 0;
1886 
1887  creditsBuffer = NULL;
1888  count = FS_LoadFile ("credits", (void **)&creditsBuffer);
1889  if (count != -1)
1890  {
1891  p = creditsBuffer;
1892  for (n = 0; n < 255; n++)
1893  {
1894  creditsIndex[n] = p;
1895  while (*p != '\r' && *p != '\n')
1896  {
1897  p++;
1898  if (--count == 0)
1899  break;
1900  }
1901  if (*p == '\r')
1902  {
1903  *p++ = 0;
1904  if (--count == 0)
1905  break;
1906  }
1907  *p++ = 0;
1908  if (--count == 0)
1909  break;
1910  }
1911  creditsIndex[++n] = 0;
1912  credits = (const char **)creditsIndex;
1913  }
1914  else
1915  {
1916  isdeveloper = Developer_searchpath (1);
1917 
1918  if (isdeveloper == 1) // xatrix
1919  credits = xatcredits;
1920  else if (isdeveloper == 2) // ROGUE
1922  else
1923  {
1924  credits = idcredits;
1925  }
1926 
1927  }
1928 
1931 }
1932 
1933 /*
1934 =============================================================================
1935 
1936 GAME MENU
1937 
1938 =============================================================================
1939 */
1940 
1941 static int m_game_cursor;
1942 
1951 
1952 static void StartGame( void )
1953 {
1954  // disable updates and start the cinematic going
1955  cl.servercount = -1;
1956  M_ForceMenuOff ();
1957  Cvar_SetValue( "deathmatch", 0 );
1958  Cvar_SetValue( "coop", 0 );
1959 
1960  Cvar_SetValue( "gamerules", 0 ); //PGM
1961 
1962  Cbuf_AddText ("loading ; killserver ; wait ; newgame\n");
1963  cls.key_dest = key_game;
1964 }
1965 
1966 static void EasyGameFunc( void *data )
1967 {
1968  Cvar_ForceSet( "skill", "0" );
1969  StartGame();
1970 }
1971 
1972 static void MediumGameFunc( void *data )
1973 {
1974  Cvar_ForceSet( "skill", "1" );
1975  StartGame();
1976 }
1977 
1978 static void HardGameFunc( void *data )
1979 {
1980  Cvar_ForceSet( "skill", "2" );
1981  StartGame();
1982 }
1983 
1984 static void LoadGameFunc( void *unused )
1985 {
1986  M_Menu_LoadGame_f ();
1987 }
1988 
1989 static void SaveGameFunc( void *unused )
1990 {
1992 }
1993 
1994 static void CreditsFunc( void *unused )
1995 {
1996  M_Menu_Credits_f();
1997 }
1998 
1999 void Game_MenuInit( void )
2000 {
2001  s_game_menu.x = viddef.width * 0.50;
2002  s_game_menu.nitems = 0;
2003 
2008  s_easy_game_action.generic.name = "easy";
2010 
2015  s_medium_game_action.generic.name = "medium";
2017 
2022  s_hard_game_action.generic.name = "hard";
2024 
2026 
2031  s_load_game_action.generic.name = "load game";
2033 
2038  s_save_game_action.generic.name = "save game";
2040 
2044  s_credits_action.generic.y = 60;
2045  s_credits_action.generic.name = "credits";
2047 
2048  Menu_AddItem( &s_game_menu, ( void * ) &s_easy_game_action );
2050  Menu_AddItem( &s_game_menu, ( void * ) &s_hard_game_action );
2051  Menu_AddItem( &s_game_menu, ( void * ) &s_blankline );
2052  Menu_AddItem( &s_game_menu, ( void * ) &s_load_game_action );
2053  Menu_AddItem( &s_game_menu, ( void * ) &s_save_game_action );
2054  Menu_AddItem( &s_game_menu, ( void * ) &s_blankline );
2055  Menu_AddItem( &s_game_menu, ( void * ) &s_credits_action );
2056 
2058 }
2059 
2060 void Game_MenuDraw( void )
2061 {
2062  M_Banner( "m_banner_game" );
2064  Menu_Draw( &s_game_menu );
2065 }
2066 
2067 const char *Game_MenuKey( int key )
2068 {
2069  return Default_MenuKey( &s_game_menu, key );
2070 }
2071 
2072 void M_Menu_Game_f (void)
2073 {
2074  Game_MenuInit();
2076  m_game_cursor = 1;
2077 }
2078 
2079 /*
2080 =============================================================================
2081 
2082 LOADGAME MENU
2083 
2084 =============================================================================
2085 */
2086 
2087 #define MAX_SAVEGAMES 15
2088 
2090 
2093 
2096 
2098 {
2099  int i;
2100  FILE *f;
2101  char name[MAX_OSPATH];
2102 
2103  for (i=0 ; i<MAX_SAVEGAMES ; i++)
2104  {
2105  Com_sprintf (name, sizeof(name), "%s/save/save%i/server.ssv", FS_Gamedir(), i);
2106  f = fopen (name, "rb");
2107  if (!f)
2108  {
2109  strcpy (m_savestrings[i], "<EMPTY>");
2110  m_savevalid[i] = false;
2111  }
2112  else
2113  {
2114  FS_Read (m_savestrings[i], sizeof(m_savestrings[i]), f);
2115  fclose (f);
2116  m_savevalid[i] = true;
2117  }
2118  }
2119 }
2120 
2121 void LoadGameCallback( void *self )
2122 {
2123  menuaction_s *a = ( menuaction_s * ) self;
2124 
2125  if ( m_savevalid[ a->generic.localdata[0] ] )
2126  Cbuf_AddText (va("load save%i\n", a->generic.localdata[0] ) );
2127  M_ForceMenuOff ();
2128 }
2129 
2130 void LoadGame_MenuInit( void )
2131 {
2132  int i;
2133 
2134  s_loadgame_menu.x = viddef.width / 2 - 120;
2135  s_loadgame_menu.y = viddef.height / 2 - 58;
2136  s_loadgame_menu.nitems = 0;
2137 
2139 
2140  for ( i = 0; i < MAX_SAVEGAMES; i++ )
2141  {
2146 
2148  s_loadgame_actions[i].generic.y = ( i ) * 10;
2149  if (i>0) // separate from autosave
2150  s_loadgame_actions[i].generic.y += 10;
2151 
2153 
2155  }
2156 }
2157 
2158 void LoadGame_MenuDraw( void )
2159 {
2160  M_Banner( "m_banner_load_game" );
2161 // Menu_AdjustCursor( &s_loadgame_menu, 1 );
2163 }
2164 
2165 const char *LoadGame_MenuKey( int key )
2166 {
2167  if ( key == K_ESCAPE || key == K_ENTER )
2168  {
2170  if ( s_savegame_menu.cursor < 0 )
2171  s_savegame_menu.cursor = 0;
2172  }
2173  return Default_MenuKey( &s_loadgame_menu, key );
2174 }
2175 
2177 {
2180 }
2181 
2182 
2183 /*
2184 =============================================================================
2185 
2186 SAVEGAME MENU
2187 
2188 =============================================================================
2189 */
2192 
2193 void SaveGameCallback( void *self )
2194 {
2195  menuaction_s *a = ( menuaction_s * ) self;
2196 
2197  Cbuf_AddText (va("save save%i\n", a->generic.localdata[0] ));
2198  M_ForceMenuOff ();
2199 }
2200 
2201 void SaveGame_MenuDraw( void )
2202 {
2203  M_Banner( "m_banner_save_game" );
2206 }
2207 
2208 void SaveGame_MenuInit( void )
2209 {
2210  int i;
2211 
2212  s_savegame_menu.x = viddef.width / 2 - 120;
2213  s_savegame_menu.y = viddef.height / 2 - 58;
2214  s_savegame_menu.nitems = 0;
2215 
2217 
2218  // don't include the autosave slot
2219  for ( i = 0; i < MAX_SAVEGAMES-1; i++ )
2220  {
2225 
2227  s_savegame_actions[i].generic.y = ( i ) * 10;
2228 
2230 
2232  }
2233 }
2234 
2235 const char *SaveGame_MenuKey( int key )
2236 {
2237  if ( key == K_ENTER || key == K_ESCAPE )
2238  {
2240  if ( s_loadgame_menu.cursor < 0 )
2241  s_loadgame_menu.cursor = 0;
2242  }
2243  return Default_MenuKey( &s_savegame_menu, key );
2244 }
2245 
2247 {
2248  if (!Com_ServerState())
2249  return; // not playing a game
2250 
2253  Create_Savestrings ();
2254 }
2255 
2256 
2257 /*
2258 =============================================================================
2259 
2260 JOIN SERVER MENU
2261 
2262 =============================================================================
2263 */
2264 #define MAX_LOCAL_SERVERS 8
2265 
2271 
2273 #define NO_SERVER_STRING "<no server>"
2274 
2275 // user readable information
2277 
2278 // network address
2280 
2281 void M_AddToServerList (netadr_t adr, char *info)
2282 {
2283  int i;
2284 
2286  return;
2287  while ( *info == ' ' )
2288  info++;
2289 
2290  // ignore if duplicated
2291  for (i=0 ; i<m_num_servers ; i++)
2292  if (!strcmp(info, local_server_names[i]))
2293  return;
2294 
2296 #ifdef HAVE_IPV6
2297  // Show the IP address as well. Useful to identify whether
2298  // the server is IPv6 or IPv4.
2300  "%s %s", info, NET_AdrToString(adr));
2301 #else
2302  strncpy (local_server_names[m_num_servers], info, sizeof(local_server_names[0])-1);
2303 #endif
2304  m_num_servers++;
2305 }
2306 
2307 
2308 void JoinServerFunc( void *self )
2309 {
2310  char buffer[128];
2311  int index;
2312 
2313  index = ( menuaction_s * ) self - s_joinserver_server_actions;
2314 
2315  if ( Q_stricmp( local_server_names[index], NO_SERVER_STRING ) == 0 )
2316  return;
2317 
2318  if (index >= m_num_servers)
2319  return;
2320 
2321  Com_sprintf (buffer, sizeof(buffer), "connect %s\n", NET_AdrToString (local_server_netadr[index]));
2322  Cbuf_AddText (buffer);
2323  M_ForceMenuOff ();
2324 }
2325 
2326 void AddressBookFunc( void *self )
2327 {
2329 }
2330 
2331 void NullCursorDraw( void *self )
2332 {
2333 }
2334 
2335 void SearchLocalGames( void )
2336 {
2337  int i;
2338 
2339  m_num_servers = 0;
2340  for (i=0 ; i<MAX_LOCAL_SERVERS ; i++)
2342 
2343  M_DrawTextBox( 8, 120 - 48, 36, 3 );
2344  M_Print( 16 + 16, 120 - 48 + 8, "Searching for local servers, this" );
2345  M_Print( 16 + 16, 120 - 48 + 16, "could take up to a minute, so" );
2346  M_Print( 16 + 16, 120 - 48 + 24, "please be patient." );
2347 
2348  // the text box won't show up unless we do a buffer swap
2349  re.EndFrame();
2350 
2351  // send out info packets
2352  CL_PingServers_f();
2353 }
2354 
2355 void SearchLocalGamesFunc( void *self )
2356 {
2357  SearchLocalGames();
2358 }
2359 
2361 {
2362  int i;
2363 
2364  s_joinserver_menu.x = viddef.width * 0.50 - 120;
2366 
2373 
2375  s_joinserver_search_action.generic.name = "refresh server list";
2380  s_joinserver_search_action.generic.statusbar = "search for servers";
2381 
2383  s_joinserver_server_title.generic.name = "connect to...";
2386 
2387  for ( i = 0; i < MAX_LOCAL_SERVERS; i++ )
2388  {
2396  s_joinserver_server_actions[i].generic.statusbar = "press ENTER to connect";
2397  }
2398 
2402 
2403  for ( i = 0; i < 8; i++ )
2405 
2407 
2408  SearchLocalGames();
2409 }
2410 
2412 {
2413  M_Banner( "m_banner_join_server" );
2415 }
2416 
2417 
2418 const char *JoinServer_MenuKey( int key )
2419 {
2420  return Default_MenuKey( &s_joinserver_menu, key );
2421 }
2422 
2424 {
2427 }
2428 
2429 
2430 /*
2431 =============================================================================
2432 
2433 START SERVER MENU
2434 
2435 =============================================================================
2436 */
2438 static char **mapnames;
2439 static int nummaps;
2440 
2449 
2450 void DMOptionsFunc( void *self )
2451 {
2452  if (s_rules_box.curvalue == 1)
2453  return;
2455 }
2456 
2457 void RulesChangeFunc ( void *self )
2458 {
2459  // DM
2460  if (s_rules_box.curvalue == 0)
2461  {
2464  }
2465  else if(s_rules_box.curvalue == 1) // coop // PGM
2466  {
2467  s_maxclients_field.generic.statusbar = "4 maximum for cooperative";
2468  if (atoi(s_maxclients_field.buffer) > 4)
2469  strcpy( s_maxclients_field.buffer, "4" );
2470  s_startserver_dmoptions_action.generic.statusbar = "N/A for cooperative";
2471  }
2472 //=====
2473 //PGM
2474  // ROGUE GAMES
2475  else if(Developer_searchpath(2) == 2)
2476  {
2477  if (s_rules_box.curvalue == 2) // tag
2478  {
2481  }
2482 /*
2483  else if(s_rules_box.curvalue == 3) // deathball
2484  {
2485  s_maxclients_field.generic.statusbar = NULL;
2486  s_startserver_dmoptions_action.generic.statusbar = NULL;
2487  }
2488 */
2489  }
2490 //PGM
2491 //=====
2492 }
2493 
2494 void StartServerActionFunc( void *self )
2495 {
2496  char startmap[1024];
2497  int timelimit;
2498  int fraglimit;
2499  int maxclients;
2500  char *spot;
2501 
2502  strcpy( startmap, strchr( mapnames[s_startmap_list.curvalue], '\n' ) + 1 );
2503 
2507 
2508  Cvar_SetValue( "maxclients", ClampCvar( 0, maxclients, maxclients ) );
2509  Cvar_SetValue ("timelimit", ClampCvar( 0, timelimit, timelimit ) );
2510  Cvar_SetValue ("fraglimit", ClampCvar( 0, fraglimit, fraglimit ) );
2511  Cvar_Set("hostname", s_hostname_field.buffer );
2512 // Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
2513 // Cvar_SetValue ("coop", s_rules_box.curvalue );
2514 
2515 //PGM
2516  if((s_rules_box.curvalue < 2) || (Developer_searchpath(2) != 2))
2517  {
2518  Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
2519  Cvar_SetValue ("coop", s_rules_box.curvalue );
2520  Cvar_SetValue ("gamerules", 0 );
2521  }
2522  else
2523  {
2524  Cvar_SetValue ("deathmatch", 1 ); // deathmatch is always true for rogue games, right?
2525  Cvar_SetValue ("coop", 0 ); // FIXME - this might need to depend on which game we're running
2526  Cvar_SetValue ("gamerules", s_rules_box.curvalue );
2527  }
2528 //PGM
2529 
2530  spot = NULL;
2531  if (s_rules_box.curvalue == 1) // PGM
2532  {
2533  if(Q_stricmp(startmap, "bunk1") == 0)
2534  spot = "start";
2535  else if(Q_stricmp(startmap, "mintro") == 0)
2536  spot = "start";
2537  else if(Q_stricmp(startmap, "fact1") == 0)
2538  spot = "start";
2539  else if(Q_stricmp(startmap, "power1") == 0)
2540  spot = "pstart";
2541  else if(Q_stricmp(startmap, "biggun") == 0)
2542  spot = "bstart";
2543  else if(Q_stricmp(startmap, "hangar1") == 0)
2544  spot = "unitstart";
2545  else if(Q_stricmp(startmap, "city1") == 0)
2546  spot = "unitstart";
2547  else if(Q_stricmp(startmap, "boss1") == 0)
2548  spot = "bosstart";
2549  }
2550 
2551  if (spot)
2552  {
2553  if (Com_ServerState())
2554  Cbuf_AddText ("disconnect\n");
2555  Cbuf_AddText (va("gamemap \"*%s$%s\"\n", startmap, spot));
2556  }
2557  else
2558  {
2559  Cbuf_AddText (va("map %s\n", startmap));
2560  }
2561 
2562  M_ForceMenuOff ();
2563 }
2564 
2566 {
2567  static const char *dm_coop_names[] =
2568  {
2569  "deathmatch",
2570  "cooperative",
2571  0
2572  };
2573 //=======
2574 //PGM
2575  static const char *dm_coop_names_rogue[] =
2576  {
2577  "deathmatch",
2578  "cooperative",
2579  "tag",
2580 // "deathball",
2581  0
2582  };
2583 //PGM
2584 //=======
2585  char *buffer;
2586  char mapsname[1024];
2587  char *s;
2588  int length;
2589  int i;
2590  FILE *fp;
2591 
2592  /*
2593  ** load the list of map names
2594  */
2595  Com_sprintf( mapsname, sizeof( mapsname ), "%s/maps.lst", FS_Gamedir() );
2596  if ( ( fp = fopen( mapsname, "rb" ) ) == 0 )
2597  {
2598  if ( ( length = FS_LoadFile( "maps.lst", ( void ** ) &buffer ) ) == -1 )
2599  Com_Error( ERR_DROP, "couldn't find maps.lst\n" );
2600  }
2601  else
2602  {
2603 #ifdef _WIN32
2604  length = filelength( fileno( fp ) );
2605 #else
2606  fseek(fp, 0, SEEK_END);
2607  length = ftell(fp);
2608  fseek(fp, 0, SEEK_SET);
2609 #endif
2610  buffer = malloc( length );
2611  fread( buffer, length, 1, fp );
2612  }
2613 
2614  s = buffer;
2615 
2616  i = 0;
2617  while ( i < length )
2618  {
2619  if ( s[i] == '\r' )
2620  nummaps++;
2621  i++;
2622  }
2623 
2624  if ( nummaps == 0 )
2625  Com_Error( ERR_DROP, "no maps in maps.lst\n" );
2626 
2627  mapnames = malloc( sizeof( char * ) * ( nummaps + 1 ) );
2628  memset( mapnames, 0, sizeof( char * ) * ( nummaps + 1 ) );
2629 
2630  s = buffer;
2631 
2632  for ( i = 0; i < nummaps; i++ )
2633  {
2634  char shortname[MAX_TOKEN_CHARS];
2635  char longname[MAX_TOKEN_CHARS];
2636  char scratch[200];
2637  int j, l;
2638 
2639  strcpy( shortname, COM_Parse( &s ) );
2640  l = strlen(shortname);
2641  for (j=0 ; j<l ; j++)
2642  shortname[j] = toupper(shortname[j]);
2643  strcpy( longname, COM_Parse( &s ) );
2644  Com_sprintf( scratch, sizeof( scratch ), "%s\n%s", longname, shortname );
2645 
2646  mapnames[i] = malloc( strlen( scratch ) + 1 );
2647  strcpy( mapnames[i], scratch );
2648  }
2649  mapnames[nummaps] = 0;
2650 
2651  if ( fp != 0 )
2652  {
2653  fp = 0;
2654  free( buffer );
2655  }
2656  else
2657  {
2658  FS_FreeFile( buffer );
2659  }
2660 
2661  /*
2662  ** initialize the menu stuff
2663  */
2664  s_startserver_menu.x = viddef.width * 0.50;
2666 
2670  s_startmap_list.generic.name = "initial map";
2671  s_startmap_list.itemnames = (const char **)mapnames;
2672 
2674  s_rules_box.generic.x = 0;
2675  s_rules_box.generic.y = 20;
2676  s_rules_box.generic.name = "rules";
2677 
2678 //PGM - rogue games only available with rogue DLL.
2679  if(Developer_searchpath(2) == 2)
2680  s_rules_box.itemnames = dm_coop_names_rogue;
2681  else
2682  s_rules_box.itemnames = dm_coop_names;
2683 //PGM
2684 
2685  if (Cvar_VariableValue("coop"))
2686  s_rules_box.curvalue = 1;
2687  else
2688  s_rules_box.curvalue = 0;
2690 
2692  s_timelimit_field.generic.name = "time limit";
2696  s_timelimit_field.generic.statusbar = "0 = no limit";
2699  strcpy( s_timelimit_field.buffer, Cvar_VariableString("timelimit") );
2700 
2702  s_fraglimit_field.generic.name = "frag limit";
2706  s_fraglimit_field.generic.statusbar = "0 = no limit";
2709  strcpy( s_fraglimit_field.buffer, Cvar_VariableString("fraglimit") );
2710 
2711  /*
2712  ** maxclients determines the maximum number of players that can join
2713  ** the game. If maxclients is only "1" then we should default the menu
2714  ** option to 8 players, otherwise use whatever its current value is.
2715  ** Clamping will be done when the server is actually started.
2716  */
2718  s_maxclients_field.generic.name = "max players";
2725  if ( Cvar_VariableValue( "maxclients" ) == 1 )
2726  strcpy( s_maxclients_field.buffer, "8" );
2727  else
2728  strcpy( s_maxclients_field.buffer, Cvar_VariableString("maxclients") );
2729 
2731  s_hostname_field.generic.name = "hostname";
2734  s_hostname_field.generic.y = 90;
2736  s_hostname_field.length = 12;
2738  strcpy( s_hostname_field.buffer, Cvar_VariableString("hostname") );
2739 
2741  s_startserver_dmoptions_action.generic.name = " deathmatch flags";
2747 
2754 
2763 
2765 
2766  // call this now to set proper inital state
2767  RulesChangeFunc ( NULL );
2768 }
2769 
2771 {
2773 }
2774 
2775 const char *StartServer_MenuKey( int key )
2776 {
2777  if ( key == K_ESCAPE )
2778  {
2779  if ( mapnames )
2780  {
2781  int i;
2782 
2783  for ( i = 0; i < nummaps; i++ )
2784  free( mapnames[i] );
2785  free( mapnames );
2786  }
2787  mapnames = 0;
2788  nummaps = 0;
2789  }
2790 
2791  return Default_MenuKey( &s_startserver_menu, key );
2792 }
2793 
2795 {
2798 }
2799 
2800 /*
2801 =============================================================================
2802 
2803 DMOPTIONS BOOK MENU
2804 
2805 =============================================================================
2806 */
2807 static char dmoptions_statusbar[128];
2808 
2810 
2826 
2827 //ROGUE
2832 //ROGUE
2833 
2834 static void DMFlagCallback( void *self )
2835 {
2836  menulist_s *f = ( menulist_s * ) self;
2837  int flags;
2838  int bit = 0;
2839 
2840  flags = Cvar_VariableValue( "dmflags" );
2841 
2842  if ( f == &s_friendlyfire_box )
2843  {
2844  if ( f->curvalue )
2846  else
2848  goto setvalue;
2849  }
2850  else if ( f == &s_falls_box )
2851  {
2852  if ( f->curvalue )
2853  flags &= ~DF_NO_FALLING;
2854  else
2855  flags |= DF_NO_FALLING;
2856  goto setvalue;
2857  }
2858  else if ( f == &s_weapons_stay_box )
2859  {
2860  bit = DF_WEAPONS_STAY;
2861  }
2862  else if ( f == &s_instant_powerups_box )
2863  {
2864  bit = DF_INSTANT_ITEMS;
2865  }
2866  else if ( f == &s_allow_exit_box )
2867  {
2868  bit = DF_ALLOW_EXIT;
2869  }
2870  else if ( f == &s_powerups_box )
2871  {
2872  if ( f->curvalue )
2873  flags &= ~DF_NO_ITEMS;
2874  else
2875  flags |= DF_NO_ITEMS;
2876  goto setvalue;
2877  }
2878  else if ( f == &s_health_box )
2879  {
2880  if ( f->curvalue )
2881  flags &= ~DF_NO_HEALTH;
2882  else
2883  flags |= DF_NO_HEALTH;
2884  goto setvalue;
2885  }
2886  else if ( f == &s_spawn_farthest_box )
2887  {
2888  bit = DF_SPAWN_FARTHEST;
2889  }
2890  else if ( f == &s_teamplay_box )
2891  {
2892  if ( f->curvalue == 1 )
2893  {
2894  flags |= DF_SKINTEAMS;
2895  flags &= ~DF_MODELTEAMS;
2896  }
2897  else if ( f->curvalue == 2 )
2898  {
2899  flags |= DF_MODELTEAMS;
2900  flags &= ~DF_SKINTEAMS;
2901  }
2902  else
2903  {
2904  flags &= ~( DF_MODELTEAMS | DF_SKINTEAMS );
2905  }
2906 
2907  goto setvalue;
2908  }
2909  else if ( f == &s_samelevel_box )
2910  {
2911  bit = DF_SAME_LEVEL;
2912  }
2913  else if ( f == &s_force_respawn_box )
2914  {
2915  bit = DF_FORCE_RESPAWN;
2916  }
2917  else if ( f == &s_armor_box )
2918  {
2919  if ( f->curvalue )
2920  flags &= ~DF_NO_ARMOR;
2921  else
2922  flags |= DF_NO_ARMOR;
2923  goto setvalue;
2924  }
2925  else if ( f == &s_infinite_ammo_box )
2926  {
2927  bit = DF_INFINITE_AMMO;
2928  }
2929  else if ( f == &s_fixed_fov_box )
2930  {
2931  bit = DF_FIXED_FOV;
2932  }
2933  else if ( f == &s_quad_drop_box )
2934  {
2935  bit = DF_QUAD_DROP;
2936  }
2937 
2938 //=======
2939 //ROGUE
2940  else if (Developer_searchpath(2) == 2)
2941  {
2942  if ( f == &s_no_mines_box)
2943  {
2944  bit = DF_NO_MINES;
2945  }
2946  else if ( f == &s_no_nukes_box)
2947  {
2948  bit = DF_NO_NUKES;
2949  }
2950  else if ( f == &s_stack_double_box)
2951  {
2952  bit = DF_NO_STACK_DOUBLE;
2953  }
2954  else if ( f == &s_no_spheres_box)
2955  {
2956  bit = DF_NO_SPHERES;
2957  }
2958  }
2959 //ROGUE
2960 //=======
2961 
2962  if ( f )
2963  {
2964  if ( f->curvalue == 0 )
2965  flags &= ~bit;
2966  else
2967  flags |= bit;
2968  }
2969 
2970 setvalue:
2971  Cvar_SetValue ("dmflags", flags);
2972 
2973  Com_sprintf( dmoptions_statusbar, sizeof( dmoptions_statusbar ), "dmflags = %d", flags );
2974 
2975 }
2976 
2978 {
2979  static const char *yes_no_names[] =
2980  {
2981  "no", "yes", 0
2982  };
2983  static const char *teamplay_names[] =
2984  {
2985  "disabled", "by skin", "by model", 0
2986  };
2987  int dmflags = Cvar_VariableValue( "dmflags" );
2988  int y = 0;
2989 
2990  s_dmoptions_menu.x = viddef.width * 0.50;
2992 
2994  s_falls_box.generic.x = 0;
2995  s_falls_box.generic.y = y;
2996  s_falls_box.generic.name = "falling damage";
2998  s_falls_box.itemnames = yes_no_names;
3000 
3003  s_weapons_stay_box.generic.y = y += 10;
3004  s_weapons_stay_box.generic.name = "weapons stay";
3006  s_weapons_stay_box.itemnames = yes_no_names;
3008 
3012  s_instant_powerups_box.generic.name = "instant powerups";
3014  s_instant_powerups_box.itemnames = yes_no_names;
3016 
3018  s_powerups_box.generic.x = 0;
3019  s_powerups_box.generic.y = y += 10;
3020  s_powerups_box.generic.name = "allow powerups";
3022  s_powerups_box.itemnames = yes_no_names;
3024 
3026  s_health_box.generic.x = 0;
3027  s_health_box.generic.y = y += 10;
3029  s_health_box.generic.name = "allow health";
3030  s_health_box.itemnames = yes_no_names;
3032 
3034  s_armor_box.generic.x = 0;
3035  s_armor_box.generic.y = y += 10;
3036  s_armor_box.generic.name = "allow armor";
3038  s_armor_box.itemnames = yes_no_names;
3039  s_armor_box.curvalue = ( dmflags & DF_NO_ARMOR ) == 0;
3040 
3043  s_spawn_farthest_box.generic.y = y += 10;
3044  s_spawn_farthest_box.generic.name = "spawn farthest";
3046  s_spawn_farthest_box.itemnames = yes_no_names;
3048 
3051  s_samelevel_box.generic.y = y += 10;
3052  s_samelevel_box.generic.name = "same map";
3054  s_samelevel_box.itemnames = yes_no_names;
3056 
3059  s_force_respawn_box.generic.y = y += 10;
3060  s_force_respawn_box.generic.name = "force respawn";
3062  s_force_respawn_box.itemnames = yes_no_names;
3064 
3066  s_teamplay_box.generic.x = 0;
3067  s_teamplay_box.generic.y = y += 10;
3068  s_teamplay_box.generic.name = "teamplay";
3070  s_teamplay_box.itemnames = teamplay_names;
3071 
3074  s_allow_exit_box.generic.y = y += 10;
3075  s_allow_exit_box.generic.name = "allow exit";
3077  s_allow_exit_box.itemnames = yes_no_names;
3079 
3082  s_infinite_ammo_box.generic.y = y += 10;
3083  s_infinite_ammo_box.generic.name = "infinite ammo";
3085  s_infinite_ammo_box.itemnames = yes_no_names;
3087 
3090  s_fixed_fov_box.generic.y = y += 10;
3091  s_fixed_fov_box.generic.name = "fixed FOV";
3093  s_fixed_fov_box.itemnames = yes_no_names;
3095 
3098  s_quad_drop_box.generic.y = y += 10;
3099  s_quad_drop_box.generic.name = "quad drop";
3101  s_quad_drop_box.itemnames = yes_no_names;
3103 
3106  s_friendlyfire_box.generic.y = y += 10;
3107  s_friendlyfire_box.generic.name = "friendly fire";
3109  s_friendlyfire_box.itemnames = yes_no_names;
3111 
3112 //============
3113 //ROGUE
3114  if(Developer_searchpath(2) == 2)
3115  {
3117  s_no_mines_box.generic.x = 0;
3118  s_no_mines_box.generic.y = y += 10;
3119  s_no_mines_box.generic.name = "remove mines";
3121  s_no_mines_box.itemnames = yes_no_names;
3123 
3125  s_no_nukes_box.generic.x = 0;
3126  s_no_nukes_box.generic.y = y += 10;
3127  s_no_nukes_box.generic.name = "remove nukes";
3129  s_no_nukes_box.itemnames = yes_no_names;
3131 
3134  s_stack_double_box.generic.y = y += 10;
3135  s_stack_double_box.generic.name = "2x/4x stacking off";
3137  s_stack_double_box.itemnames = yes_no_names;
3139 
3142  s_no_spheres_box.generic.y = y += 10;
3143  s_no_spheres_box.generic.name = "remove spheres";
3145  s_no_spheres_box.itemnames = yes_no_names;
3147 
3148  }
3149 //ROGUE
3150 //============
3151 
3167 
3168 //=======
3169 //ROGUE
3170  if(Developer_searchpath(2) == 2)
3171  {
3176  }
3177 //ROGUE
3178 //=======
3179 
3181 
3182  // set the original dmflags statusbar
3183  DMFlagCallback( 0 );
3185 }
3186 
3188 {
3190 }
3191 
3192 const char *DMOptions_MenuKey( int key )
3193 {
3194  return Default_MenuKey( &s_dmoptions_menu, key );
3195 }
3196 
3198 {
3201 }
3202 
3203 /*
3204 =============================================================================
3205 
3206 DOWNLOADOPTIONS BOOK MENU
3207 
3208 =============================================================================
3209 */
3211 
3218 
3219 static void DownloadCallback( void *self )
3220 {
3221  menulist_s *f = ( menulist_s * ) self;
3222 
3223  if (f == &s_allow_download_box)
3224  {
3225  Cvar_SetValue("allow_download", f->curvalue);
3226  }
3227 
3228  else if (f == &s_allow_download_maps_box)
3229  {
3230  Cvar_SetValue("allow_download_maps", f->curvalue);
3231  }
3232 
3233  else if (f == &s_allow_download_models_box)
3234  {
3235  Cvar_SetValue("allow_download_models", f->curvalue);
3236  }
3237 
3238  else if (f == &s_allow_download_players_box)
3239  {
3240  Cvar_SetValue("allow_download_players", f->curvalue);
3241  }
3242 
3243  else if (f == &s_allow_download_sounds_box)
3244  {
3245  Cvar_SetValue("allow_download_sounds", f->curvalue);
3246  }
3247 }
3248 
3250 {
3251  static const char *yes_no_names[] =
3252  {
3253  "no", "yes", 0
3254  };
3255  int y = 0;
3256 
3259 
3261  s_download_title.generic.name = "Download Options";
3262  s_download_title.generic.x = 48;
3264 
3267  s_allow_download_box.generic.y = y += 20;
3268  s_allow_download_box.generic.name = "allow downloading";
3270  s_allow_download_box.itemnames = yes_no_names;
3271  s_allow_download_box.curvalue = (Cvar_VariableValue("allow_download") != 0);
3272 
3278  s_allow_download_maps_box.itemnames = yes_no_names;
3279  s_allow_download_maps_box.curvalue = (Cvar_VariableValue("allow_download_maps") != 0);
3280 
3284  s_allow_download_players_box.generic.name = "player models/skins";
3286  s_allow_download_players_box.itemnames = yes_no_names;
3287  s_allow_download_players_box.curvalue = (Cvar_VariableValue("allow_download_players") != 0);
3288 
3294  s_allow_download_models_box.itemnames = yes_no_names;
3295  s_allow_download_models_box.curvalue = (Cvar_VariableValue("allow_download_models") != 0);
3296 
3302  s_allow_download_sounds_box.itemnames = yes_no_names;
3303  s_allow_download_sounds_box.curvalue = (Cvar_VariableValue("allow_download_sounds") != 0);
3304 
3311 
3313 
3314  // skip over title
3315  if (s_downloadoptions_menu.cursor == 0)
3317 }
3318 
3320 {
3322 }
3323 
3324 const char *DownloadOptions_MenuKey( int key )
3325 {
3326  return Default_MenuKey( &s_downloadoptions_menu, key );
3327 }
3328 
3330 {
3333 }
3334 /*
3335 =============================================================================
3336 
3337 ADDRESS BOOK MENU
3338 
3339 =============================================================================
3340 */
3341 #define NUM_ADDRESSBOOK_ENTRIES 9
3342 
3345 
3347 {
3348  int i;
3349 
3350  s_addressbook_menu.x = viddef.width / 2 - 142;
3351  s_addressbook_menu.y = viddef.height / 2 - 58;
3353 
3354  for ( i = 0; i < NUM_ADDRESSBOOK_ENTRIES; i++ )
3355  {
3356  cvar_t *adr;
3357  char buffer[20];
3358 
3359  Com_sprintf( buffer, sizeof( buffer ), "adr%d", i );
3360 
3361  adr = Cvar_Get( buffer, "", CVAR_ARCHIVE );
3362 
3367  s_addressbook_fields[i].generic.y = i * 18 + 0;
3372 
3373  strcpy( s_addressbook_fields[i].buffer, adr->string );
3374 
3376  }
3377 }
3378 
3379 const char *AddressBook_MenuKey( int key )
3380 {
3381  if ( key == K_ESCAPE )
3382  {
3383  int index;
3384  char buffer[20];
3385 
3386  for ( index = 0; index < NUM_ADDRESSBOOK_ENTRIES; index++ )
3387  {
3388  Com_sprintf( buffer, sizeof( buffer ), "adr%d", index );
3390  }
3391  }
3392  return Default_MenuKey( &s_addressbook_menu, key );
3393 }
3394 
3396 {
3397  M_Banner( "m_banner_addressbook" );
3399 }
3400 
3402 {
3405 }
3406 
3407 /*
3408 =============================================================================
3409 
3410 PLAYER CONFIG MENU
3411 
3412 =============================================================================
3413 */
3425 
3426 #define MAX_DISPLAYNAME 16
3427 #define MAX_PLAYERMODELS 1024
3428 
3429 typedef struct
3430 {
3431  int nskins;
3433  char displayname[MAX_DISPLAYNAME];
3434  char directory[MAX_QPATH];
3436 
3440 
3441 static int rate_tbl[] = { 2500, 3200, 5000, 10000, 25000, 0 };
3442 static const char *rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN",
3443  "Dual ISDN/Cable", "T1/LAN", "User defined", 0 };
3444 
3445 void DownloadOptionsFunc( void *self )
3446 {
3448 }
3449 
3450 static void HandednessCallback( void *unused )
3451 {
3453 }
3454 
3455 static void RateCallback( void *unused )
3456 {
3457  if (s_player_rate_box.curvalue != sizeof(rate_tbl) / sizeof(*rate_tbl) - 1)
3459 }
3460 
3461 static void ModelCallback( void *unused )
3462 {
3465 }
3466 
3467 static void FreeFileList( char **list, int n )
3468 {
3469  int i;
3470 
3471  for ( i = 0; i < n; i++ )
3472  {
3473  if ( list[i] )
3474  {
3475  free( list[i] );
3476  list[i] = 0;
3477  }
3478  }
3479  free( list );
3480 }
3481 
3482 static qboolean IconOfSkinExists( char *skin, char **pcxfiles, int npcxfiles )
3483 {
3484  int i;
3485  char scratch[1024];
3486 
3487  strcpy( scratch, skin );
3488  *strrchr( scratch, '.' ) = 0;
3489  strcat( scratch, "_i.pcx" );
3490 
3491  for ( i = 0; i < npcxfiles; i++ )
3492  {
3493  if ( strcmp( pcxfiles[i], scratch ) == 0 )
3494  return true;
3495  }
3496 
3497  return false;
3498 }
3499 
3501 {
3502  char findname[1024];
3503  char scratch[1024];
3504  int ndirs = 0, npms = 0;
3505  char **dirnames;
3506  char *path = NULL;
3507  int i;
3508 
3509  extern char **FS_ListFiles( char *, int *, unsigned, unsigned );
3510 
3511  s_numplayermodels = 0;
3512 
3513  /*
3514  ** get a list of directories
3515  */
3516  do
3517  {
3518  path = FS_NextPath( path );
3519 
3520  /*
3521  * PATCH: eliasm
3522  *
3523  * If FS_NextPath returns NULL we get a SEGV on the next line.
3524  * On other platforms this propably works (path becomes
3525  * the null string or something like that.
3526  */
3527  if( path == NULL ) {
3528  break;
3529  }
3530  /* END OF PATCH */
3531 
3532  Com_sprintf( findname, sizeof(findname), "%s/players/*.*", path );
3533 
3534  if ( ( dirnames = FS_ListFiles( findname, &ndirs, SFF_SUBDIR, 0 ) ) != 0 )
3535  break;
3536  } while ( path );
3537 
3538  if ( !dirnames )
3539  return false;
3540 
3541  /*
3542  ** go through the subdirectories
3543  */
3544  npms = ndirs;
3545  if ( npms > MAX_PLAYERMODELS )
3546  npms = MAX_PLAYERMODELS;
3547 
3548  for ( i = 0; i < npms; i++ )
3549  {
3550  int k, s;
3551  char *a, *b, *c;
3552  char **pcxnames;
3553  char **skinnames;
3554  int npcxfiles;
3555  int nskins = 0;
3556 
3557  if ( dirnames[i] == 0 )
3558  continue;
3559 
3560  // verify the existence of tris.md2
3561  strcpy( scratch, dirnames[i] );
3562  strcat( scratch, "/tris.md2" );
3563  if ( !Sys_FindFirst( scratch, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM ) )
3564  {
3565  free( dirnames[i] );
3566  dirnames[i] = 0;
3567  Sys_FindClose();
3568  continue;
3569  }
3570  Sys_FindClose();
3571 
3572  // verify the existence of at least one pcx skin
3573  strcpy( scratch, dirnames[i] );
3574  strcat( scratch, "/*.pcx" );
3575  pcxnames = FS_ListFiles( scratch, &npcxfiles, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM );
3576 
3577  if ( !pcxnames )
3578  {
3579  free( dirnames[i] );
3580  dirnames[i] = 0;
3581  continue;
3582  }
3583 
3584  // count valid skins, which consist of a skin with a matching "_i" icon
3585  for ( k = 0; k < npcxfiles-1; k++ )
3586  {
3587  if ( !strstr( pcxnames[k], "_i.pcx" ) )
3588  {
3589  if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
3590  {
3591  nskins++;
3592  }
3593  }
3594  }
3595  if ( !nskins )
3596  continue;
3597 
3598  skinnames = malloc( sizeof( char * ) * ( nskins + 1 ) );
3599  memset( skinnames, 0, sizeof( char * ) * ( nskins + 1 ) );
3600 
3601  // copy the valid skins
3602  for ( s = 0, k = 0; k < npcxfiles-1; k++ )
3603  {
3604  char *a, *b, *c;
3605 
3606  if ( !strstr( pcxnames[k], "_i.pcx" ) )
3607  {
3608  if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
3609  {
3610  a = strrchr( pcxnames[k], '/' );
3611  b = strrchr( pcxnames[k], '\\' );
3612 
3613  if ( a > b )
3614  c = a;
3615  else
3616  c = b;
3617 
3618  strcpy( scratch, c + 1 );
3619 
3620  if ( strrchr( scratch, '.' ) )
3621  *strrchr( scratch, '.' ) = 0;
3622 
3623  skinnames[s] = strdup( scratch );
3624  s++;
3625  }
3626  }
3627  }
3628 
3629  // at this point we have a valid player model
3630  s_pmi[s_numplayermodels].nskins = nskins;
3632 
3633  // make short name for the model
3634  a = strrchr( dirnames[i], '/' );
3635  b = strrchr( dirnames[i], '\\' );
3636 
3637  if ( a > b )
3638  c = a;
3639  else
3640  c = b;
3641 
3642  strncpy( s_pmi[s_numplayermodels].displayname, c + 1, MAX_DISPLAYNAME-1 );
3643  strcpy( s_pmi[s_numplayermodels].directory, c + 1 );
3644 
3645  FreeFileList( pcxnames, npcxfiles );
3646 
3648  }
3649  if ( dirnames )
3650  FreeFileList( dirnames, ndirs );
3651  return true;
3652 }
3653 
3654 static int pmicmpfnc( const void *_a, const void *_b )
3655 {
3656  const playermodelinfo_s *a = ( const playermodelinfo_s * ) _a;
3657  const playermodelinfo_s *b = ( const playermodelinfo_s * ) _b;
3658 
3659  /*
3660  ** sort by male, female, then alphabetical
3661  */
3662  if ( strcmp( a->directory, "male" ) == 0 )
3663  return -1;
3664  else if ( strcmp( b->directory, "male" ) == 0 )
3665  return 1;
3666 
3667  if ( strcmp( a->directory, "female" ) == 0 )
3668  return -1;
3669  else if ( strcmp( b->directory, "female" ) == 0 )
3670  return 1;
3671 
3672  return strcmp( a->directory, b->directory );
3673 }
3674 
3675 
3677 {
3678  extern cvar_t *name;
3679  extern cvar_t *skin;
3680  char currentdirectory[1024];
3681  char currentskin[1024];
3682  int i = 0;
3683 
3684  int currentdirectoryindex = 0;
3685  int currentskinindex = 0;
3686 
3687  cvar_t *hand = Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );
3688 
3689  static const char *handedness[] = { "right", "left", "center", 0 };
3690 
3692 
3693  if (s_numplayermodels == 0)
3694  return false;
3695 
3696  if ( hand->value < 0 || hand->value > 2 )
3697  Cvar_SetValue( "hand", 0 );
3698 
3699  strcpy( currentdirectory, skin->string );
3700 
3701  if ( strchr( currentdirectory, '/' ) )
3702  {
3703  strcpy( currentskin, strchr( currentdirectory, '/' ) + 1 );
3704  *strchr( currentdirectory, '/' ) = 0;
3705  }
3706  else if ( strchr( currentdirectory, '\\' ) )
3707  {
3708  strcpy( currentskin, strchr( currentdirectory, '\\' ) + 1 );
3709  *strchr( currentdirectory, '\\' ) = 0;
3710  }
3711  else
3712  {
3713  strcpy( currentdirectory, "male" );
3714  strcpy( currentskin, "grunt" );
3715  }
3716 
3717  qsort( s_pmi, s_numplayermodels, sizeof( s_pmi[0] ), pmicmpfnc );
3718 
3719  memset( s_pmnames, 0, sizeof( s_pmnames ) );
3720  for ( i = 0; i < s_numplayermodels; i++ )
3721  {
3723  if ( Q_stricmp( s_pmi[i].directory, currentdirectory ) == 0 )
3724  {
3725  int j;
3726 
3727  currentdirectoryindex = i;
3728 
3729  for ( j = 0; j < s_pmi[i].nskins; j++ )
3730  {
3731  if ( Q_stricmp( s_pmi[i].skindisplaynames[j], currentskin ) == 0 )
3732  {
3733  currentskinindex = j;
3734  break;
3735  }
3736  }
3737  }
3738  }
3739 
3740  s_player_config_menu.x = viddef.width / 2 - 95;
3741  s_player_config_menu.y = viddef.height / 2 - 97;
3743 
3745  s_player_name_field.generic.name = "name";
3751  strcpy( s_player_name_field.buffer, name->string );
3752  s_player_name_field.cursor = strlen( name->string );
3753 
3755  s_player_model_title.generic.name = "model";
3758 
3764  s_player_model_box.curvalue = currentdirectoryindex;
3765  s_player_model_box.itemnames = (const char **)s_pmnames;
3766 
3768  s_player_skin_title.generic.name = "skin";
3771 
3773  s_player_skin_box.generic.x = -56;
3778  s_player_skin_box.curvalue = currentskinindex;
3779  s_player_skin_box.itemnames = (const char **)s_pmi[currentdirectoryindex].skindisplaynames;
3780 
3782  s_player_hand_title.generic.name = "handedness";
3785 
3793  s_player_handedness_box.itemnames = handedness;
3794 
3795  for (i = 0; i < sizeof(rate_tbl) / sizeof(*rate_tbl) - 1; i++)
3796  if (Cvar_VariableValue("rate") == rate_tbl[i])
3797  break;
3798 
3800  s_player_rate_title.generic.name = "connect speed";
3803 
3805  s_player_rate_box.generic.x = -56;
3806  s_player_rate_box.generic.y = 166;
3812 
3814  s_player_download_action.generic.name = "download options";
3820 
3825  {
3828  }
3834 
3835  return true;
3836 }
3837 
3839 {
3840  extern float CalcFov( float fov_x, float w, float h );
3841  refdef_t refdef;
3842  char scratch[MAX_QPATH];
3843 
3844  memset( &refdef, 0, sizeof( refdef ) );
3845 
3846  refdef.x = viddef.width / 2;
3847  refdef.y = viddef.height / 2 - 72;
3848  refdef.width = 144;
3849  refdef.height = 168;
3850  refdef.fov_x = 40;
3851  refdef.fov_y = CalcFov( refdef.fov_x, refdef.width, refdef.height );
3852  refdef.time = cls.realtime*0.001;
3853 
3855  {
3856  static int yaw;
3857  entity_t entity;
3858 
3859  memset( &entity, 0, sizeof( entity ) );
3860 
3861  Com_sprintf( scratch, sizeof( scratch ), "players/%s/tris.md2", s_pmi[s_player_model_box.curvalue].directory );
3862  entity.model = re.RegisterModel( scratch );
3864  entity.skin = re.RegisterSkin( scratch );
3865  entity.flags = RF_FULLBRIGHT;
3866  entity.origin[0] = 80;
3867  entity.origin[1] = 0;
3868  entity.origin[2] = 0;
3869  VectorCopy( entity.origin, entity.oldorigin );
3870  entity.frame = 0;
3871  entity.oldframe = 0;
3872  entity.backlerp = 0.0;
3873  entity.angles[1] = yaw++;
3874  if ( ++yaw > 360 )
3875  yaw -= 360;
3876 
3877  refdef.areabits = 0;
3878  refdef.num_entities = 1;
3879  refdef.entities = &entity;
3880  refdef.lightstyles = 0;
3881  refdef.rdflags = RDF_NOWORLDMODEL;
3882 
3884 
3885  M_DrawTextBox( ( refdef.x ) * ( 320.0F / viddef.width ) - 8, ( viddef.height / 2 ) * ( 240.0F / viddef.height) - 77, refdef.width / 8, refdef.height / 8 );
3886  refdef.height += 4;
3887 
3888  re.RenderFrame( &refdef );
3889 
3890  Com_sprintf( scratch, sizeof( scratch ), "/players/%s/%s_i.pcx",
3893  re.DrawPic( s_player_config_menu.x - 40, refdef.y, scratch );
3894  }
3895 }
3896 
3897 const char *PlayerConfig_MenuKey (int key)
3898 {
3899  int i;
3900 
3901  if ( key == K_ESCAPE )
3902  {
3903  char scratch[1024];
3904 
3905  Cvar_Set( "name", s_player_name_field.buffer );
3906 
3907  Com_sprintf( scratch, sizeof( scratch ), "%s/%s",
3910 
3911  Cvar_Set( "skin", scratch );
3912 
3913  for ( i = 0; i < s_numplayermodels; i++ )
3914  {
3915  int j;
3916 
3917  for ( j = 0; j < s_pmi[i].nskins; j++ )
3918  {
3919  if ( s_pmi[i].skindisplaynames[j] )
3920  free( s_pmi[i].skindisplaynames[j] );
3921  s_pmi[i].skindisplaynames[j] = 0;
3922  }
3923  free( s_pmi[i].skindisplaynames );
3924  s_pmi[i].skindisplaynames = 0;
3925  s_pmi[i].nskins = 0;
3926  }
3927  }
3928  return Default_MenuKey( &s_player_config_menu, key );
3929 }
3930 
3931 
3933 {
3934  if (!PlayerConfig_MenuInit())
3935  {
3936  Menu_SetStatusBar( &s_multiplayer_menu, "No valid player models found" );
3937  return;
3938  }
3941 }
3942 
3943 
3944 /*
3945 =======================================================================
3946 
3947 GALLERY MENU
3948 
3949 =======================================================================
3950 */
3951 #if 0
3952 void M_Menu_Gallery_f( void )
3953 {
3954  extern void Gallery_MenuDraw( void );
3955  extern const char *Gallery_MenuKey( int key );
3956 
3957  M_PushMenu( Gallery_MenuDraw, Gallery_MenuKey );
3958 }
3959 #endif
3960 
3961 /*
3962 =======================================================================
3963 
3964 QUIT MENU
3965 
3966 =======================================================================
3967 */
3968 
3969 const char *M_Quit_Key (int key)
3970 {
3971  switch (key)
3972  {
3973  case K_ESCAPE:
3974  case 'n':
3975  case 'N':
3976  M_PopMenu ();
3977  break;
3978 
3979  case 'Y':
3980  case 'y':
3982  CL_Quit_f ();
3983  break;
3984 
3985  default:
3986  break;
3987  }
3988 
3989  return NULL;
3990 
3991 }
3992 
3993 
3994 void M_Quit_Draw (void)
3995 {
3996  int w, h;
3997 
3998  re.DrawGetPicSize (&w, &h, "quit");
3999  re.DrawPic ( (viddef.width-w)/2, (viddef.height-h)/2, "quit");
4000 }
4001 
4002 
4003 void M_Menu_Quit_f (void)
4004 {
4006 }
4007 
4008 
4009 
4010 //=============================================================================
4011 /* Menu Subsystem */
4012 
4013 
4014 /*
4015 =================
4016 M_Init
4017 =================
4018 */
4019 void M_Init (void)
4020 {
4021  Cmd_AddCommand ("menu_main", M_Menu_Main_f);
4022  Cmd_AddCommand ("menu_game", M_Menu_Game_f);
4023  Cmd_AddCommand ("menu_loadgame", M_Menu_LoadGame_f);
4024  Cmd_AddCommand ("menu_savegame", M_Menu_SaveGame_f);
4025  Cmd_AddCommand ("menu_joinserver", M_Menu_JoinServer_f);
4026  Cmd_AddCommand ("menu_addressbook", M_Menu_AddressBook_f);
4027  Cmd_AddCommand ("menu_startserver", M_Menu_StartServer_f);
4028  Cmd_AddCommand ("menu_dmoptions", M_Menu_DMOptions_f);
4029  Cmd_AddCommand ("menu_playerconfig", M_Menu_PlayerConfig_f);
4030  Cmd_AddCommand ("menu_downloadoptions", M_Menu_DownloadOptions_f);
4031  Cmd_AddCommand ("menu_credits", M_Menu_Credits_f );
4032  Cmd_AddCommand ("menu_multiplayer", M_Menu_Multiplayer_f );
4033  Cmd_AddCommand ("menu_video", M_Menu_Video_f);
4034  Cmd_AddCommand ("menu_options", M_Menu_Options_f);
4035  Cmd_AddCommand ("menu_keys", M_Menu_Keys_f);
4036  Cmd_AddCommand ("menu_quit", M_Menu_Quit_f);
4037 }
4038 
4039 
4040 /*
4041 =================
4042 M_Draw
4043 =================
4044 */
4045 void M_Draw (void)
4046 {
4047  if (cls.key_dest != key_menu)
4048  return;
4049 
4050  // repaint everything next frame
4051  SCR_DirtyScreen ();
4052 
4053  // dim everything behind it down
4054  if (cl.cinematictime > 0)
4055  re.DrawFill (0,0,viddef.width, viddef.height, 0);
4056  else
4057  re.DrawFadeScreen ();
4058 
4059  m_drawfunc ();
4060 
4061  // delay playing the enter sound until after the
4062  // menu has been drawn, to avoid delay while
4063  // caching images
4064  if (m_entersound)
4065  {
4067  m_entersound = false;
4068  }
4069 }
4070 
4071 
4072 /*
4073 =================
4074 M_Keydown
4075 =================
4076 */
4077 void M_Keydown (int key)
4078 {
4079  const char *s;
4080 
4081  if (m_keyfunc)
4082  if ( ( s = m_keyfunc( key ) ) != 0 )
4083  S_StartLocalSound( ( char * ) s );
4084 }
4085 
4086 
M_Credits_Key
const char * M_Credits_Key(int key)
Definition: menu.c:1863
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:80
s_startmap_list
static menulist_s s_startmap_list
Definition: menu.c:2447
K_AUX3
@ K_AUX3
Definition: keys.h:99
AddressBookFunc
void AddressBookFunc(void *self)
Definition: menu.c:2326
s_options_alwaysrun_box
static menulist_s s_options_alwaysrun_box
Definition: menu.c:1038
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:177
nummaps
static int nummaps
Definition: menu.c:2439
s_medium_game_action
static menuaction_s s_medium_game_action
Definition: menu.c:1945
s_keys_backpedal_action
static menuaction_s s_keys_backpedal_action
Definition: menu.c:625
CDAudio_Stop
void CDAudio_Stop(void)
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:346
M_Menu_JoinServer_f
void M_Menu_JoinServer_f(void)
Definition: menu.c:2423
menuseparator_s
Definition: qmenu.h:118
s_dmoptions_menu
static menuframework_s s_dmoptions_menu
Definition: menu.c:2809
value
GLfloat value
Definition: qgl_win.c:63
s_joinserver_server_title
static menuseparator_s s_joinserver_server_title
Definition: menu.c:2267
s_player_handedness_box
static menulist_s s_player_handedness_box
Definition: menu.c:3418
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:2825
K_DOWNARROW
@ K_DOWNARROW
Definition: keys.h:34
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:2819
M_Print
void M_Print(int cx, int cy, char *str)
Definition: menu.c:280
MAIN_ITEMS
#define MAIN_ITEMS
Definition: menu.c:388
K_AUX31
@ K_AUX31
Definition: keys.h:127
CreditsFunc
static void CreditsFunc(void *unused)
Definition: menu.c:1994
client_state_t::servercount
int servercount
Definition: client.h:174
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
entity_s::origin
float origin[3]
Definition: ref.h:57
entity_s::model
struct model_s * model
Definition: ref.h:51
s_joinserver_address_book_action
static menuaction_s s_joinserver_address_book_action
Definition: menu.c:2269
s_player_skin_box
static menulist_s s_player_skin_box
Definition: menu.c:3417
s_hard_game_action
static menuaction_s s_hard_game_action
Definition: menu.c:1946
s_startserver_start_action
static menuaction_s s_startserver_start_action
Definition: menu.c:2441
DF_WEAPONS_STAY
#define DF_WEAPONS_STAY
Definition: q_shared.h:1050
Multiplayer_MenuKey
const char * Multiplayer_MenuKey(int key)
Definition: menu.c:569
Keys_MenuInit
static void Keys_MenuInit(void)
Definition: menu.c:751
refdef_t
Definition: ref.h:120
NO_SERVER_STRING
#define NO_SERVER_STRING
Definition: menu.c:2273
K_KP_UPARROW
@ K_KP_UPARROW
Definition: keys.h:61
JoinServer_MenuDraw
void JoinServer_MenuDraw(void)
Definition: menu.c:2411
playermodelinfo_s::directory
char directory[MAX_QPATH]
Definition: menu.c:3434
DF_NO_FALLING
#define DF_NO_FALLING
Definition: q_shared.h:1051
client_state_t::attractloop
qboolean attractloop
Definition: client.h:173
Multiplayer_MenuDraw
static void Multiplayer_MenuDraw(void)
Definition: menu.c:511
StartServerActionFunc
void StartServerActionFunc(void *self)
Definition: menu.c:2494
M_Init
void M_Init(void)
Definition: menu.c:4019
M_Main_Draw
void M_Main_Draw(void)
Definition: menu.c:391
MAX_MENU_DEPTH
#define MAX_MENU_DEPTH
Definition: menu.c:63
AlwaysRunFunc
static void AlwaysRunFunc(void *unused)
Definition: menu.c:1066
s_allow_exit_box
static menulist_s s_allow_exit_box
Definition: menu.c:2822
K_MOUSE4
@ K_MOUSE4
Definition: keys.h:82
InvertMouseFunc
static void InvertMouseFunc(void *unused)
Definition: menu.c:1136
MAX_DISPLAYNAME
#define MAX_DISPLAYNAME
Definition: menu.c:3426
maxclients
cvar_t * maxclients
Definition: g_main.c:44
DMOptions_MenuDraw
void DMOptions_MenuDraw(void)
Definition: menu.c:3187
Multiplayer_MenuInit
void Multiplayer_MenuInit(void)
Definition: menu.c:534
FreeLookFunc
static void FreeLookFunc(void *unused)
Definition: menu.c:1071
menucommon_s::localdata
int localdata[4]
Definition: qmenu.h:71
Key_SetBinding
void Key_SetBinding(int keynum, char *binding)
Definition: keys.c:509
DownloadOptions_MenuInit
void DownloadOptions_MenuInit(void)
Definition: menu.c:3249
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:2775
cl_run
cvar_t * cl_run
Definition: cl_input.c:229
RulesChangeFunc
void RulesChangeFunc(void *self)
Definition: menu.c:2457
StartGame
static void StartGame(void)
Definition: menu.c:1952
s_player_rate_title
static menuseparator_s s_player_rate_title
Definition: menu.c:3423
ModelCallback
static void ModelCallback(void *unused)
Definition: menu.c:3461
s_startserver_dmoptions_action
static menuaction_s s_startserver_dmoptions_action
Definition: menu.c:2442
DownloadOptions_MenuKey
const char * DownloadOptions_MenuKey(int key)
Definition: menu.c:3324
CL_PingServers_f
void CL_PingServers_f(void)
Definition: cl_main.c:817
menucommon_s::type
int type
Definition: qmenu.h:66
refdef_t::areabits
byte * areabits
Definition: ref.h:130
K_MOUSE5
@ K_MOUSE5
Definition: keys.h:83
s_keys_attack_action
static menuaction_s s_keys_attack_action
Definition: menu.c:622
s_options_lookstrafe_box
static menulist_s s_options_lookstrafe_box
Definition: menu.c:1041
M_Menu_Main_f
void M_Menu_Main_f(void)
Definition: menu.c:494
K_AUX26
@ K_AUX26
Definition: keys.h:122
s_rules_box
static menulist_s s_rules_box
Definition: menu.c:2448
s_loadgame_actions
static menuaction_s s_loadgame_actions[MAX_SAVEGAMES]
Definition: menu.c:2092
M_Quit_Key
const char * M_Quit_Key(int key)
Definition: menu.c:3969
s_options_joystick_box
static menulist_s s_options_joystick_box
Definition: menu.c:1044
menu_out_sound
static char * menu_out_sound
Definition: menu.c:33
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:3415
menuslider_s::generic
menucommon_s generic
Definition: qmenu.h:95
K_AUX28
@ K_AUX28
Definition: keys.h:124
roguecredits
static const char * roguecredits[]
Definition: menu.c:1697
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:1972
model_s::flags
int flags
Definition: r_model.h:180
RateCallback
static void RateCallback(void *unused)
Definition: menu.c:3455
s_options_defaults_action
static menuaction_s s_options_defaults_action
Definition: menu.c:1033
CS_CDTRACK
#define CS_CDTRACK
Definition: q_shared.h:1126
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:178
K_AUX13
@ K_AUX13
Definition: keys.h:109
refexport_t::DrawFill
void(* DrawFill)(int x, int y, int w, int h, int c)
Definition: ref.h:198
s_options_console_action
static menulist_s s_options_console_action
Definition: menu.c:1049
xoffset
GLint GLint xoffset
Definition: qgl_win.c:118
Create_Savestrings
void Create_Savestrings(void)
Definition: menu.c:2097
s_powerups_box
static menulist_s s_powerups_box
Definition: menu.c:2815
M_Menu_SaveGame_f
void M_Menu_SaveGame_f(void)
Definition: menu.c:2246
M_Menu_StartServer_f
void M_Menu_StartServer_f(void)
Definition: menu.c:2794
cvar_s::string
char * string
Definition: q_shared.h:320
qboolean
qboolean
Definition: q_shared.h:56
x
GLint GLenum GLint x
Definition: qgl_win.c:116
viddef_t::width
int width
Definition: vid.h:29
i
int i
Definition: q_shared.c:305
PlayerConfig_MenuKey
const char * PlayerConfig_MenuKey(int key)
Definition: menu.c:3897
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:122
DF_INFINITE_AMMO
#define DF_INFINITE_AMMO
Definition: q_shared.h:1061
DMOptions_MenuInit
void DMOptions_MenuInit(void)
Definition: menu.c:2977
ControlsResetDefaultsFunc
static void ControlsResetDefaultsFunc(void *unused)
Definition: menu.c:1128
LoadGame_MenuInit
void LoadGame_MenuInit(void)
Definition: menu.c:2130
UpdateVolumeFunc
static void UpdateVolumeFunc(void *unused)
Definition: menu.c:1151
ClampCvar
static float ClampCvar(float min, float max, float value)
Definition: menu.c:1088
keybindings
char * keybindings[K_LAST]
Definition: keys.c:39
K_AUX18
@ K_AUX18
Definition: keys.h:114
K_AUX4
@ K_AUX4
Definition: keys.h:100
UpdateCDVolumeFunc
static void UpdateCDVolumeFunc(void *unused)
Definition: menu.c:1161
K_KP_LEFTARROW
@ K_KP_LEFTARROW
Definition: keys.h:63
K_AUX23
@ K_AUX23
Definition: keys.h:119
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:2272
s_options_customize_options_action
static menuaction_s s_options_customize_options_action
Definition: menu.c:1034
M_Quit_Draw
void M_Quit_Draw(void)
Definition: menu.c:3994
K_AUX2
@ K_AUX2
Definition: keys.h:98
EasyGameFunc
static void EasyGameFunc(void *data)
Definition: menu.c:1966
idcredits
static const char * idcredits[]
Definition: menu.c:1465
s_friendlyfire_box
static menulist_s s_friendlyfire_box
Definition: menu.c:2811
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
PlayerConfig_ScanDirectories
static qboolean PlayerConfig_ScanDirectories(void)
Definition: menu.c:3500
QMF_LEFT_JUSTIFY
#define QMF_LEFT_JUSTIFY
Definition: qmenu.h:45
viddef_t::height
int height
Definition: vid.h:29
s_stack_double_box
static menulist_s s_stack_double_box
Definition: menu.c:2830
DownloadOptions_MenuDraw
void DownloadOptions_MenuDraw(void)
Definition: menu.c:3319
client_state_t::cinematictime
int cinematictime
Definition: client.h:165
DownloadOptionsFunc
void DownloadOptionsFunc(void *self)
Definition: menu.c:3445
FS_NextPath
char * FS_NextPath(char *prevpath)
Definition: files.c:865
MAX_TOKEN_CHARS
#define MAX_TOKEN_CHARS
Definition: q_shared.h:71
credits_start_time
static int credits_start_time
Definition: menu.c:1461
s_keys_step_right_action
static menuaction_s s_keys_step_right_action
Definition: menu.c:630
creditsIndex
static char * creditsIndex[256]
Definition: menu.c:1463
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:156
refdef_t::rdflags
int rdflags
Definition: ref.h:128
s_game_menu
static menuframework_s s_game_menu
Definition: menu.c:1943
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
K_AUX8
@ K_AUX8
Definition: keys.h:104
DF_SPAWN_FARTHEST
#define DF_SPAWN_FARTHEST
Definition: q_shared.h:1057
s_options_invertmouse_box
static menulist_s s_options_invertmouse_box
Definition: menu.c:1039
width
GLint GLsizei width
Definition: qgl_win.c:115
keys_cursor
int keys_cursor
Definition: menu.c:618
K_AUX12
@ K_AUX12
Definition: keys.h:108
menuaction_s::generic
menucommon_s generic
Definition: qmenu.h:115
DF_NO_ITEMS
#define DF_NO_ITEMS
Definition: q_shared.h:1049
entity_s::flags
int flags
Definition: ref.h:76
SCR_DirtyScreen
void SCR_DirtyScreen(void)
Definition: cl_scrn.c:687
SaveGame_MenuInit
void SaveGame_MenuInit(void)
Definition: menu.c:2208
K_AUX11
@ K_AUX11
Definition: keys.h:107
DF_ALLOW_EXIT
#define DF_ALLOW_EXIT
Definition: q_shared.h:1060
Keys_MenuKey
static const char * Keys_MenuKey(int key)
Definition: menu.c:980
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:623
Menu_Center
void Menu_Center(menuframework_s *menu)
Definition: qmenu.c:340
HandednessCallback
static void HandednessCallback(void *unused)
Definition: menu.c:3450
cvar_s
Definition: q_shared.h:317
K_AUX17
@ K_AUX17
Definition: keys.h:113
s_credits_action
static menuaction_s s_credits_action
Definition: menu.c:1949
DF_FORCE_RESPAWN
#define DF_FORCE_RESPAWN
Definition: q_shared.h:1058
DF_FIXED_FOV
#define DF_FIXED_FOV
Definition: q_shared.h:1063
win_noalttab
static cvar_t * win_noalttab
Definition: menu.c:1029
s_startserver_menu
static menuframework_s s_startserver_menu
Definition: menu.c:2437
K_ENTER
@ K_ENTER
Definition: keys.h:26
key_menu
@ key_menu
Definition: client.h:220
SaveGameCallback
void SaveGameCallback(void *self)
Definition: menu.c:2193
freelook
cvar_t * freelook
Definition: cl_main.c:24
s_pmnames
static char * s_pmnames[MAX_PLAYERMODELS]
Definition: menu.c:3438
DF_NO_NUKES
#define DF_NO_NUKES
Definition: q_shared.h:1071
K_JOY3
@ K_JOY3
Definition: keys.h:90
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:633
s_allow_download_models_box
static menulist_s s_allow_download_models_box
Definition: menu.c:3215
viddef
viddef_t viddef
Definition: vid_dll.c:49
LookstrafeFunc
static void LookstrafeFunc(void *unused)
Definition: menu.c:1146
K_AUX29
@ K_AUX29
Definition: keys.h:125
refexport_t::EndFrame
void(* EndFrame)(void)
Definition: ref.h:209
j
GLint j
Definition: qgl_win.c:150
m_menudepth
int m_menudepth
Definition: menu.c:73
DMOptionsFunc
void DMOptionsFunc(void *self)
Definition: menu.c:2450
CustomizeControlsFunc
static void CustomizeControlsFunc(void *unused)
Definition: menu.c:1061
m_layers
menulayer_t m_layers[MAX_MENU_DEPTH]
Definition: menu.c:72
s_weapons_stay_box
static menulist_s s_weapons_stay_box
Definition: menu.c:2813
va
char * va(char *format,...)
Definition: q_shared.c:1050
s_keys_inv_next_action
static menuaction_s s_keys_inv_next_action
Definition: menu.c:643
s_options_cdshuffle_box
static menulist_s s_options_cdshuffle_box
Definition: menu.c:1046
M_Menu_Credits
void M_Menu_Credits(void)
NUM_CURSOR_FRAMES
#define NUM_CURSOR_FRAMES
Definition: menu.c:29
Menu_DrawString
void Menu_DrawString(int x, int y, const char *string)
Definition: qmenu.c:438
DF_INSTANT_ITEMS
#define DF_INSTANT_ITEMS
Definition: q_shared.h:1052
K_LEFTARROW
@ K_LEFTARROW
Definition: keys.h:35
Cvar_ForceSet
cvar_t * Cvar_ForceSet(char *var_name, char *value)
Definition: cvar.c:268
ControlsSetMenuItemValues
static void ControlsSetMenuItemValues(void)
Definition: menu.c:1095
K_AUX6
@ K_AUX6
Definition: keys.h:102
M_AddToServerList
void M_AddToServerList(netadr_t adr, char *info)
Definition: menu.c:2281
menufield_s::cursor
int cursor
Definition: qmenu.h:87
DF_NO_HEALTH
#define DF_NO_HEALTH
Definition: q_shared.h:1048
s_savegame_actions
static menuaction_s s_savegame_actions[MAX_SAVEGAMES]
Definition: menu.c:2191
K_AUX27
@ K_AUX27
Definition: keys.h:123
CDAudio_Play
void CDAudio_Play(int track, qboolean looping)
Definition: cd_win.c:182
K_AUX20
@ K_AUX20
Definition: keys.h:116
K_ESCAPE
@ K_ESCAPE
Definition: keys.h:27
M_Menu_Keys_f
void M_Menu_Keys_f(void)
Definition: menu.c:1015
refexport_t::DrawFadeScreen
void(* DrawFadeScreen)(void)
Definition: ref.h:199
s_armor_box
static menulist_s s_armor_box
Definition: menu.c:2821
M_Menu_DownloadOptions_f
void M_Menu_DownloadOptions_f(void)
Definition: menu.c:3329
Menu_Draw
void Menu_Draw(menuframework_s *menu)
Definition: qmenu.c:350
Game_MenuDraw
void Game_MenuDraw(void)
Definition: menu.c:2060
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:646
K_AUX21
@ K_AUX21
Definition: keys.h:117
menulayer_t::key
const char *(* key)(int k)
Definition: menu.c:69
menulayer_t
Definition: menu.c:66
s_keys_look_up_action
static menuaction_s s_keys_look_up_action
Definition: menu.c:632
menu_in_sound
static char * menu_in_sound
Definition: menu.c:31
s_joinserver_server_actions
static menuaction_s s_joinserver_server_actions[MAX_LOCAL_SERVERS]
Definition: menu.c:2270
s_teamplay_box
static menulist_s s_teamplay_box
Definition: menu.c:2818
MAX_LOCAL_SERVERS
#define MAX_LOCAL_SERVERS
Definition: menu.c:2264
menucommon_s::y
int y
Definition: qmenu.h:68
skin
cvar_t * skin
Definition: cl_main.c:95
M_Menu_Credits_f
void M_Menu_Credits_f(void)
Definition: menu.c:1880
creditsBuffer
static char * creditsBuffer
Definition: menu.c:1464
CL_Snd_Restart_f
void CL_Snd_Restart_f(void)
Definition: cl_main.c:1119
menucommon_s
Definition: qmenu.h:64
m_savevalid
qboolean m_savevalid[MAX_SAVEGAMES]
Definition: menu.c:2095
s_options_menu
static menuframework_s s_options_menu
Definition: menu.c:1032
rate_tbl
static int rate_tbl[]
Definition: menu.c:3441
Keys_MenuDraw
static void Keys_MenuDraw(void)
Definition: menu.c:974
timelimit
cvar_t * timelimit
Definition: g_main.c:40
s_loadgame_menu
static menuframework_s s_loadgame_menu
Definition: menu.c:2091
s_joinserver_menu
static menuframework_s s_joinserver_menu
Definition: menu.c:2266
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:3439
s_instant_powerups_box
static menulist_s s_instant_powerups_box
Definition: menu.c:2814
s_keys_move_down_action
static menuaction_s s_keys_move_down_action
Definition: menu.c:638
s_keys_mouse_look_action
static menuaction_s s_keys_mouse_look_action
Definition: menu.c:635
LoadGameCallback
void LoadGameCallback(void *self)
Definition: menu.c:2121
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:1054
JoystickFunc
static void JoystickFunc(void *unused)
Definition: menu.c:1056
K_JOY1
@ K_JOY1
Definition: keys.h:88
KeyCursorDrawFunc
static void KeyCursorDrawFunc(menuframework_s *menu)
Definition: menu.c:691
HardGameFunc
static void HardGameFunc(void *data)
Definition: menu.c:1978
K_AUX30
@ K_AUX30
Definition: keys.h:126
AddressBook_MenuKey
const char * AddressBook_MenuKey(int key)
Definition: menu.c:3379
s_keys_walk_forward_action
static menuaction_s s_keys_walk_forward_action
Definition: menu.c:624
s_options_compatibility_list
static menulist_s s_options_compatibility_list
Definition: menu.c:1048
DF_SAME_LEVEL
#define DF_SAME_LEVEL
Definition: q_shared.h:1053
Menu_ItemAtCursor
void * Menu_ItemAtCursor(menuframework_s *m)
Definition: qmenu.c:478
Menu_SelectItem
qboolean Menu_SelectItem(menuframework_s *s)
Definition: qmenu.c:486
M_PopMenu
void M_PopMenu(void)
Definition: menu.c:127
DF_QUAD_DROP
#define DF_QUAD_DROP
Definition: q_shared.h:1062
Menu_AdjustCursor
void Menu_AdjustCursor(menuframework_s *m, int dir)
Definition: qmenu.c:292
K_KP_RIGHTARROW
@ K_KP_RIGHTARROW
Definition: keys.h:65
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:482
s_no_mines_box
static menulist_s s_no_mines_box
Definition: menu.c:2828
key_game
@ key_game
Definition: client.h:220
entity_s::oldframe
int oldframe
Definition: ref.h:64
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:394
s_fixed_fov_box
static menulist_s s_fixed_fov_box
Definition: menu.c:2824
menuslider_s::maxvalue
float maxvalue
Definition: qmenu.h:98
K_AUX5
@ K_AUX5
Definition: keys.h:101
lookspring
cvar_t * lookspring
Definition: cl_main.c:78
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
M_Banner
static void M_Banner(char *name)
Definition: menu.c:75
_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:2812
lookstrafe
cvar_t * lookstrafe
Definition: cl_main.c:79
_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:636
s_no_nukes_box
static menulist_s s_no_nukes_box
Definition: menu.c:2829
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
cvar_s::value
float value
Definition: q_shared.h:324
m_game_cursor
static int m_game_cursor
Definition: menu.c:1941
PlayerConfig_MenuDraw
void PlayerConfig_MenuDraw(void)
Definition: menu.c:3838
VID_MenuDraw
void VID_MenuDraw(void)
Definition: vid_menu.c:405
Cvar_SetValue
void Cvar_SetValue(char *var_name, float value)
Definition: cvar.c:317
entity_s::backlerp
float backlerp
Definition: ref.h:69
K_JOY4
@ K_JOY4
Definition: keys.h:91
m_drawfunc
void(* m_drawfunc)(void)
Definition: menu.c:57
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:74
M_ForceMenuOff
void M_ForceMenuOff(void)
Definition: menu.c:117
ConsoleFunc
static void ConsoleFunc(void *unused)
Definition: menu.c:1182
UpdateSoundQualityFunc
static void UpdateSoundQualityFunc(void *unused)
Definition: menu.c:1202
M_Menu_DMOptions_f
void M_Menu_DMOptions_f(void)
Definition: menu.c:3197
key_console
@ key_console
Definition: client.h:220
Options_MenuInit
void Options_MenuInit(void)
Definition: menu.c:1228
credits
static const char ** credits
Definition: menu.c:1462
NULL
#define NULL
Definition: q_shared.h:60
refexport_t::DrawGetPicSize
void(* DrawGetPicSize)(int *w, int *h, char *name)
Definition: ref.h:195
FS_ListFiles
char ** FS_ListFiles(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
Definition: files.c:738
menucommon_s::cursor_offset
int cursor_offset
Definition: qmenu.h:70
CDAudio_RandomPlay
void CDAudio_RandomPlay(void)
Definition: cd_win.c:190
CalcFov
float CalcFov(float fov_x, float width, float height)
Definition: cl_view.c:416
local_server_netadr
static netadr_t local_server_netadr[MAX_LOCAL_SERVERS]
Definition: menu.c:2279
refdef_t::time
float time
Definition: ref.h:127
s_options_sensitivity_slider
static menuslider_s s_options_sensitivity_slider
Definition: menu.c:1035
xatcredits
static const char * xatcredits[]
Definition: menu.c:1556
s_hostname_field
static menufield_s s_hostname_field
Definition: menu.c:2446
JoinServerFunc
void JoinServerFunc(void *self)
Definition: menu.c:2308
MTYPE_ACTION
#define MTYPE_ACTION
Definition: qmenu.h:27
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
menuaction_s
Definition: qmenu.h:113
M_Menu_AddressBook_f
void M_Menu_AddressBook_f(void)
Definition: menu.c:3401
s_options_lookspring_box
static menulist_s s_options_lookspring_box
Definition: menu.c:1040
Con_ClearNotify
void Con_ClearNotify(void)
Definition: console.c:215
s_options_freelook_box
static menulist_s s_options_freelook_box
Definition: menu.c:1036
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:196
refdef_t::height
int height
Definition: ref.h:122
in_joystick
cvar_t * in_joystick
Definition: in_win.c:55
DF_NO_MINES
#define DF_NO_MINES
Definition: q_shared.h:1069
rate_names
static const char * rate_names[]
Definition: menu.c:3442
K_MOUSE3
@ K_MOUSE3
Definition: keys.h:81
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:176
K_AUX1
@ K_AUX1
Definition: keys.h:97
pmicmpfnc
static int pmicmpfnc(const void *_a, const void *_b)
Definition: menu.c:3654
dmoptions_statusbar
static char dmoptions_statusbar[128]
Definition: menu.c:2807
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:736
K_KP_ENTER
@ K_KP_ENTER
Definition: keys.h:69
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1192
s_keys_move_up_action
static menuaction_s s_keys_move_up_action
Definition: menu.c:637
s_health_box
static menulist_s s_health_box
Definition: menu.c:2816
s_save_game_action
static menuaction_s s_save_game_action
Definition: menu.c:1948
menulayer_t::draw
void(* draw)(void)
Definition: menu.c:68
CDAudio_Init
int CDAudio_Init(void)
name
cvar_t * name
Definition: cl_main.c:94
SaveGame_MenuDraw
void SaveGame_MenuDraw(void)
Definition: menu.c:2201
mapnames
static char ** mapnames
Definition: menu.c:2438
StartServer_MenuDraw
void StartServer_MenuDraw(void)
Definition: menu.c:2770
NullCursorDraw
void NullCursorDraw(void *self)
Definition: menu.c:2331
_tag_menuframework
Definition: qmenu.h:49
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
_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:1984
playermodelinfo_s::displayname
char displayname[MAX_DISPLAYNAME]
Definition: menu.c:3433
s_player_model_title
static menuseparator_s s_player_model_title
Definition: menu.c:3421
K_AUX19
@ K_AUX19
Definition: keys.h:115
menulist_s::curvalue
int curvalue
Definition: qmenu.h:108
s_options_crosshair_box
static menulist_s s_options_crosshair_box
Definition: menu.c:1042
K_KP_DEL
@ K_KP_DEL
Definition: keys.h:71
s_options_noalttab_box
static menulist_s s_options_noalttab_box
Definition: menu.c:1037
s_options_sfxvolume_slider
static menuslider_s s_options_sfxvolume_slider
Definition: menu.c:1043
s_keys_inv_use_action
static menuaction_s s_keys_inv_use_action
Definition: menu.c:640
y
GLint y
Definition: qgl_win.c:115
K_MOUSE2
@ K_MOUSE2
Definition: keys.h:80
re
refexport_t re
Definition: vid_dll.c:31
VID_MenuInit
void VID_MenuInit(void)
Definition: vid_menu.c:209
MouseSpeedFunc
static void MouseSpeedFunc(void *unused)
Definition: menu.c:1076
ystart
static int ystart
Definition: r_polyse.c:93
M_Menu_LoadGame_f
void M_Menu_LoadGame_f(void)
Definition: menu.c:2176
s_keys_step_left_action
static menuaction_s s_keys_step_left_action
Definition: menu.c:629
MTYPE_SLIDER
#define MTYPE_SLIDER
Definition: qmenu.h:25
s_keys_sidestep_action
static menuaction_s s_keys_sidestep_action
Definition: menu.c:631
s_maxclients_field
static menufield_s s_maxclients_field
Definition: menu.c:2445
entity_s::frame
int frame
Definition: ref.h:58
DrawKeyBindingFunc
static void DrawKeyBindingFunc(void *self)
Definition: menu.c:706
s_keys_help_computer_action
static menuaction_s s_keys_help_computer_action
Definition: menu.c:645
AddressBook_MenuInit
void AddressBook_MenuInit(void)
Definition: menu.c:3346
bind_grab
static int bind_grab
Definition: menu.c:619
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
K_JOY2
@ K_JOY2
Definition: keys.h:89
s_keys_run_action
static menuaction_s s_keys_run_action
Definition: menu.c:628
Menu_SetStatusBar
void Menu_SetStatusBar(menuframework_s *m, const char *string)
Definition: qmenu.c:510
s_download_title
static menuseparator_s s_download_title
Definition: menu.c:3212
Key_ClearTyping
void Key_ClearTyping(void)
Definition: console.c:64
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:132
s_allow_download_maps_box
static menulist_s s_allow_download_maps_box
Definition: menu.c:3214
s_force_respawn_box
static menulist_s s_force_respawn_box
Definition: menu.c:2820
FreeFileList
static void FreeFileList(char **list, int n)
Definition: menu.c:3467
M_FindKeysForCommand
static void M_FindKeysForCommand(char *command, int *twokeys)
Definition: menu.c:665
DownloadCallback
static void DownloadCallback(void *self)
Definition: menu.c:3219
CDShuffleFunc
static void CDShuffleFunc(void *unused)
Definition: menu.c:1156
s_player_hand_title
static menuseparator_s s_player_hand_title
Definition: menu.c:3422
DF_NO_STACK_DOUBLE
#define DF_NO_STACK_DOUBLE
Definition: q_shared.h:1070
playermodelinfo_s::skindisplaynames
char ** skindisplaynames
Definition: menu.c:3432
_tag_menuframework::x
int x
Definition: qmenu.h:51
m_pitch
cvar_t * m_pitch
Definition: cl_main.c:82
s_joinserver_search_action
static menuaction_s s_joinserver_search_action
Definition: menu.c:2268
MAX_SAVEGAMES
#define MAX_SAVEGAMES
Definition: menu.c:2087
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:134
DMOptions_MenuKey
const char * DMOptions_MenuKey(int key)
Definition: menu.c:3192
playermodelinfo_s::nskins
int nskins
Definition: menu.c:3431
Cbuf_InsertText
void Cbuf_InsertText(char *text)
Definition: cmd.c:114
menuslider_s
Definition: qmenu.h:93
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:590
M_Keydown
void M_Keydown(int key)
Definition: menu.c:4077
s_player_skin_title
static menuseparator_s s_player_skin_title
Definition: menu.c:3420
Game_MenuInit
void Game_MenuInit(void)
Definition: menu.c:1999
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
K_AUX22
@ K_AUX22
Definition: keys.h:118
menu_move_sound
static char * menu_move_sound
Definition: menu.c:32
K_TAB
@ K_TAB
Definition: keys.h:25
menufield_s
Definition: qmenu.h:82
Options_MenuDraw
void Options_MenuDraw(void)
Definition: menu.c:1422
RF_FULLBRIGHT
#define RF_FULLBRIGHT
Definition: q_shared.h:616
Field_Key
qboolean Field_Key(menufield_s *f, int key)
Definition: qmenu.c:139
K_UPARROW
@ K_UPARROW
Definition: keys.h:33
Com_ServerState
int Com_ServerState(void)
Definition: common.c:275
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:310
StartServer_MenuInit
void StartServer_MenuInit(void)
Definition: menu.c:2565
M_PushMenu
void M_PushMenu(void(*draw)(void), const char *(*key)(int k))
Definition: menu.c:83
menulist_s::itemnames
const char ** itemnames
Definition: qmenu.h:110
K_AUX7
@ K_AUX7
Definition: keys.h:103
M_Menu_PlayerConfig_f
void M_Menu_PlayerConfig_f(void)
Definition: menu.c:3932
Cbuf_Execute
void Cbuf_Execute(void)
Definition: cmd.c:194
K_AUX10
@ K_AUX10
Definition: keys.h:106
s_infinite_ammo_box
static menulist_s s_infinite_ammo_box
Definition: menu.c:2823
MTYPE_SPINCONTROL
#define MTYPE_SPINCONTROL
Definition: qmenu.h:28
m_savestrings
char m_savestrings[MAX_SAVEGAMES][32]
Definition: menu.c:2094
M_Menu_Video_f
void M_Menu_Video_f(void)
Definition: menu.c:1448
K_AUX32
@ K_AUX32
Definition: keys.h:128
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
refdef_t::fov_x
float fov_x
Definition: ref.h:123
M_Credits_MenuDraw
void M_Credits_MenuDraw(void)
Definition: menu.c:1812
M_DrawCursor
void M_DrawCursor(int x, int y, int f)
Definition: menu.c:315
SearchLocalGames
void SearchLocalGames(void)
Definition: menu.c:2335
refdef_t::fov_y
float fov_y
Definition: ref.h:123
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:627
s_pmi
static playermodelinfo_s s_pmi[MAX_PLAYERMODELS]
Definition: menu.c:3437
s_addressbook_menu
static menuframework_s s_addressbook_menu
Definition: menu.c:3343
client_state_t::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:178
CrosshairFunc
static void CrosshairFunc(void *unused)
Definition: menu.c:1051
KeyBindingFunc
static void KeyBindingFunc(void *self)
Definition: menu.c:736
Menu_SlideItem
void Menu_SlideItem(menuframework_s *s, int dir)
Definition: qmenu.c:515
LookspringFunc
static void LookspringFunc(void *unused)
Definition: menu.c:1141
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:142
netadr_t
Definition: qcommon.h:538
s_downloadoptions_menu
static menuframework_s s_downloadoptions_menu
Definition: menu.c:3210
s_allow_download_sounds_box
static menulist_s s_allow_download_sounds_box
Definition: menu.c:3217
s_options_cdvolume_box
static menulist_s s_options_cdvolume_box
Definition: menu.c:1045
MTYPE_FIELD
#define MTYPE_FIELD
Definition: qmenu.h:30
DMFlagCallback
static void DMFlagCallback(void *self)
Definition: menu.c:2834
LoadGame_MenuKey
const char * LoadGame_MenuKey(int key)
Definition: menu.c:2165
Game_MenuKey
const char * Game_MenuKey(int key)
Definition: menu.c:2067
DF_MODELTEAMS
#define DF_MODELTEAMS
Definition: q_shared.h:1055
m_main_cursor
static int m_main_cursor
Definition: menu.c:27
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:433
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:225
NUM_ADDRESSBOOK_ENTRIES
#define NUM_ADDRESSBOOK_ENTRIES
Definition: menu.c:3341
m_keyfunc
const char *(* m_keyfunc)(int key)
Definition: menu.c:58
refdef_t::width
int width
Definition: ref.h:122
s_keys_turn_left_action
static menuaction_s s_keys_turn_left_action
Definition: menu.c:626
s_multiplayer_menu
static menuframework_s s_multiplayer_menu
Definition: menu.c:506
m_entersound
qboolean m_entersound
Definition: menu.c:54
refexport_t::DrawChar
void(* DrawChar)(int x, int y, int c)
Definition: ref.h:193
s_timelimit_field
static menufield_s s_timelimit_field
Definition: menu.c:2443
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:3213
s_player_config_menu
static menuframework_s s_player_config_menu
Definition: menu.c:3414
K_AUX25
@ K_AUX25
Definition: keys.h:121
DF_NO_SPHERES
#define DF_NO_SPHERES
Definition: q_shared.h:1072
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:1989
K_AUX9
@ K_AUX9
Definition: keys.h:105
JoinServer_MenuKey
const char * JoinServer_MenuKey(int key)
Definition: menu.c:2418
SFF_HIDDEN
#define SFF_HIDDEN
Definition: q_shared.h:280
CL_Quit_f
void CL_Quit_f(void)
Definition: cl_main.c:399
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:641
refdef_t::entities
entity_t * entities
Definition: ref.h:135
K_RIGHTARROW
@ K_RIGHTARROW
Definition: keys.h:36
K_AUX14
@ K_AUX14
Definition: keys.h:110
K_DEL
@ K_DEL
Definition: keys.h:54
K_AUX24
@ K_AUX24
Definition: keys.h:120
refdef_t::x
int x
Definition: ref.h:122
s_allow_download_players_box
static menulist_s s_allow_download_players_box
Definition: menu.c:3216
M_Menu_Quit_f
void M_Menu_Quit_f(void)
Definition: menu.c:4003
cls
client_static_t cls
Definition: cl_main.c:105
Key_ClearStates
void Key_ClearStates(void)
Definition: keys.c:919
IconOfSkinExists
static qboolean IconOfSkinExists(char *skin, char **pcxfiles, int npcxfiles)
Definition: menu.c:3482
fraglimit
cvar_t * fraglimit
Definition: g_main.c:39
PlayerSetupFunc
static void PlayerSetupFunc(void *unused)
Definition: menu.c:519
K_MOUSE1
@ K_MOUSE1
Definition: keys.h:79
LoadGame_MenuDraw
void LoadGame_MenuDraw(void)
Definition: menu.c:2158
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
K_AUX15
@ K_AUX15
Definition: keys.h:111
hand
cvar_t * hand
Definition: cl_main.c:99
s_keys_center_view_action
static menuaction_s s_keys_center_view_action
Definition: menu.c:634
s_keys_menu
static menuframework_s s_keys_menu
Definition: menu.c:621
s_savegame_menu
static menuframework_s s_savegame_menu
Definition: menu.c:2089
menulist_s::generic
menucommon_s generic
Definition: qmenu.h:106
playermodelinfo_s
Definition: menu.c:3429
M_Menu_Game_f
void M_Menu_Game_f(void)
Definition: menu.c:2072
MTYPE_SEPARATOR
#define MTYPE_SEPARATOR
Definition: qmenu.h:29
Menu_AddItem
void Menu_AddItem(menuframework_s *menu, void *item)
Definition: qmenu.c:270
s_keys_inventory_action
static menuaction_s s_keys_inventory_action
Definition: menu.c:639
AddressBook_MenuDraw
void AddressBook_MenuDraw(void)
Definition: menu.c:3395
M_DrawCharacter
void M_DrawCharacter(int cx, int cy, int num)
Definition: menu.c:271
s_no_spheres_box
static menulist_s s_no_spheres_box
Definition: menu.c:2831
cl
client_state_t cl
Definition: cl_main.c:106
s_blankline
static menuseparator_s s_blankline
Definition: menu.c:1950
PlayerConfig_MenuInit
qboolean PlayerConfig_MenuInit(void)
Definition: menu.c:3676
s_fraglimit_field
static menufield_s s_fraglimit_field
Definition: menu.c:2444
s_player_download_action
static menuaction_s s_player_download_action
Definition: menu.c:3424
menucommon_s::parent
menuframework_s * parent
Definition: qmenu.h:69
DF_NO_ARMOR
#define DF_NO_ARMOR
Definition: q_shared.h:1059
K_BACKSPACE
@ K_BACKSPACE
Definition: keys.h:32
s_load_game_action
static menuaction_s s_load_game_action
Definition: menu.c:1947
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:282
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
SaveGame_MenuKey
const char * SaveGame_MenuKey(int key)
Definition: menu.c:2235
K_KP_DOWNARROW
@ K_KP_DOWNARROW
Definition: keys.h:67
s_spawn_farthest_box
static menulist_s s_spawn_farthest_box
Definition: menu.c:2817
SearchLocalGamesFunc
void SearchLocalGamesFunc(void *self)
Definition: menu.c:2355
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:1236
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:1429
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:182
s_addressbook_fields
static menufield_s s_addressbook_fields[NUM_ADDRESSBOOK_ENTRIES]
Definition: menu.c:3344
client.h
s_options_quality_list
static menulist_s s_options_quality_list
Definition: menu.c:1047
M_Menu_Options_f
void M_Menu_Options_f(void)
Definition: menu.c:1434
entity_s::angles
float angles[3]
Definition: ref.h:52
K_AUX16
@ K_AUX16
Definition: keys.h:112
s_keys_inv_prev_action
static menuaction_s s_keys_inv_prev_action
Definition: menu.c:642
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:283
s_player_model_box
static menulist_s s_player_model_box
Definition: menu.c:3416
M_UnbindCommand
static void M_UnbindCommand(char *command)
Definition: menu.c:647
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:3427
DF_NO_FRIENDLY_FIRE
#define DF_NO_FRIENDLY_FIRE
Definition: q_shared.h:1056
QMF_NUMBERSONLY
#define QMF_NUMBERSONLY
Definition: qmenu.h:47
JoinServer_MenuInit
void JoinServer_MenuInit(void)
Definition: menu.c:2360
s_easy_game_action
static menuaction_s s_easy_game_action
Definition: menu.c:1944
s_player_rate_box
static menulist_s s_player_rate_box
Definition: menu.c:3419
local_server_names
static char local_server_names[MAX_LOCAL_SERVERS][80]
Definition: menu.c:2276
client_static_t::realtime
int realtime
Definition: client.h:228
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
M_Draw
void M_Draw(void)
Definition: menu.c:4045
VID_MenuKey
const char * VID_MenuKey(int key)
Definition: vid_menu.c:436