icculus quake2 doxygen  1.0 dev
qmenu.c File Reference
#include <string.h>
#include <ctype.h>
#include "client.h"
#include "qmenu.h"

Go to the source code of this file.

Macros

#define RCOLUMN_OFFSET   16
 
#define LCOLUMN_OFFSET   -16
 
#define VID_WIDTH   viddef.width
 
#define VID_HEIGHT   viddef.height
 
#define Draw_Char   re.DrawChar
 
#define Draw_Fill   re.DrawFill
 
#define SLIDER_RANGE   10
 

Functions

static void Action_DoEnter (menuaction_s *a)
 
static void Action_Draw (menuaction_s *a)
 
static void Menu_DrawStatusBar (const char *string)
 
static void MenuList_Draw (menulist_s *l)
 
static void Separator_Draw (menuseparator_s *s)
 
static void Slider_DoSlide (menuslider_s *s, int dir)
 
static void Slider_Draw (menuslider_s *s)
 
static void SpinControl_Draw (menulist_s *s)
 
static void SpinControl_DoSlide (menulist_s *s, int dir)
 
qboolean Field_DoEnter (menufield_s *f)
 
void Field_Draw (menufield_s *f)
 
qboolean Field_Key (menufield_s *f, int key)
 
void Menu_AddItem (menuframework_s *menu, void *item)
 
void Menu_AdjustCursor (menuframework_s *m, int dir)
 
void Menu_Center (menuframework_s *menu)
 
void Menu_Draw (menuframework_s *menu)
 
void Menu_DrawString (int x, int y, const char *string)
 
void Menu_DrawStringDark (int x, int y, const char *string)
 
void Menu_DrawStringR2L (int x, int y, const char *string)
 
void Menu_DrawStringR2LDark (int x, int y, const char *string)
 
voidMenu_ItemAtCursor (menuframework_s *m)
 
qboolean Menu_SelectItem (menuframework_s *s)
 
void Menu_SetStatusBar (menuframework_s *m, const char *string)
 
void Menu_SlideItem (menuframework_s *s, int dir)
 
int Menu_TallySlots (menuframework_s *menu)
 

Variables

refexport_t re
 
viddef_t viddef
 

Macro Definition Documentation

◆ Draw_Char

#define Draw_Char   re.DrawChar

Definition at line 50 of file qmenu.c.

◆ Draw_Fill

#define Draw_Fill   re.DrawFill

Definition at line 53 of file qmenu.c.

◆ LCOLUMN_OFFSET

#define LCOLUMN_OFFSET   -16

Definition at line 39 of file qmenu.c.

◆ RCOLUMN_OFFSET

#define RCOLUMN_OFFSET   16

Definition at line 38 of file qmenu.c.

◆ SLIDER_RANGE

#define SLIDER_RANGE   10

Definition at line 611 of file qmenu.c.

◆ VID_HEIGHT

#define VID_HEIGHT   viddef.height

Definition at line 45 of file qmenu.c.

◆ VID_WIDTH

#define VID_WIDTH   viddef.width

Definition at line 44 of file qmenu.c.

Function Documentation

◆ Action_DoEnter()

void Action_DoEnter ( menuaction_s a)
static

Definition at line 55 of file qmenu.c.

56 {
57  if ( a->generic.callback )
58  a->generic.callback( a );
59 }

Referenced by Menu_SelectItem().

◆ Action_Draw()

void Action_Draw ( menuaction_s a)
static

Definition at line 61 of file qmenu.c.

62 {
63  if ( a->generic.flags & QMF_LEFT_JUSTIFY )
64  {
65  if ( a->generic.flags & QMF_GRAYED )
67  else
69  }
70  else
71  {
72  if ( a->generic.flags & QMF_GRAYED )
74  else
76  }
77  if ( a->generic.ownerdraw )
78  a->generic.ownerdraw( a );
79 }

Referenced by Menu_Draw().

◆ Field_DoEnter()

qboolean Field_DoEnter ( menufield_s f)

Definition at line 81 of file qmenu.c.

82 {
83  if ( f->generic.callback )
84  {
85  f->generic.callback( f );
86  return true;
87  }
88  return false;
89 }

Referenced by Menu_SelectItem().

◆ Field_Draw()

void Field_Draw ( menufield_s f)

Definition at line 91 of file qmenu.c.

92 {
93  int i;
94  char tempbuffer[128]="";
95 
96  if ( f->generic.name )
98 
99  strncpy( tempbuffer, f->buffer + f->visible_offset, f->visible_length );
100 
101  Draw_Char( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y - 4, 18 );
102  Draw_Char( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y + 4, 24 );
103 
104  Draw_Char( f->generic.x + f->generic.parent->x + 24 + f->visible_length * 8, f->generic.y + f->generic.parent->y - 4, 20 );
105  Draw_Char( f->generic.x + f->generic.parent->x + 24 + f->visible_length * 8, f->generic.y + f->generic.parent->y + 4, 26 );
106 
107  for ( i = 0; i < f->visible_length; i++ )
108  {
109  Draw_Char( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y - 4, 19 );
110  Draw_Char( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y + 4, 25 );
111  }
112 
113  Menu_DrawString( f->generic.x + f->generic.parent->x + 24, f->generic.y + f->generic.parent->y, tempbuffer );
114 
115  if ( Menu_ItemAtCursor( f->generic.parent ) == f )
116  {
117  int offset;
118 
119  if ( f->visible_offset )
120  offset = f->visible_length;
121  else
122  offset = f->cursor;
123 
124  if ( ( ( int ) ( Sys_Milliseconds() / 250 ) ) & 1 )
125  {
126  Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
127  f->generic.y + f->generic.parent->y,
128  11 );
129  }
130  else
131  {
132  Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
133  f->generic.y + f->generic.parent->y,
134  ' ' );
135  }
136  }
137 }

Referenced by Menu_Draw().

◆ Field_Key()

qboolean Field_Key ( menufield_s f,
int  key 
)

Definition at line 139 of file qmenu.c.

140 {
141  extern int keydown[];
142 
143  switch ( key )
144  {
145  case K_KP_SLASH:
146  key = '/';
147  break;
148  case K_KP_MINUS:
149  key = '-';
150  break;
151  case K_KP_PLUS:
152  key = '+';
153  break;
154  case K_KP_HOME:
155  key = '7';
156  break;
157  case K_KP_UPARROW:
158  key = '8';
159  break;
160  case K_KP_PGUP:
161  key = '9';
162  break;
163  case K_KP_LEFTARROW:
164  key = '4';
165  break;
166  case K_KP_5:
167  key = '5';
168  break;
169  case K_KP_RIGHTARROW:
170  key = '6';
171  break;
172  case K_KP_END:
173  key = '1';
174  break;
175  case K_KP_DOWNARROW:
176  key = '2';
177  break;
178  case K_KP_PGDN:
179  key = '3';
180  break;
181  case K_KP_INS:
182  key = '0';
183  break;
184  case K_KP_DEL:
185  key = '.';
186  break;
187  }
188 
189  if ( key > 127 )
190  {
191  switch ( key )
192  {
193  case K_DEL:
194  default:
195  return false;
196  }
197  }
198 
199  /*
200  ** support pasting from the clipboard
201  */
202  if ( ( toupper( key ) == 'V' && keydown[K_CTRL] ) ||
203  ( ( ( key == K_INS ) || ( key == K_KP_INS ) ) && keydown[K_SHIFT] ) )
204  {
205  char *cbd;
206 
207  if ( ( cbd = Sys_GetClipboardData() ) != 0 )
208  {
209  strtok( cbd, "\n\r\b" );
210 
211  strncpy( f->buffer, cbd, f->length - 1 );
212  f->cursor = strlen( f->buffer );
213  f->visible_offset = f->cursor - f->visible_length;
214  if ( f->visible_offset < 0 )
215  f->visible_offset = 0;
216 
217  free( cbd );
218  }
219  return true;
220  }
221 
222  switch ( key )
223  {
224  case K_KP_LEFTARROW:
225  case K_LEFTARROW:
226  case K_BACKSPACE:
227  if ( f->cursor > 0 )
228  {
229  memmove( &f->buffer[f->cursor-1], &f->buffer[f->cursor], strlen( &f->buffer[f->cursor] ) + 1 );
230  f->cursor--;
231 
232  if ( f->visible_offset )
233  {
234  f->visible_offset--;
235  }
236  }
237  break;
238 
239  case K_KP_DEL:
240  case K_DEL:
241  memmove( &f->buffer[f->cursor], &f->buffer[f->cursor+1], strlen( &f->buffer[f->cursor+1] ) + 1 );
242  break;
243 
244  case K_KP_ENTER:
245  case K_ENTER:
246  case K_ESCAPE:
247  case K_TAB:
248  return false;
249 
250  case K_SPACE:
251  default:
252  if ( !isdigit( key ) && ( f->generic.flags & QMF_NUMBERSONLY ) )
253  return false;
254 
255  if ( f->cursor < f->length )
256  {
257  f->buffer[f->cursor++] = key;
258  f->buffer[f->cursor] = 0;
259 
260  if ( f->cursor > f->visible_length )
261  {
262  f->visible_offset++;
263  }
264  }
265  }
266 
267  return true;
268 }

Referenced by Default_MenuKey().

◆ Menu_AddItem()

void Menu_AddItem ( menuframework_s menu,
void item 
)

Definition at line 270 of file qmenu.c.

271 {
272  if ( menu->nitems == 0 )
273  menu->nslots = 0;
274 
275  if ( menu->nitems < MAXMENUITEMS )
276  {
277  menu->items[menu->nitems] = item;
278  ( ( menucommon_s * ) menu->items[menu->nitems] )->parent = menu;
279  menu->nitems++;
280  }
281 
282  menu->nslots = Menu_TallySlots( menu );
283 }

Referenced by AddressBook_MenuInit(), DMOptions_MenuInit(), DownloadOptions_MenuInit(), Game_MenuInit(), JoinServer_MenuInit(), Keys_MenuInit(), LoadGame_MenuInit(), Multiplayer_MenuInit(), Options_MenuInit(), PlayerConfig_MenuInit(), SaveGame_MenuInit(), StartServer_MenuInit(), and VID_MenuInit().

◆ Menu_AdjustCursor()

void Menu_AdjustCursor ( menuframework_s m,
int  dir 
)

Definition at line 292 of file qmenu.c.

293 {
294  menucommon_s *citem;
295 
296  /*
297  ** see if it's in a valid spot
298  */
299  if ( m->cursor >= 0 && m->cursor < m->nitems )
300  {
301  if ( ( citem = Menu_ItemAtCursor( m ) ) != 0 )
302  {
303  if ( citem->type != MTYPE_SEPARATOR )
304  return;
305  }
306  }
307 
308  /*
309  ** it's not in a valid spot, so crawl in the direction indicated until we
310  ** find a valid spot
311  */
312  if ( dir == 1 )
313  {
314  while ( 1 )
315  {
316  citem = Menu_ItemAtCursor( m );
317  if ( citem )
318  if ( citem->type != MTYPE_SEPARATOR )
319  break;
320  m->cursor += dir;
321  if ( m->cursor >= m->nitems )
322  m->cursor = 0;
323  }
324  }
325  else
326  {
327  while ( 1 )
328  {
329  citem = Menu_ItemAtCursor( m );
330  if ( citem )
331  if ( citem->type != MTYPE_SEPARATOR )
332  break;
333  m->cursor += dir;
334  if ( m->cursor < 0 )
335  m->cursor = m->nitems - 1;
336  }
337  }
338 }

Referenced by Default_MenuKey(), Game_MenuDraw(), Keys_MenuDraw(), Multiplayer_MenuDraw(), Options_MenuDraw(), SaveGame_MenuDraw(), VID_MenuDraw(), and VID_MenuKey().

◆ Menu_Center()

void Menu_Center ( menuframework_s menu)

Definition at line 340 of file qmenu.c.

341 {
342  int height;
343 
344  height = ( ( menucommon_s * ) menu->items[menu->nitems-1])->y;
345  height += 10;
346 
347  menu->y = ( VID_HEIGHT - height ) / 2;
348 }

Referenced by DMOptions_MenuInit(), DownloadOptions_MenuInit(), Game_MenuInit(), JoinServer_MenuInit(), Keys_MenuInit(), Multiplayer_MenuInit(), StartServer_MenuInit(), and VID_MenuInit().

◆ Menu_Draw()

void Menu_Draw ( menuframework_s menu)

Definition at line 350 of file qmenu.c.

351 {
352  int i;
354 
355  /*
356  ** draw contents
357  */
358  for ( i = 0; i < menu->nitems; i++ )
359  {
360  switch ( ( ( menucommon_s * ) menu->items[i] )->type )
361  {
362  case MTYPE_FIELD:
363  Field_Draw( ( menufield_s * ) menu->items[i] );
364  break;
365  case MTYPE_SLIDER:
366  Slider_Draw( ( menuslider_s * ) menu->items[i] );
367  break;
368  case MTYPE_LIST:
369  MenuList_Draw( ( menulist_s * ) menu->items[i] );
370  break;
371  case MTYPE_SPINCONTROL:
372  SpinControl_Draw( ( menulist_s * ) menu->items[i] );
373  break;
374  case MTYPE_ACTION:
375  Action_Draw( ( menuaction_s * ) menu->items[i] );
376  break;
377  case MTYPE_SEPARATOR:
378  Separator_Draw( ( menuseparator_s * ) menu->items[i] );
379  break;
380  }
381  }
382 
383  item = Menu_ItemAtCursor( menu );
384 
385  if ( item && item->cursordraw )
386  {
387  item->cursordraw( item );
388  }
389  else if ( menu->cursordraw )
390  {
391  menu->cursordraw( menu );
392  }
393  else if ( item && item->type != MTYPE_FIELD )
394  {
395  if ( item->flags & QMF_LEFT_JUSTIFY )
396  {
397  Draw_Char( menu->x + item->x - 24 + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( Sys_Milliseconds()/250 ) & 1 ) );
398  }
399  else
400  {
401  Draw_Char( menu->x + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( Sys_Milliseconds()/250 ) & 1 ) );
402  }
403  }
404 
405  if ( item )
406  {
407  if ( item->statusbarfunc )
408  item->statusbarfunc( ( void * ) item );
409  else if ( item->statusbar )
410  Menu_DrawStatusBar( item->statusbar );
411  else
412  Menu_DrawStatusBar( menu->statusbar );
413 
414  }
415  else
416  {
417  Menu_DrawStatusBar( menu->statusbar );
418  }
419 }

Referenced by AddressBook_MenuDraw(), DMOptions_MenuDraw(), DownloadOptions_MenuDraw(), Game_MenuDraw(), JoinServer_MenuDraw(), Keys_MenuDraw(), LoadGame_MenuDraw(), Multiplayer_MenuDraw(), Options_MenuDraw(), PlayerConfig_MenuDraw(), SaveGame_MenuDraw(), StartServer_MenuDraw(), and VID_MenuDraw().

◆ Menu_DrawStatusBar()

void Menu_DrawStatusBar ( const char *  string)
static

Definition at line 421 of file qmenu.c.

422 {
423  if ( string )
424  {
425  int l = strlen( string );
426  int maxcol = VID_WIDTH / 8;
427  int col = maxcol / 2 - l / 2;
428 
429  Draw_Fill( 0, VID_HEIGHT-8, VID_WIDTH, 8, 4 );
430  Menu_DrawString( col*8, VID_HEIGHT - 8, string );
431  }
432  else
433  {
434  Draw_Fill( 0, VID_HEIGHT-8, VID_WIDTH, 8, 0 );
435  }
436 }

Referenced by Menu_Draw().

◆ Menu_DrawString()

void Menu_DrawString ( int  x,
int  y,
const char *  string 
)

Definition at line 438 of file qmenu.c.

439 {
440  unsigned i;
441 
442  for ( i = 0; i < strlen( string ); i++ )
443  {
444  Draw_Char( ( x + i*8 ), y, string[i] );
445  }
446 }

Referenced by Action_Draw(), DrawKeyBindingFunc(), Field_Draw(), Menu_DrawStatusBar(), and SpinControl_Draw().

◆ Menu_DrawStringDark()

void Menu_DrawStringDark ( int  x,
int  y,
const char *  string 
)

Definition at line 448 of file qmenu.c.

449 {
450  unsigned i;
451 
452  for ( i = 0; i < strlen( string ); i++ )
453  {
454  Draw_Char( ( x + i*8 ), y, string[i] + 128 );
455  }
456 }

Referenced by Action_Draw().

◆ Menu_DrawStringR2L()

void Menu_DrawStringR2L ( int  x,
int  y,
const char *  string 
)

Definition at line 458 of file qmenu.c.

459 {
460  unsigned i;
461 
462  for ( i = 0; i < strlen( string ); i++ )
463  {
464  Draw_Char( ( x - i*8 ), y, string[strlen(string)-i-1] );
465  }
466 }

Referenced by Action_Draw().

◆ Menu_DrawStringR2LDark()

void Menu_DrawStringR2LDark ( int  x,
int  y,
const char *  string 
)

Definition at line 468 of file qmenu.c.

469 {
470  unsigned i;
471 
472  for ( i = 0; i < strlen( string ); i++ )
473  {
474  Draw_Char( ( x - i*8 ), y, string[strlen(string)-i-1]+128 );
475  }
476 }

Referenced by Action_Draw(), Field_Draw(), MenuList_Draw(), Separator_Draw(), Slider_Draw(), and SpinControl_Draw().

◆ Menu_ItemAtCursor()

void* Menu_ItemAtCursor ( menuframework_s m)

Definition at line 478 of file qmenu.c.

479 {
480  if ( m->cursor < 0 || m->cursor >= m->nitems )
481  return 0;
482 
483  return m->items[m->cursor];
484 }

Referenced by Default_MenuKey(), Field_Draw(), Keys_MenuKey(), Menu_AdjustCursor(), Menu_Draw(), Menu_SelectItem(), and Menu_SlideItem().

◆ Menu_SelectItem()

qboolean Menu_SelectItem ( menuframework_s s)

Definition at line 486 of file qmenu.c.

487 {
489 
490  if ( item )
491  {
492  switch ( item->type )
493  {
494  case MTYPE_FIELD:
495  return Field_DoEnter( ( menufield_s * ) item ) ;
496  case MTYPE_ACTION:
498  return true;
499  case MTYPE_LIST:
500 // Menulist_DoEnter( ( menulist_s * ) item );
501  return false;
502  case MTYPE_SPINCONTROL:
503 // SpinControl_DoEnter( ( menulist_s * ) item );
504  return false;
505  }
506  }
507  return false;
508 }

Referenced by Default_MenuKey(), and VID_MenuKey().

◆ Menu_SetStatusBar()

void Menu_SetStatusBar ( menuframework_s m,
const char *  string 
)

Definition at line 510 of file qmenu.c.

511 {
512  m->statusbar = string;
513 }

Referenced by DMOptions_MenuInit(), KeyBindingFunc(), Keys_MenuInit(), Keys_MenuKey(), M_Menu_PlayerConfig_f(), and Multiplayer_MenuInit().

◆ Menu_SlideItem()

void Menu_SlideItem ( menuframework_s s,
int  dir 
)

Definition at line 515 of file qmenu.c.

516 {
518 
519  if ( item )
520  {
521  switch ( item->type )
522  {
523  case MTYPE_SLIDER:
524  Slider_DoSlide( ( menuslider_s * ) item, dir );
525  break;
526  case MTYPE_SPINCONTROL:
527  SpinControl_DoSlide( ( menulist_s * ) item, dir );
528  break;
529  }
530  }
531 }

Referenced by Default_MenuKey(), and VID_MenuKey().

◆ Menu_TallySlots()

int Menu_TallySlots ( menuframework_s menu)

Definition at line 533 of file qmenu.c.

534 {
535  int i;
536  int total = 0;
537 
538  for ( i = 0; i < menu->nitems; i++ )
539  {
540  if ( ( ( menucommon_s * ) menu->items[i] )->type == MTYPE_LIST )
541  {
542  int nitems = 0;
543  const char **n = ( ( menulist_s * ) menu->items[i] )->itemnames;
544 
545  while (*n)
546  nitems++, n++;
547 
548  total += nitems;
549  }
550  else
551  {
552  total++;
553  }
554  }
555 
556  return total;
557 }

Referenced by Menu_AddItem().

◆ MenuList_Draw()

void MenuList_Draw ( menulist_s l)
static

Definition at line 573 of file qmenu.c.

574 {
575  const char **n;
576  int y = 0;
577 
579 
580  n = l->itemnames;
581 
582  Draw_Fill( l->generic.x - 112 + l->generic.parent->x, l->generic.parent->y + l->generic.y + l->curvalue*10 + 10, 128, 10, 16 );
583  while ( *n )
584  {
585  Menu_DrawStringR2LDark( l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y + y + 10, *n );
586 
587  n++;
588  y += 10;
589  }
590 }

Referenced by Menu_Draw().

◆ Separator_Draw()

void Separator_Draw ( menuseparator_s s)
static

Definition at line 592 of file qmenu.c.

593 {
594  if ( s->generic.name )
595  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->generic.name );
596 }

Referenced by Menu_Draw().

◆ Slider_DoSlide()

void Slider_DoSlide ( menuslider_s s,
int  dir 
)
static

Definition at line 598 of file qmenu.c.

599 {
600  s->curvalue += dir;
601 
602  if ( s->curvalue > s->maxvalue )
603  s->curvalue = s->maxvalue;
604  else if ( s->curvalue < s->minvalue )
605  s->curvalue = s->minvalue;
606 
607  if ( s->generic.callback )
608  s->generic.callback( s );
609 }

Referenced by Menu_SlideItem().

◆ Slider_Draw()

void Slider_Draw ( menuslider_s s)
static

Definition at line 613 of file qmenu.c.

614 {
615  int i;
616 
617  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
618  s->generic.y + s->generic.parent->y,
619  s->generic.name );
620 
621  s->range = ( s->curvalue - s->minvalue ) / ( float ) ( s->maxvalue - s->minvalue );
622 
623  if ( s->range < 0)
624  s->range = 0;
625  if ( s->range > 1)
626  s->range = 1;
627  Draw_Char( s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, 128);
628  for ( i = 0; i < SLIDER_RANGE; i++ )
629  Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 129);
630  Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 130);
631  Draw_Char( ( int ) ( 8 + RCOLUMN_OFFSET + s->generic.parent->x + s->generic.x + (SLIDER_RANGE-1)*8 * s->range ), s->generic.y + s->generic.parent->y, 131);
632 }

Referenced by Menu_Draw().

◆ SpinControl_DoSlide()

void SpinControl_DoSlide ( menulist_s s,
int  dir 
)
static

Definition at line 646 of file qmenu.c.

647 {
648  s->curvalue += dir;
649 
650  if ( s->curvalue < 0 )
651  s->curvalue = 0;
652  else if ( s->itemnames[s->curvalue] == 0 )
653  s->curvalue--;
654 
655  if ( s->generic.callback )
656  s->generic.callback( s );
657 }

Referenced by Menu_SlideItem().

◆ SpinControl_Draw()

void SpinControl_Draw ( menulist_s s)
static

Definition at line 659 of file qmenu.c.

660 {
661  char buffer[100];
662 
663  if ( s->generic.name )
664  {
665  Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
666  s->generic.y + s->generic.parent->y,
667  s->generic.name );
668  }
669  if ( !strchr( s->itemnames[s->curvalue], '\n' ) )
670  {
671  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->itemnames[s->curvalue] );
672  }
673  else
674  {
675  strcpy( buffer, s->itemnames[s->curvalue] );
676  *strchr( buffer, '\n' ) = 0;
677  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, buffer );
678  strcpy( buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1 );
679  Menu_DrawString( RCOLUMN_OFFSET + s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y + 10, buffer );
680  }
681 }

Referenced by Menu_Draw().

Variable Documentation

◆ re

◆ viddef

viddef_t viddef

Definition at line 49 of file vid_dll.c.

K_KP_PLUS
@ K_KP_PLUS
Definition: keys.h:74
edict_s::s
entity_state_t s
Definition: g_local.h:964
keydown
qboolean keydown[K_LAST]
Definition: keys.c:44
menuseparator_s
Definition: qmenu.h:118
height
GLsizei height
Definition: qgl_win.c:69
menufield_s::visible_offset
int visible_offset
Definition: qmenu.h:90
RCOLUMN_OFFSET
#define RCOLUMN_OFFSET
Definition: qmenu.c:38
K_KP_UPARROW
@ K_KP_UPARROW
Definition: keys.h:61
Draw_Char
#define Draw_Char
Definition: qmenu.c:50
Field_DoEnter
qboolean Field_DoEnter(menufield_s *f)
Definition: qmenu.c:81
_tag_menuframework::items
void * items[64]
Definition: qmenu.h:56
VID_WIDTH
#define VID_WIDTH
Definition: qmenu.c:44
menufield_s::generic
menucommon_s generic
Definition: qmenu.h:84
menufield_s::visible_length
int visible_length
Definition: qmenu.h:89
K_KP_PGDN
@ K_KP_PGDN
Definition: keys.h:68
menucommon_s::type
int type
Definition: qmenu.h:66
_tag_menuframework::y
int y
Definition: qmenu.h:51
menufield_s::length
int length
Definition: qmenu.h:88
SpinControl_Draw
static void SpinControl_Draw(menulist_s *s)
Definition: qmenu.c:659
MAXMENUITEMS
#define MAXMENUITEMS
Definition: qmenu.h:23
x
GLint GLenum GLint x
Definition: qgl_win.c:116
i
int i
Definition: q_shared.c:305
K_KP_LEFTARROW
@ K_KP_LEFTARROW
Definition: keys.h:63
menucommon_s::flags
unsigned flags
Definition: qmenu.h:72
MenuList_Draw
static void MenuList_Draw(menulist_s *l)
Definition: qmenu.c:573
menucommon_s::x
int x
Definition: qmenu.h:68
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
QMF_LEFT_JUSTIFY
#define QMF_LEFT_JUSTIFY
Definition: qmenu.h:45
_tag_menuframework::statusbar
const char * statusbar
Definition: qmenu.h:58
menucommon_s::ownerdraw
void(* ownerdraw)(void *self)
Definition: qmenu.h:78
menuaction_s::generic
menucommon_s generic
Definition: qmenu.h:115
Menu_DrawStringR2L
void Menu_DrawStringR2L(int x, int y, const char *string)
Definition: qmenu.c:458
Menu_DrawStringDark
void Menu_DrawStringDark(int x, int y, const char *string)
Definition: qmenu.c:448
K_KP_HOME
@ K_KP_HOME
Definition: keys.h:60
K_ENTER
@ K_ENTER
Definition: keys.h:26
QMF_GRAYED
#define QMF_GRAYED
Definition: qmenu.h:46
K_KP_INS
@ K_KP_INS
Definition: keys.h:70
Menu_DrawStringR2LDark
void Menu_DrawStringR2LDark(int x, int y, const char *string)
Definition: qmenu.c:468
Menu_DrawString
void Menu_DrawString(int x, int y, const char *string)
Definition: qmenu.c:438
K_LEFTARROW
@ K_LEFTARROW
Definition: keys.h:35
K_KP_MINUS
@ K_KP_MINUS
Definition: keys.h:73
menufield_s::cursor
int cursor
Definition: qmenu.h:87
K_ESCAPE
@ K_ESCAPE
Definition: keys.h:27
Action_DoEnter
static void Action_DoEnter(menuaction_s *a)
Definition: qmenu.c:55
edict_s::item
gitem_t * item
Definition: g_local.h:1104
Draw_Fill
#define Draw_Fill
Definition: qmenu.c:53
menucommon_s::y
int y
Definition: qmenu.h:68
menucommon_s
Definition: qmenu.h:64
menulist_s
Definition: qmenu.h:104
MTYPE_LIST
#define MTYPE_LIST
Definition: qmenu.h:26
Menu_ItemAtCursor
void * Menu_ItemAtCursor(menuframework_s *m)
Definition: qmenu.c:478
K_KP_RIGHTARROW
@ K_KP_RIGHTARROW
Definition: keys.h:65
menucommon_s::callback
void(* callback)(void *self)
Definition: qmenu.h:76
_tag_menuframework::cursordraw
void(* cursordraw)(struct _tag_menuframework *m)
Definition: qmenu.h:60
_tag_menuframework::cursor
int cursor
Definition: qmenu.h:52
K_INS
@ K_INS
Definition: keys.h:53
K_CTRL
@ K_CTRL
Definition: keys.h:39
VID_HEIGHT
#define VID_HEIGHT
Definition: qmenu.c:45
K_KP_END
@ K_KP_END
Definition: keys.h:66
MTYPE_ACTION
#define MTYPE_ACTION
Definition: qmenu.h:27
menuaction_s
Definition: qmenu.h:113
Slider_DoSlide
static void Slider_DoSlide(menuslider_s *s, int dir)
Definition: qmenu.c:598
K_KP_ENTER
@ K_KP_ENTER
Definition: keys.h:69
SLIDER_RANGE
#define SLIDER_RANGE
Definition: qmenu.c:611
_tag_menuframework::nitems
int nitems
Definition: qmenu.h:54
menulist_s::curvalue
int curvalue
Definition: qmenu.h:108
K_KP_DEL
@ K_KP_DEL
Definition: keys.h:71
y
GLint y
Definition: qgl_win.c:115
SpinControl_DoSlide
static void SpinControl_DoSlide(menulist_s *s, int dir)
Definition: qmenu.c:646
MTYPE_SLIDER
#define MTYPE_SLIDER
Definition: qmenu.h:25
Menu_DrawStatusBar
static void Menu_DrawStatusBar(const char *string)
Definition: qmenu.c:421
Field_Draw
void Field_Draw(menufield_s *f)
Definition: qmenu.c:91
LCOLUMN_OFFSET
#define LCOLUMN_OFFSET
Definition: qmenu.c:39
_tag_menuframework::x
int x
Definition: qmenu.h:51
menuslider_s
Definition: qmenu.h:93
menucommon_s::name
const char * name
Definition: qmenu.h:67
K_KP_SLASH
@ K_KP_SLASH
Definition: keys.h:72
K_TAB
@ K_TAB
Definition: keys.h:25
menufield_s
Definition: qmenu.h:82
menulist_s::itemnames
const char ** itemnames
Definition: qmenu.h:110
MTYPE_SPINCONTROL
#define MTYPE_SPINCONTROL
Definition: qmenu.h:28
K_SHIFT
@ K_SHIFT
Definition: keys.h:40
K_SPACE
@ K_SPACE
Definition: keys.h:28
K_KP_5
@ K_KP_5
Definition: keys.h:64
K_KP_PGUP
@ K_KP_PGUP
Definition: keys.h:62
_tag_menuframework::nslots
int nslots
Definition: qmenu.h:55
MTYPE_FIELD
#define MTYPE_FIELD
Definition: qmenu.h:30
Separator_Draw
static void Separator_Draw(menuseparator_s *s)
Definition: qmenu.c:592
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
K_DEL
@ K_DEL
Definition: keys.h:54
menulist_s::generic
menucommon_s generic
Definition: qmenu.h:106
Menu_TallySlots
int Menu_TallySlots(menuframework_s *menu)
Definition: qmenu.c:533
MTYPE_SEPARATOR
#define MTYPE_SEPARATOR
Definition: qmenu.h:29
Sys_GetClipboardData
char * Sys_GetClipboardData(void)
Definition: sys_win.c:401
gitem_s::flags
int flags
Definition: g_local.h:253
menucommon_s::parent
menuframework_s * parent
Definition: qmenu.h:69
K_BACKSPACE
@ K_BACKSPACE
Definition: keys.h:32
K_KP_DOWNARROW
@ K_KP_DOWNARROW
Definition: keys.h:67
menufield_s::buffer
char buffer[80]
Definition: qmenu.h:86
QMF_NUMBERSONLY
#define QMF_NUMBERSONLY
Definition: qmenu.h:47
Action_Draw
static void Action_Draw(menuaction_s *a)
Definition: qmenu.c:61
Slider_Draw
static void Slider_Draw(menuslider_s *s)
Definition: qmenu.c:613