mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-19 02:22:04 +00:00
280 lines
8.2 KiB
C
280 lines
8.2 KiB
C
//-----------------------------------------------------------------------------
|
|
//
|
|
// $Id$
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
//
|
|
// $Log$
|
|
// Revision 1.5 2002/01/11 19:48:30 jbravo
|
|
// Formatted the source in non DOS format.
|
|
//
|
|
// Revision 1.4 2001/12/31 16:28:42 jbravo
|
|
// I made a Booboo with the Log tag.
|
|
//
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
//Elder note: It appears that Quake 3 doesn't use this menu anymore.
|
|
/*
|
|
=======================================================================
|
|
|
|
SYSTEM CONFIGURATION MENU
|
|
|
|
=======================================================================
|
|
*/
|
|
|
|
#include "ui_local.h"
|
|
|
|
//Elder: removed
|
|
//#define ART_FRAMEL "menu/art/frame2_l"
|
|
//#define ART_FRAMER "menu/art/frame1_r"
|
|
#define ART_BACK0 "menu/art/back_0"
|
|
#define ART_BACK1 "menu/art/back_1"
|
|
|
|
#define ID_GRAPHICS 10
|
|
#define ID_DISPLAY 11
|
|
#define ID_SOUND 12
|
|
#define ID_NETWORK 13
|
|
#define ID_BACK 14
|
|
|
|
#define VERTICAL_SPACING 34
|
|
|
|
typedef struct {
|
|
menuframework_s menu;
|
|
|
|
//Blaze: Dont need this
|
|
// menutext_s banner;
|
|
// menubitmap_s framel;
|
|
// menubitmap_s framer;
|
|
//Elder: removed for new interface
|
|
// menutext_s multim;
|
|
// menutext_s setupm;
|
|
// menutext_s demom;
|
|
// menutext_s modsm;
|
|
// menutext_s exitm;
|
|
|
|
menutext_s graphics;
|
|
menutext_s display;
|
|
menutext_s sound;
|
|
menutext_s network;
|
|
menubitmap_s back;
|
|
} optionsmenu_t;
|
|
|
|
static optionsmenu_t s_options;
|
|
|
|
|
|
/*
|
|
=================
|
|
Options_Event
|
|
=================
|
|
*/
|
|
static void Options_Event( void* ptr, int event ) {
|
|
if( event != QM_ACTIVATED ) {
|
|
return;
|
|
}
|
|
|
|
switch( ((menucommon_s*)ptr)->id ) {
|
|
case ID_GRAPHICS:
|
|
UI_GraphicsOptionsMenu();
|
|
break;
|
|
|
|
case ID_DISPLAY:
|
|
UI_DisplayOptionsMenu();
|
|
break;
|
|
|
|
case ID_SOUND:
|
|
UI_SoundOptionsMenu();
|
|
break;
|
|
|
|
case ID_NETWORK:
|
|
UI_NetworkOptionsMenu();
|
|
break;
|
|
|
|
case ID_BACK:
|
|
UI_PopMenu();
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
===============
|
|
SystemConfig_Cache
|
|
===============
|
|
*/
|
|
void SystemConfig_Cache( void ) {
|
|
//Elder: removed
|
|
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
|
//trap_R_RegisterShaderNoMip( ART_FRAMER );
|
|
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
|
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
|
}
|
|
|
|
/*
|
|
===============
|
|
Options_MenuInit
|
|
===============
|
|
*/
|
|
void Options_MenuInit( void ) {
|
|
int y;
|
|
uiClientState_t cstate;
|
|
|
|
memset( &s_options, 0, sizeof(optionsmenu_t) );
|
|
|
|
SystemConfig_Cache();
|
|
s_options.menu.wrapAround = qtrue;
|
|
|
|
trap_GetClientState( &cstate );
|
|
if ( cstate.connState >= CA_CONNECTED ) {
|
|
s_options.menu.fullscreen = qfalse;
|
|
}
|
|
else {
|
|
s_options.menu.fullscreen = qtrue;
|
|
s_options.menu.showlogo = qtrue;
|
|
}
|
|
|
|
/* s_options.banner.generic.type = MTYPE_BTEXT;
|
|
s_options.banner.generic.flags = QMF_CENTER_JUSTIFY;
|
|
s_options.banner.generic.x = 320;
|
|
s_options.banner.generic.y = 16;
|
|
s_options.banner.string = "SYSTEM SETUP";
|
|
s_options.banner.color = color_white;
|
|
s_options.banner.style = UI_CENTER;
|
|
|
|
s_options.framel.generic.type = MTYPE_BITMAP;
|
|
s_options.framel.generic.name = ART_FRAMEL;
|
|
s_options.framel.generic.flags = QMF_INACTIVE;
|
|
s_options.framel.generic.x = 8;
|
|
s_options.framel.generic.y = 76;
|
|
s_options.framel.width = 256;
|
|
s_options.framel.height = 334;
|
|
|
|
s_options.framer.generic.type = MTYPE_BITMAP;
|
|
s_options.framer.generic.name = ART_FRAMER;
|
|
s_options.framer.generic.flags = QMF_INACTIVE;
|
|
s_options.framer.generic.x = 376;
|
|
s_options.framer.generic.y = 76;
|
|
s_options.framer.width = 256;
|
|
s_options.framer.height = 334;
|
|
*/
|
|
/*Elder: removed
|
|
s_options.multim.generic.type = MTYPE_PTEXT;
|
|
s_options.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
|
|
s_options.multim.generic.x = 120;
|
|
s_options.multim.generic.y = 3;
|
|
s_options.multim.string = "MULTIPLAYER";
|
|
s_options.multim.color = color_red;
|
|
s_options.multim.style = UI_CENTER | UI_DROPSHADOW;
|
|
|
|
s_options.setupm.generic.type = MTYPE_PTEXT;
|
|
s_options.setupm.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE|QMF_HIGHLIGHT;
|
|
s_options.setupm.generic.x = 280;
|
|
s_options.setupm.generic.y = 3;
|
|
s_options.setupm.string = "SETUP";
|
|
s_options.setupm.color = color_red;
|
|
s_options.setupm.style = UI_CENTER | UI_DROPSHADOW;
|
|
|
|
s_options.demom.generic.type = MTYPE_PTEXT;
|
|
s_options.demom.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
|
|
s_options.demom.generic.x = 390;
|
|
s_options.demom.generic.y = 3;
|
|
s_options.demom.string = "DEMOS";
|
|
s_options.demom.color = color_red;
|
|
s_options.demom.style = UI_CENTER | UI_DROPSHADOW;
|
|
|
|
s_options.modsm.generic.type = MTYPE_PTEXT;
|
|
s_options.modsm.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
|
|
s_options.modsm.generic.x = 500;
|
|
s_options.modsm.generic.y = 3;
|
|
s_options.modsm.string = "MODS";
|
|
s_options.modsm.color = color_red;
|
|
s_options.modsm.style = UI_CENTER | UI_DROPSHADOW;
|
|
|
|
s_options.exitm.generic.type = MTYPE_PTEXT;
|
|
s_options.exitm.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
|
|
s_options.exitm.generic.x = 590;
|
|
s_options.exitm.generic.y = 3;
|
|
s_options.exitm.string = "EXIT";
|
|
s_options.exitm.color = color_red;
|
|
s_options.exitm.style = UI_CENTER | UI_DROPSHADOW;
|
|
*/
|
|
y = 168;
|
|
s_options.graphics.generic.type = MTYPE_PTEXT;
|
|
s_options.graphics.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
|
s_options.graphics.generic.callback = Options_Event;
|
|
s_options.graphics.generic.id = ID_GRAPHICS;
|
|
s_options.graphics.generic.x = 320;
|
|
s_options.graphics.generic.y = y;
|
|
s_options.graphics.string = "GRAPHICS";
|
|
s_options.graphics.color = color_red;
|
|
s_options.graphics.style = UI_CENTER;
|
|
|
|
y += VERTICAL_SPACING;
|
|
s_options.display.generic.type = MTYPE_PTEXT;
|
|
s_options.display.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
|
s_options.display.generic.callback = Options_Event;
|
|
s_options.display.generic.id = ID_DISPLAY;
|
|
s_options.display.generic.x = 320;
|
|
s_options.display.generic.y = y;
|
|
s_options.display.string = "DISPLAY";
|
|
s_options.display.color = color_red;
|
|
s_options.display.style = UI_CENTER;
|
|
|
|
y += VERTICAL_SPACING;
|
|
s_options.sound.generic.type = MTYPE_PTEXT;
|
|
s_options.sound.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
|
s_options.sound.generic.callback = Options_Event;
|
|
s_options.sound.generic.id = ID_SOUND;
|
|
s_options.sound.generic.x = 320;
|
|
s_options.sound.generic.y = y;
|
|
s_options.sound.string = "SOUND";
|
|
s_options.sound.color = color_red;
|
|
s_options.sound.style = UI_CENTER;
|
|
|
|
y += VERTICAL_SPACING;
|
|
s_options.network.generic.type = MTYPE_PTEXT;
|
|
s_options.network.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
|
s_options.network.generic.callback = Options_Event;
|
|
s_options.network.generic.id = ID_NETWORK;
|
|
s_options.network.generic.x = 320;
|
|
s_options.network.generic.y = y;
|
|
s_options.network.string = "NETWORK";
|
|
s_options.network.color = color_red;
|
|
s_options.network.style = UI_CENTER;
|
|
|
|
s_options.back.generic.type = MTYPE_BITMAP;
|
|
s_options.back.generic.name = ART_BACK0;
|
|
s_options.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
|
s_options.back.generic.callback = Options_Event;
|
|
s_options.back.generic.id = ID_BACK;
|
|
s_options.back.generic.x = 0;
|
|
s_options.back.generic.y = 480-64;
|
|
s_options.back.width = 128;
|
|
s_options.back.height = 64;
|
|
s_options.back.focuspic = ART_BACK1;
|
|
|
|
// Menu_AddItem( &s_options.menu, ( void * ) &s_options.banner );
|
|
// Menu_AddItem( &s_options.menu, ( void * ) &s_options.framel );
|
|
// Menu_AddItem( &s_options.menu, ( void * ) &s_options.framer );
|
|
//Elder: removed
|
|
// Menu_AddItem( &s_options.menu, &s_options.multim );
|
|
// Menu_AddItem( &s_options.menu, &s_options.setupm );
|
|
// Menu_AddItem( &s_options.menu, &s_options.demom );
|
|
// Menu_AddItem( &s_options.menu, &s_options.modsm );
|
|
// Menu_AddItem( &s_options.menu, &s_options.exitm );
|
|
Menu_AddItem( &s_options.menu, ( void * ) &s_options.graphics );
|
|
Menu_AddItem( &s_options.menu, ( void * ) &s_options.display );
|
|
Menu_AddItem( &s_options.menu, ( void * ) &s_options.sound );
|
|
Menu_AddItem( &s_options.menu, ( void * ) &s_options.network );
|
|
Menu_AddItem( &s_options.menu, ( void * ) &s_options.back );
|
|
}
|
|
|
|
|
|
/*
|
|
===============
|
|
UI_SystemConfigMenu
|
|
===============
|
|
*/
|
|
void UI_SystemConfigMenu( void ) {
|
|
Options_MenuInit();
|
|
UI_PushMenu ( &s_options.menu );
|
|
}
|