Elder: Made a LOT of changes to the UI -

new media also required so don't run it without getting the new alpha
pak from the FTP (which will be available by Friday June 8, 2001)

This is still in major development.
Things will change.
This commit is contained in:
Victor Chow 2001-06-08 04:27:31 +00:00
parent 98f7c6b633
commit 59c64315e3
19 changed files with 3010 additions and 844 deletions

View file

@ -1,4 +1,5 @@
set path=C:\quake3\bin_nt;%PATH%
rem Vic removed path set
rem set path=C:\quake3\bin_nt;%PATH%
rem The following line is to circumvent MS Platform SDK install crap
set include=
mkdir vm
@ -94,7 +95,6 @@ set cc=call ..\compile.bat
%cc% ../ui_mods.c
@if errorlevel 1 goto quit
q3asm -f ../ui
:quit
cd ..

View file

@ -176,6 +176,113 @@ static int propMap[128][3] = {
{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},
{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},
//Elder: new map
{0, 0, PROP_SPACE_WIDTH}, // SPACE
{3, 120, 8}, // !
{145, 168, 9}, // "
{38, 120, 15}, // #
{54, 120, 26}, // $
{81, 120, 21}, // %
{138, 120, 26}, // &
{128, 168, 5}, // '
{207, 120, 9}, // (
{228, 120, 9}, // )
{182, 120, 12}, // *
{30, 144, 15}, // +
{74, 168, 7}, // ,
{37, 96, 10}, // -
{98, 168, 8}, // .
{118, 144, 19}, // /
{230, 72, 25}, // 0
{1, 72, 21}, // 1
{26, 72, 25}, // 2
{52, 72, 25}, // 3
{78, 72, 24}, // 4
{102, 72, 26}, // 5
{128, 72, 25}, // 6
{153, 72, 25}, // 7
{178, 72, 26}, // 8
{204, 72, 25}, // 9
{55, 168, 8}, // :
{29,168, 9}, // ;
{195, 168, 14}, // <
{59, 96, 19}, // =
{219, 168, 14}, // >
{165, 168, 24}, // ?
{14, 120, 20}, // @
{1, 0, 24}, // A
{26, 0, 24}, // B
{51, 0, 24}, // C
{77, 0, 24}, // D
{103, 0, 24}, // E
{127, 0, 24}, // F
{152, 0, 24}, // G
{178, 0, 24}, // H
{203, 0, 25}, // I
{229, 0, 24}, // J
{1, 24, 25}, // K
{27, 24, 20}, // L
{52, 24, 24}, // M
{78, 24, 24}, // N
{103, 24, 24}, // O
{128, 24, 24}, // P
{153, 24, 24}, // Q
{179, 24, 24}, // R
{205, 24, 24}, // S
{233, 24, 20}, // T
{1, 48, 25}, // U
{29, 48, 22}, // V
{54, 48, 22}, // W
{77, 48, 25}, // X
{103, 48, 24}, // Y
{128, 48, 25}, // Z
{55, 144, 13}, // [
{102, 144, 10}, // '\'
{75, 144, 13}, // ]
{115, 128, 13}, // ^ Elder: fix me in tga!!
{2, 144, 15}, // _
{134, 181, 5}, // '
//Elder: note - lowercase
{1, 0, 24}, // A
{26, 0, 24}, // B
{51, 0, 24}, // C
{77, 0, 24}, // D
{103, 0, 24}, // E
{127, 0, 24}, // F
{152, 0, 24}, // G
{178, 0, 24}, // H
{203, 0, 25}, // I
{229, 0, 24}, // J
{1, 24, 25}, // K
{27, 24, 20}, // L
{52, 24, 24}, // M
{78, 24, 24}, // N
{103, 24, 24}, // O
{128, 24, 24}, // P
{153, 24, 24}, // Q
{179, 24, 24}, // R
{205, 24, 24}, // S
{233, 24, 20}, // T
{1, 48, 25}, // U
{29, 48, 22}, // V
{54, 48, 22}, // W
{77, 48, 25}, // X
{103, 48, 24}, // Y
{128, 48, 25}, // Z
{148, 144, 11}, // {
{5, 168, 10}, // |
{169, 144, 11}, // }
{85, 96, 14}, // ~
{0, 0, -1} // DEL
};
/*Elder: old prop map
{0, 0, PROP_SPACE_WIDTH}, // SPACE
{11, 122, 7}, // !
{154, 181, 14}, // "
@ -278,7 +385,7 @@ static int propMap[128][3] = {
{79, 93, 17}, // ~
{0, 0, -1} // DEL
};
*/
static int propMapB[26][3] = {
{11, 12, 33},
{49, 12, 31},

View file

@ -12,11 +12,17 @@ CD KEY MENU
#include "ui_local.h"
#define ART_FRAME "menu/art/cut_frame"
#define ART_ACCEPT0 "menu/art/accept_0"
#define ART_ACCEPT1 "menu/art/accept_1"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
//#define ART_FRAME "menu/art/cut_frame"
//#define ART_ACCEPT0 "menu/art/accept_0"
//#define ART_ACCEPT1 "menu/art/accept_1"
#define ART_ACCEPT0 "menu/art/rq3-menu-go.tga"
#define ART_ACCEPT1 "menu/art/rq3-menu-go-focus.tga"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
//Elder: RQ3 Stuff
#define RQ3_SETUP_ICON "menu/art/rq3-setup-cdkey.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.jpg"
#define ID_CDKEY 10
#define ID_ACCEPT 11
@ -27,12 +33,18 @@ typedef struct {
menuframework_s menu;
// menutext_s banner;
menubitmap_s frame;
// menubitmap_s frame;
menufield_s cdkey;
menubitmap_s accept;
menubitmap_s back;
//Elder: RQ3 stuff
menubitmap_s rq3_setupicon;
menubitmap_s rq3_setuptitle;
menutext_s rq3_statustext;
} cdkeyMenuInfo_t;
static cdkeyMenuInfo_t cdkeyMenuInfo;
@ -44,24 +56,59 @@ UI_CDKeyMenu_Event
===============
*/
static void UI_CDKeyMenu_Event( void *ptr, int event ) {
if( event != QM_ACTIVATED ) {
return;
//Elder: Added status messages on event focus
if ( event == QM_LOSTFOCUS ) {
cdkeyMenuInfo.rq3_statustext.string = "";
}
else if( event == QM_GOTFOCUS ) {
//get menu item id
switch( ((menucommon_s*)ptr)->id ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_ACCEPT:
if( cdkeyMenuInfo.cdkey.field.buffer[0] ) {
trap_SetCDKey( cdkeyMenuInfo.cdkey.field.buffer );
case ID_ACCEPT:
cdkeyMenuInfo.rq3_statustext.string = "Accept CD key";
break;
case ID_BACK:
cdkeyMenuInfo.rq3_statustext.string = "Return to setup menu";
break;
default:
cdkeyMenuInfo.rq3_statustext.string = "";
break;
}
UI_PopMenu();
break;
case ID_BACK:
UI_PopMenu();
break;
}
else if ( event == QM_ACTIVATED ) {
cdkeyMenuInfo.rq3_statustext.string = "";
switch( ((menucommon_s*)ptr)->id ) {
case ID_ACCEPT:
if( cdkeyMenuInfo.cdkey.field.buffer[0] ) {
trap_SetCDKey( cdkeyMenuInfo.cdkey.field.buffer );
}
UI_PopMenu();
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
}
/*
===============
Added by Elder
UI_Mods_MenuDraw
===============
*/
static void UI_CDKeyMenu_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &cdkeyMenuInfo.menu );
}
/*
=================
@ -153,7 +200,9 @@ static void UI_CDKeyMenu_DrawKey( void *self ) {
UI_DrawProportionalString( 320, 376, "Please enter your CD Key", UI_CENTER|UI_SMALLFONT, color_yellow );
}
else if ( val == 0 ) {
UI_DrawProportionalString( 320, 376, "The CD Key appears to be valid, thank you", UI_CENTER|UI_SMALLFONT, color_white );
UI_DrawProportionalString( 320, 376, "The CD Key appears to be valid", UI_CENTER|UI_SMALLFONT, color_white );
//Elder: moved around
UI_DrawProportionalString( 320, 376 + SMALLCHAR_HEIGHT, "Thank you", UI_CENTER|UI_SMALLFONT, color_white );
}
else {
UI_DrawProportionalString( 320, 376, "The CD Key is not valid", UI_CENTER|UI_SMALLFONT, color_red );
@ -172,6 +221,7 @@ static void UI_CDKeyMenu_Init( void ) {
UI_CDKeyMenu_Cache();
memset( &cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo) );
cdkeyMenuInfo.menu.draw = UI_CDKeyMenu_MenuDraw;
cdkeyMenuInfo.menu.wrapAround = qtrue;
cdkeyMenuInfo.menu.fullscreen = qtrue;
cdkeyMenuInfo.menu.showlogo = qtrue;
@ -183,6 +233,7 @@ static void UI_CDKeyMenu_Init( void ) {
cdkeyMenuInfo.banner.color = color_white;
cdkeyMenuInfo.banner.style = UI_CENTER;
*/
/*
cdkeyMenuInfo.frame.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.frame.generic.name = ART_FRAME;
cdkeyMenuInfo.frame.generic.flags = QMF_INACTIVE;
@ -190,6 +241,25 @@ static void UI_CDKeyMenu_Init( void ) {
cdkeyMenuInfo.frame.generic.y = 118;
cdkeyMenuInfo.frame.width = 359;
cdkeyMenuInfo.frame.height = 256;
*/
//Elder: Info for setup icon
cdkeyMenuInfo.rq3_setupicon.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.rq3_setupicon.generic.name = RQ3_SETUP_ICON;
cdkeyMenuInfo.rq3_setupicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
cdkeyMenuInfo.rq3_setupicon.generic.x = 0;
cdkeyMenuInfo.rq3_setupicon.generic.y = 4;
cdkeyMenuInfo.rq3_setupicon.width = RQ3_ICON_WIDTH;
cdkeyMenuInfo.rq3_setupicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
cdkeyMenuInfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
cdkeyMenuInfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
cdkeyMenuInfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
cdkeyMenuInfo.rq3_setuptitle.generic.x = 64;
cdkeyMenuInfo.rq3_setuptitle.generic.y = 12;
cdkeyMenuInfo.rq3_setuptitle.width = 256;
cdkeyMenuInfo.rq3_setuptitle.height = 32;
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
cdkeyMenuInfo.cdkey.generic.name = "CD Key:";
@ -205,10 +275,10 @@ static void UI_CDKeyMenu_Init( void ) {
cdkeyMenuInfo.accept.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.accept.generic.x = 640;
cdkeyMenuInfo.accept.generic.y = 480-64;
cdkeyMenuInfo.accept.width = 128;
cdkeyMenuInfo.accept.height = 64;
cdkeyMenuInfo.accept.generic.x = 635;
cdkeyMenuInfo.accept.generic.y = 480-44;
cdkeyMenuInfo.accept.width = 64;
cdkeyMenuInfo.accept.height = 32;
cdkeyMenuInfo.accept.focuspic = ART_ACCEPT1;
cdkeyMenuInfo.back.generic.type = MTYPE_BITMAP;
@ -216,14 +286,17 @@ static void UI_CDKeyMenu_Init( void ) {
cdkeyMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
cdkeyMenuInfo.back.generic.id = ID_BACK;
cdkeyMenuInfo.back.generic.callback = UI_CDKeyMenu_Event;
cdkeyMenuInfo.back.generic.x = 0;
cdkeyMenuInfo.back.generic.y = 480-64;
cdkeyMenuInfo.back.width = 128;
cdkeyMenuInfo.back.height = 64;
cdkeyMenuInfo.back.generic.x = 8;
cdkeyMenuInfo.back.generic.y = 480-44;
cdkeyMenuInfo.back.width = 32;
cdkeyMenuInfo.back.height = 32;
cdkeyMenuInfo.back.focuspic = ART_BACK1;
// Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.banner );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.frame );
//Elder: removed
// Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.frame );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.rq3_setupicon );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.rq3_setuptitle );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey );
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept );
if( uis.menusp ) {
@ -247,7 +320,10 @@ void UI_CDKeyMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_ACCEPT1 );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( ART_FRAME );
//Elder: added
trap_R_RegisterShaderNoMip( RQ3_SETUP_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
//trap_R_RegisterShaderNoMip( ART_FRAME );
}

View file

@ -11,8 +11,8 @@ CONFIRMATION MENU
#include "ui_local.h"
#define ART_CONFIRM_FRAME "menu/art/cut_frame"
//Elder: Removed for now
//#define ART_CONFIRM_FRAME "menu/art/cut_frame"
#define ID_CONFIRM_NO 10
#define ID_CONFIRM_YES 11
@ -96,7 +96,13 @@ ConfirmMenu_Draw
=================
*/
static void ConfirmMenu_Draw( void ) {
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
//UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
UI_DrawProportionalString( 320, 204, s_confirm.question, UI_CENTER|UI_INVERSE, color_red );
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );
@ -114,7 +120,8 @@ ConfirmMenu_Cache
=================
*/
void ConfirmMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_CONFIRM_FRAME );
//Elder: Removed
//trap_R_RegisterShaderNoMip( ART_CONFIRM_FRAME );
}

View file

@ -1,16 +1,52 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
/*
=======================================================================
===========================================
SCROLLING CREDITS CODE
Author: Iain McGinniss
Company: AZ Development Team
Produced for Code 3 Arena, feel free
to use this code in your own projects
just please remember to give credit
to AZ Development team for this.
That should be easy now with this
new credits system!
===========================================
CREDITS
=======================================================================
Elder's modifications
-Letterbox simulation
-Fixed width string drawing
-Movie style "character -- actor" layout
-Configurable fade-to-color sequence
*/
// INCLUDE FILES
#include "ui_local.h"
// CONSTANT DEFINITIONS
#define SCROLLSPEED 2.00 // The scrolling speed in pixels per second.
// modify as appropriate for our credits
#define BACKGROUND_SHADER
// uncomment this to use a background shader, otherwise a solid color
// defined in the vec4_t "color_background" is filled to the screen
//Elder: added to choose drawFixed
#define PROPWIDTH 0
#define FIXEDWIDTH 1
#define RIGHT_JUSTIFY_POSITION 310
#define LEFT_JUSTIFY_POSITION 330
//Elder: fader code parameters - plus nicer to access vec4_t with COLOR_*
#define FADE_START_TIME 5000
#define FADE_DURATION 10000
#define COLOR_R 0
#define COLOR_G 1
#define COLOR_B 2
#define COLOR_A 3
// STRUCTURES
typedef struct {
menuframework_s menu;
@ -18,6 +54,209 @@ typedef struct {
static creditsmenu_t s_credits;
int starttime = 0; // game time at which credits are started
float mvolume; // records the original music volume level, as we will
// modify it for the credits
//Elder: fader variables
static float fade = 0.00;
//Elder: Fade color - leave alpha component at 0.00
vec4_t color_fader = {0.00, 0.00, 0.00, 0.00};
vec4_t color_background = {0.00, 0.00, 0.00, 1.00};
// these are just example colours that are used in credits[]
vec4_t color_headertext = {0.80, 0.00, 0.00, 1.00};
vec4_t color_maintext = {1.00, 1.00, 1.00, 1.00};
// definition of the background shader pointer
qhandle_t BackgroundShader;
/*
Constants to be used for the "style" field of the cr_line credits[] structure...
UI_LEFT - Align to the left of the screen
UI_CENTER - Align to the center
UI_RIGHT - Align to the right of the screen
UI_SMALLFONT - Small font
UI_BIGFONT - Big font
UI_GIANTFONT - Giant font
UI_DROPSHADOW - A drop shadow is created behind the text
UI_BLINK - The text blinks
UI_PULSE - The text pulses
*/
typedef struct
{
char *string;
int style;
vec4_t *colour;
//Elder: added
int drawFixed;
} cr_line;
cr_line credits[] = { // edit this as necessary for your credits
{ "CAST", UI_CENTER|UI_BIGFONT, &color_headertext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "GRUNT", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "KGB", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "MR. TEE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "NUT", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "PSYCHO", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "SWAT", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "REACTION QUAKE 3 TEAM", UI_CENTER|UI_BIGFONT, &color_headertext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "PROGRAMMERS", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "SCOTT BROOKS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "MICHAEL BRUCE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "DAN CHIN", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "VICTOR CHOW", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "MIKE CONNOR", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "ART", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "BRIAN MILLS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "MARK POTNICK", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "SONIC128", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "FROST", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "R0OK", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "LEVEL DESIGN", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "KELLY RUSH", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "GREGORY SIMMONS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "WALTER SOMOL", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "SZE IOR", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "CENTURION", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "SPYDER", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "SOUND DESIGN", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "ERWIN PEIL", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "ORGANIZATION", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "LUCY", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "ERWIN PEIL", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "WEBSITE DESIGN", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "VICTOR CHOW", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "RICHARD WATT", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "TESTERS", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "JOHN DOE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "PSYCHOTAKES", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "..TO BE FINISHED..", UI_CENTER|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "THE REACTION QUAKE 3 TEAM THANKS", UI_CENTER|UI_BIGFONT, &color_headertext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "INDIVIDUALS", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "FEX THE MESSAGEBOARD GOD", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "IAIN MCGINNISS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "ODDJOB", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "GROUPS", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "ALL THE LITTLE PEOPLE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "FAMILY AND FRIENDS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "THE A-TEAM (AQ2 DEVELOPERS)", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "COMMODITIES", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "MOUNTAIN DEW", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "WEBSITES", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "CODE 3 ARENA", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "JUZ'S SLIPGATE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "QERADIANT.COM", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "QUAKE3WORLD", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "TELEFRAGGED", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "id SOFTWARE", UI_CENTER|UI_BIGFONT, &color_headertext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "PROGRAMMERS", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "JOHN CARMACK", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "ROBERT A. DUFFY", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "JIM DOSE'", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "ART", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "ADRIAN CARMACK", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "KEVIN CLOUD", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "KENNETH SCOTT", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "SENECA MENARD", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "FRED NILSSON", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "GAME DESIGNER", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "GRAEME DEVINE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "LEVEL DESIGN", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "TIM WILLITS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "CHRISTIAN ANTKOW", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "PAUL JAQUAYS", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "CEO", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "TODD HOLLENSHEAD", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "DIRECTOR OF BUSINESS DEVELOPMENT", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "MARTY STRATTON", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "BIZ ASSIST AND ID MOM", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "DONNA JACKSON", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "DEVELOPMENT ASSISTANCE", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "ERIC WEBB", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "THIS HAS BEEN A REACTION QUAKE 3 TEAM PRODUCTION Copyright 2000 - 2001", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
/*
{ "id SOFTWARE", UI_CENTER|UI_BIGFONT, &color_headertext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Programmers", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "John Carmack", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Robert A. Duffy", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Jim Dose'", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Art", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Adrian Carmack", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Kevin Cloud", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Kenneth Scott", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Seneca Menard", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Fred Nilsson", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Game Designer", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Graeme Devine", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Level Design", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Tim Willits", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Christian Antkow", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "Paul Jaquays", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "CEO", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Todd Hollenshead", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Director of Business Development", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Marty Stratton", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Biz Assist and id mom", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Donna Jackson", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Development Assistance", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Eric Webb", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
{ "Original Scrolling Credits Sequence", UI_RIGHT|UI_SMALLFONT, &color_headertext, FIXEDWIDTH },
{ "Iain McGinniss", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
*/
{NULL}
};
/*
=================
@ -29,71 +268,154 @@ static sfxHandle_t UI_CreditMenu_Key( int key ) {
return 0;
}
trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
// pressing the escape key or clicking the mouse will exit
// we also reset the music volume to the user's original
// choice here, by setting s_musicvolume to the stored var
//Elder: doesn't appear to restore music volume
//trap_Cmd_ExecuteText( EXEC_APPEND, va("s_musicvolume %f;quit\n", mvolume));
//trap_Cvar_SetValue( "s_musicvolume", mvolume);
trap_Cmd_ExecuteText( EXEC_APPEND, va("s_musicvolume %f\n", mvolume));
trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n");
return 0;
}
/*
===============
UI_CreditMenu_Draw
===============
=================
ScrollingCredits_Draw
This is the main drawing function for the credits.
Most of the code is self-explanatory.
=================
*/
static void UI_CreditMenu_Draw( void ) {
int y;
static void ScrollingCredits_Draw(void) {
int x = 320, y, n, ysize = 0;
y = 12;
UI_DrawProportionalString( 320, y, "id Software is:", UI_CENTER|UI_SMALLFONT, color_white );
// ysize is used to determine the entire length
// of the credits in pixels.
// We can then use this in further calculations
if(!ysize) {
// ysize not calculated, so calculate it dammit!
for(n = 0; n <= sizeof(credits) - 1; n++) {
//Elder: don't add right-justified stuff to height
if (!(credits[n].style & UI_RIGHT)) {
// fixed width font
if(credits[n].drawFixed) {
ysize += SMALLCHAR_HEIGHT;
}
// it is a small character
else if(credits[n].style & UI_SMALLFONT) {
// add small character height
ysize += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
}
// it is a big character
else if(credits[n].style & UI_BIGFONT) {
// add big character size
ysize += PROP_HEIGHT;
}
// it is a huge character
else if(credits[n].style & UI_GIANTFONT) {
// add giant character size.
ysize += PROP_HEIGHT * (1 / PROP_SMALL_SIZE_SCALE);
}
}
}
}
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Programming", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "John Carmack, Robert A. Duffy, Jim Dose'", UI_CENTER|UI_SMALLFONT, color_white );
// first, fill the background with the specified colour/shader
// we are drawing a shader
#ifdef BACKGROUND_SHADER
UI_DrawHandlePic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, BackgroundShader);
//Elder: added and then removed for fader
//UI_FillRect( 0, 0, 640, 480, color_deepdim );
#else
// we are just filling a color
UI_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_background);
#endif
//Elder: my simple fader code - vec4_t doesn't like var parameters
//so we'll have to access the alpha channel once it's initialized
if ( (uis.realtime - starttime) >= FADE_START_TIME ) {
if (fade < 1.00) {
fade += (1.00 / FADE_DURATION) * 10;
}
//safety clamp
else {
fade = 1.00;
}
color_fader[COLOR_A] = fade;
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_fader );
}
// let's draw the stuff
// set initial y location
y = 480 - SCROLLSPEED * (float)(uis.realtime - starttime) / 100;
for(n = 0; n <= sizeof(credits) - 1; n++) {
// this NULL string marks the end of the credits struct
if(credits[n].string == NULL) {
// credits sequence is completely off screen
if(y < -16) {
trap_Cmd_ExecuteText( EXEC_APPEND, va("s_musicvolume %f; quit\n", mvolume));
break;
// end of credits
}
break;
}
if( strlen(credits[n].string) == 1) // spacer string, no need to draw
continue;
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Art", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Adrian Carmack, Kevin Cloud,", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Kenneth Scott, Seneca Menard, Fred Nilsson", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Game Designer", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Graeme Devine", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Level Design", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Tim Willits, Christian Antkow, Paul Jaquays", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "CEO", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Todd Hollenshead", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Director of Business Development", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Marty Stratton", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Biz Assist and id Mom", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Donna Jackson", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Development Assistance", UI_CENTER|UI_SMALLFONT, color_white );
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawProportionalString( 320, y, "Eric Webb", UI_CENTER|UI_SMALLFONT, color_white );
y += 1.35 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
UI_DrawString( 320, y, "To order: 1-800-idgames www.quake3arena.com www.idsoftware.com", UI_CENTER|UI_SMALLFONT, color_red );
y += SMALLCHAR_HEIGHT;
UI_DrawString( 320, y, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color_red );
// if the line is within the visible range of the screen
if( y > -(PROP_HEIGHT * (1 / PROP_SMALL_SIZE_SCALE))) {
//Elder: added to support fixed width display and movie-style alignment
if ( credits[n].drawFixed ) {
if (credits[n].style & UI_RIGHT) {
UI_DrawString(RIGHT_JUSTIFY_POSITION, y, credits[n].string, credits[n].style, *credits[n].colour );
}
else if (credits[n].style & UI_CENTER) {
UI_DrawString(x, y, credits[n].string, credits[n].style, *credits[n].colour );
}
else {
UI_DrawString(LEFT_JUSTIFY_POSITION, y, credits[n].string, credits[n].style, *credits[n].colour );
}
}
else {
UI_DrawProportionalString(x, y, credits[n].string,
credits[n].style, *credits[n].colour );
}
}
// re-adjust y for next line
//Elder: right-justified stuff doesn't bump up the line
if (!(credits[n].style & UI_RIGHT)) {
//Elder: added for fixed width
if (credits[n].drawFixed) {
y += SMALLCHAR_HEIGHT;
}
else if(credits[n].style & UI_SMALLFONT) {
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
}
else if(credits[n].style & UI_BIGFONT) {
y += PROP_HEIGHT;
}
else if(credits[n].style & UI_GIANTFONT) {
y += PROP_HEIGHT * (1 / PROP_SMALL_SIZE_SCALE);
}
}
// if y is off the screen, break out of loop
if (y > 480)
break;
}
//Elder: "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
//Elder: debug information for fader
//UI_DrawString( 635, 464, va( "Time index: %i", uis.realtime - starttime), UI_RIGHT|UI_SMALLFONT, color_white);
//UI_DrawString (0, 464, va("Fade alpha: %f", fade), UI_SMALLFONT, color_white);
}
/*
===============
UI_CreditMenu
@ -102,9 +424,20 @@ UI_CreditMenu
void UI_CreditMenu( void ) {
memset( &s_credits, 0 ,sizeof(s_credits) );
s_credits.menu.draw = UI_CreditMenu_Draw;
s_credits.menu.draw = ScrollingCredits_Draw;
s_credits.menu.key = UI_CreditMenu_Key;
s_credits.menu.fullscreen = qtrue;
s_credits.menu.showlogo = qtrue;//Blaze: Show Background logo
UI_PushMenu ( &s_credits.menu );
starttime = uis.realtime; // record start time for credits to scroll properly
mvolume = trap_Cvar_VariableValue( "s_musicvolume" );
if(mvolume < 0.5)
trap_Cmd_ExecuteText( EXEC_APPEND, "s_musicvolume 0.5\n" );
trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win\n" );
// load the background shader
#ifdef BACKGROUND_SHADER
//Elder: changed to rq3 fire
BackgroundShader = trap_R_RegisterShaderNoMip("rq3-menuback");
#endif
}

View file

@ -11,13 +11,14 @@ DEMOS MENU
#include "ui_local.h"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
#define ART_GO0 "menu/art/play_0"
#define ART_GO1 "menu/art/play_1"
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
//Elder: changed to RQ3 graphics
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ART_GO0 "menu/art/rq3-menu-play.tga"
#define ART_GO1 "menu/art/rq3-menu-play-focus.tga"
//Elder: removed
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ART_ARROWS "menu/art/arrows_horz_0"
#define ART_ARROWLEFT "menu/art/arrows_horz_left"
#define ART_ARROWRIGHT "menu/art/arrows_horz_right"
@ -34,6 +35,9 @@ DEMOS MENU
#define ARROWS_WIDTH 128
#define ARROWS_HEIGHT 48
//Elder: RQ3 stuff
#define RQ3_DEMOS_ICON "menu/art/rq3-menu-demos.tga"
#define RQ3_DEMOS_TITLE "menu/art/rq3-title-demos.tga"
typedef struct {
menuframework_s menu;
@ -42,11 +46,12 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: Removed for new interface
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
menulist_s list;
@ -56,6 +61,9 @@ typedef struct {
menubitmap_s back;
menubitmap_s go;
menubitmap_s rq3_demosicon;
menubitmap_s rq3_demostitle;
int numDemos;
char names[NAMEBUFSIZE];
char *demolist[MAX_DEMOS];
@ -108,6 +116,22 @@ static sfxHandle_t UI_DemosMenu_Key( int key ) {
return Menu_DefaultKey( &s_demos.menu, key );
}
/*
===============
Added by Elder
Demos_MenuDraw
===============
*/
static void Demos_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &s_demos.menu );
}
/*
===============
@ -123,7 +147,7 @@ static void Demos_MenuInit( void ) {
s_demos.menu.key = UI_DemosMenu_Key;
Demos_Cache();
s_demos.menu.draw = Demos_MenuDraw;
s_demos.menu.fullscreen = qtrue;
s_demos.menu.wrapAround = qtrue;
s_demos.menu.showlogo = qtrue;//Blaze: Show Background logo
@ -153,6 +177,7 @@ static void Demos_MenuInit( void ) {
s_demos.framer.width = 256;
s_demos.framer.height = 334;
*/
/*Elder: Removed for new interface
s_demos.multim.generic.type = MTYPE_PTEXT;
s_demos.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_demos.multim.generic.x = 120;
@ -192,20 +217,38 @@ static void Demos_MenuInit( void ) {
s_demos.exitm.string = "EXIT";
s_demos.exitm.color = color_red;
s_demos.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for demos icon
s_demos.rq3_demosicon.generic.type = MTYPE_BITMAP;
s_demos.rq3_demosicon.generic.name = RQ3_DEMOS_ICON;
s_demos.rq3_demosicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_demos.rq3_demosicon.generic.x = 0;
s_demos.rq3_demosicon.generic.y = 4;
s_demos.rq3_demosicon.width = RQ3_ICON_WIDTH;
s_demos.rq3_demosicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for demos title
s_demos.rq3_demostitle.generic.type = MTYPE_BITMAP;
s_demos.rq3_demostitle.generic.name = RQ3_DEMOS_TITLE;
s_demos.rq3_demostitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_demos.rq3_demostitle.generic.x = 64;
s_demos.rq3_demostitle.generic.y = 12;
s_demos.rq3_demostitle.width = 256;
s_demos.rq3_demostitle.height = 32;
s_demos.arrows.generic.type = MTYPE_BITMAP;
s_demos.arrows.generic.name = ART_ARROWS;
s_demos.arrows.generic.flags = QMF_INACTIVE;
s_demos.arrows.generic.x = 320-ARROWS_WIDTH/2;
s_demos.arrows.generic.y = 400;
s_demos.arrows.generic.y = 430;
s_demos.arrows.width = ARROWS_WIDTH;
s_demos.arrows.height = ARROWS_HEIGHT;
s_demos.left.generic.type = MTYPE_BITMAP;
s_demos.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
s_demos.left.generic.x = 320-ARROWS_WIDTH/2;
s_demos.left.generic.y = 400;
s_demos.left.generic.y = 430;
s_demos.left.generic.id = ID_LEFT;
s_demos.left.generic.callback = Demos_MenuEvent;
s_demos.left.width = ARROWS_WIDTH/2;
@ -215,7 +258,7 @@ static void Demos_MenuInit( void ) {
s_demos.right.generic.type = MTYPE_BITMAP;
s_demos.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
s_demos.right.generic.x = 320;
s_demos.right.generic.y = 400;
s_demos.right.generic.y = 430;
s_demos.right.generic.id = ID_RIGHT;
s_demos.right.generic.callback = Demos_MenuEvent;
s_demos.right.width = ARROWS_WIDTH/2;
@ -227,10 +270,10 @@ static void Demos_MenuInit( void ) {
s_demos.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_demos.back.generic.id = ID_BACK;
s_demos.back.generic.callback = Demos_MenuEvent;
s_demos.back.generic.x = 0;
s_demos.back.generic.y = 480-64;
s_demos.back.width = 128;
s_demos.back.height = 64;
s_demos.back.generic.x = 8;
s_demos.back.generic.y = 480-44;
s_demos.back.width = 32;
s_demos.back.height = 32;
s_demos.back.focuspic = ART_BACK1;
s_demos.go.generic.type = MTYPE_BITMAP;
@ -238,18 +281,18 @@ static void Demos_MenuInit( void ) {
s_demos.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_demos.go.generic.id = ID_GO;
s_demos.go.generic.callback = Demos_MenuEvent;
s_demos.go.generic.x = 640;
s_demos.go.generic.y = 480-64;
s_demos.go.width = 128;
s_demos.go.height = 64;
s_demos.go.generic.x = 635;
s_demos.go.generic.y = 480-44;
s_demos.go.width = 32;
s_demos.go.height = 32;
s_demos.go.focuspic = ART_GO1;
s_demos.list.generic.type = MTYPE_SCROLLLIST;
s_demos.list.generic.flags = QMF_PULSEIFFOCUS;
s_demos.list.generic.callback = Demos_MenuEvent;
s_demos.list.generic.id = ID_LIST;
s_demos.list.generic.x = 118;
s_demos.list.generic.y = 130;
s_demos.list.generic.x = 100;
s_demos.list.generic.y = 64;
s_demos.list.width = 16;
s_demos.list.height = 14;
s_demos.list.numitems = trap_FS_GetFileList( "demos", "dm3", s_demos.names, NAMEBUFSIZE );
@ -283,11 +326,15 @@ static void Demos_MenuInit( void ) {
// Menu_AddItem( &s_demos.menu, &s_demos.banner );
// Menu_AddItem( &s_demos.menu, &s_demos.framel );
// Menu_AddItem( &s_demos.menu, &s_demos.framer );
Menu_AddItem( &s_demos.menu, &s_demos.multim );
Menu_AddItem( &s_demos.menu, &s_demos.setupm );
Menu_AddItem( &s_demos.menu, &s_demos.demom );
Menu_AddItem( &s_demos.menu, &s_demos.modsm );
Menu_AddItem( &s_demos.menu, &s_demos.exitm );
//Elder: removed for new interface
// Menu_AddItem( &s_demos.menu, &s_demos.multim );
// Menu_AddItem( &s_demos.menu, &s_demos.setupm );
// Menu_AddItem( &s_demos.menu, &s_demos.demom );
// Menu_AddItem( &s_demos.menu, &s_demos.modsm );
// Menu_AddItem( &s_demos.menu, &s_demos.exitm );
//Elder: new UI stuff
Menu_AddItem( &s_demos.menu, &s_demos.rq3_demosicon );
Menu_AddItem( &s_demos.menu, &s_demos.rq3_demostitle );
Menu_AddItem( &s_demos.menu, &s_demos.list );
Menu_AddItem( &s_demos.menu, &s_demos.arrows );
@ -307,11 +354,15 @@ void Demos_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( ART_GO0 );
trap_R_RegisterShaderNoMip( ART_GO1 );
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: removed
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_ARROWS );
trap_R_RegisterShaderNoMip( ART_ARROWLEFT );
trap_R_RegisterShaderNoMip( ART_ARROWRIGHT );
//Elder: RQ3 stuff
trap_R_RegisterShaderNoMip( RQ3_DEMOS_ICON );
trap_R_RegisterShaderNoMip( RQ3_DEMOS_TITLE );
}
/*

View file

@ -10,11 +10,11 @@ DISPLAY OPTIONS MENU
#include "ui_local.h"
#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"
//Elder: removed
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ID_GRAPHICS 10
#define ID_DISPLAY 11
@ -23,7 +23,17 @@ DISPLAY OPTIONS MENU
#define ID_BRIGHTNESS 14
#define ID_SCREENSIZE 15
#define ID_BACK 16
//Elder: new options
#define ID_OVERBRIGHT 17
//Elder: RQ3 stuff
#define RQ3_SYSTEM_ICON "menu/art/rq3-setup-system.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
#define RQ3_GRAPHICS_BUTTON "menu/art/rq3-system-graphics.tga"
#define RQ3_DISPLAY_BUTTON "menu/art/rq3-system-display.tga"
#define RQ3_SOUND_BUTTON "menu/art/rq3-system-sound.tga"
#define RQ3_NETWORK_BUTTON "menu/art/rq3-system-network.tga"
typedef struct {
menuframework_s menu;
@ -31,16 +41,29 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: removed
// 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;
//Elder: RQ3 stuff
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_systemicon;
menubitmap_s rq3_graphics;
menubitmap_s rq3_display;
menubitmap_s rq3_sound;
menubitmap_s rq3_network;
menutext_s rq3_statustext;
menuradiobutton_s rq3_overbright;
//Elder: removed
// menutext_s graphics;
// menutext_s display;
// menutext_s sound;
// menutext_s network;
menuslider_s brightness;
menuslider_s screensize;
@ -57,43 +80,107 @@ UI_DisplayOptionsMenu_Event
=================
*/
static void UI_DisplayOptionsMenu_Event( void* ptr, int event ) {
if( event != QM_ACTIVATED ) {
//Elder: for status bar
if( event == QM_LOSTFOCUS ) {
displayOptionsInfo.rq3_statustext.string = "";
return;
}
else if ( event == QM_GOTFOCUS ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
displayOptionsInfo.rq3_statustext.string = "Change graphics settings";
break;
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
displayOptionsInfo.rq3_statustext.string = "Change display settings";
break;
case ID_DISPLAY:
break;
case ID_SOUND:
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
case ID_BRIGHTNESS:
trap_Cvar_SetValue( "r_gamma", displayOptionsInfo.brightness.curvalue / 10.0f );
break;
case ID_SOUND:
displayOptionsInfo.rq3_statustext.string = "Change sound settings";
break;
case ID_SCREENSIZE:
trap_Cvar_SetValue( "cg_viewsize", displayOptionsInfo.screensize.curvalue * 10 );
break;
case ID_NETWORK:
displayOptionsInfo.rq3_statustext.string = "Change network settings";
break;
case ID_BACK:
UI_PopMenu();
break;
case ID_BRIGHTNESS:
displayOptionsInfo.rq3_statustext.string = "Adjust gamma correction";
break;
case ID_SCREENSIZE:
displayOptionsInfo.rq3_statustext.string = "Adjust in-game screen size";
break;
case ID_BACK:
displayOptionsInfo.rq3_statustext.string = "Return to setup menu";
break;
//Elder: added
case ID_OVERBRIGHT:
displayOptionsInfo.rq3_statustext.string = "Toggle over-bright bits (recommended: off)";
break;
default:
displayOptionsInfo.rq3_statustext.string = "";
break;
}
}
else if( event == QM_ACTIVATED ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
break;
case ID_SOUND:
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
case ID_BRIGHTNESS:
trap_Cvar_SetValue( "r_gamma", displayOptionsInfo.brightness.curvalue / 10.0f );
break;
case ID_SCREENSIZE:
trap_Cvar_SetValue( "cg_viewsize", displayOptionsInfo.screensize.curvalue * 10 );
break;
//Elder: added
case ID_OVERBRIGHT:
trap_Cvar_SetValue( "r_overBrightBits", displayOptionsInfo.rq3_overbright.curvalue);
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
}
/*
===============
Added by Elder
UI_NetworkOptionsMenu_Draw
===============
*/
static void UI_DisplayOptionsMenu_Draw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &displayOptionsInfo.menu );
}
/*
===============
@ -101,11 +188,13 @@ UI_DisplayOptionsMenu_Init
===============
*/
static void UI_DisplayOptionsMenu_Init( void ) {
int y;
int y = 12;
int buttonCount = 0;
memset( &displayOptionsInfo, 0, sizeof(displayOptionsInfo) );
UI_DisplayOptionsMenu_Cache();
displayOptionsInfo.menu.draw = UI_DisplayOptionsMenu_Draw;
displayOptionsInfo.menu.wrapAround = qtrue;
displayOptionsInfo.menu.fullscreen = qtrue;
displayOptionsInfo.menu.showlogo = qtrue;
@ -134,6 +223,7 @@ static void UI_DisplayOptionsMenu_Init( void ) {
displayOptionsInfo.framer.width = 256;
displayOptionsInfo.framer.height = 334;
*/
/* Elder: not needed anymore
displayOptionsInfo.multim.generic.type = MTYPE_PTEXT;
displayOptionsInfo.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
displayOptionsInfo.multim.generic.x = 120;
@ -173,8 +263,84 @@ static void UI_DisplayOptionsMenu_Init( void ) {
displayOptionsInfo.exitm.string = "EXIT";
displayOptionsInfo.exitm.color = color_red;
displayOptionsInfo.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
displayOptionsInfo.rq3_systemicon.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_systemicon.generic.name = RQ3_SYSTEM_ICON;
displayOptionsInfo.rq3_systemicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
displayOptionsInfo.rq3_systemicon.generic.x = 0;
displayOptionsInfo.rq3_systemicon.generic.y = 4;
displayOptionsInfo.rq3_systemicon.width = RQ3_ICON_WIDTH;
displayOptionsInfo.rq3_systemicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
displayOptionsInfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
displayOptionsInfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
displayOptionsInfo.rq3_setuptitle.generic.x = 64;
displayOptionsInfo.rq3_setuptitle.generic.y = 12;
displayOptionsInfo.rq3_setuptitle.width = 256;
displayOptionsInfo.rq3_setuptitle.height = 32;
//Elder: RQ3 Graphics Button
displayOptionsInfo.rq3_graphics.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_graphics.generic.name = RQ3_GRAPHICS_BUTTON;
displayOptionsInfo.rq3_graphics.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
displayOptionsInfo.rq3_graphics.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
displayOptionsInfo.rq3_graphics.generic.y = y;
displayOptionsInfo.rq3_graphics.generic.id = ID_GRAPHICS;
displayOptionsInfo.rq3_graphics.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.rq3_graphics.width = RQ3_BUTTON_WIDTH;
displayOptionsInfo.rq3_graphics.height = RQ3_BUTTON_HEIGHT;
displayOptionsInfo.rq3_graphics.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Display Button
displayOptionsInfo.rq3_display.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_display.generic.name = RQ3_DISPLAY_BUTTON;
displayOptionsInfo.rq3_display.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
displayOptionsInfo.rq3_display.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
displayOptionsInfo.rq3_display.generic.y = y;
displayOptionsInfo.rq3_display.generic.id = ID_DISPLAY;
displayOptionsInfo.rq3_display.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.rq3_display.width = RQ3_BUTTON_WIDTH;
displayOptionsInfo.rq3_display.height = RQ3_BUTTON_HEIGHT;
displayOptionsInfo.rq3_display.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Sound Button
displayOptionsInfo.rq3_sound.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_sound.generic.name = RQ3_SOUND_BUTTON;
displayOptionsInfo.rq3_sound.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
displayOptionsInfo.rq3_sound.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
displayOptionsInfo.rq3_sound.generic.y = y;
displayOptionsInfo.rq3_sound.generic.id = ID_SOUND;
displayOptionsInfo.rq3_sound.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.rq3_sound.width = RQ3_BUTTON_WIDTH;
displayOptionsInfo.rq3_sound.height = RQ3_BUTTON_HEIGHT;
displayOptionsInfo.rq3_sound.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Network Button
displayOptionsInfo.rq3_network.generic.type = MTYPE_BITMAP;
displayOptionsInfo.rq3_network.generic.name = RQ3_NETWORK_BUTTON;
displayOptionsInfo.rq3_network.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
displayOptionsInfo.rq3_network.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
displayOptionsInfo.rq3_network.generic.y = y;
displayOptionsInfo.rq3_network.generic.id = ID_NETWORK;
displayOptionsInfo.rq3_network.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.rq3_network.width = RQ3_BUTTON_WIDTH;
displayOptionsInfo.rq3_network.height = RQ3_BUTTON_HEIGHT;
displayOptionsInfo.rq3_network.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Status Text
displayOptionsInfo.rq3_statustext.generic.type = MTYPE_TEXT;
displayOptionsInfo.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
displayOptionsInfo.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
displayOptionsInfo.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
displayOptionsInfo.rq3_statustext.string = "";
displayOptionsInfo.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
displayOptionsInfo.rq3_statustext.color = color_orange;
/*
displayOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
displayOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.graphics.generic.id = ID_GRAPHICS;
@ -214,62 +380,87 @@ static void UI_DisplayOptionsMenu_Init( void ) {
displayOptionsInfo.network.string = "NETWORK";
displayOptionsInfo.network.style = UI_RIGHT;
displayOptionsInfo.network.color = color_red;
y = 240 - 1 * (BIGCHAR_HEIGHT+2);
*/
//y = 240 - 1 * (BIGCHAR_HEIGHT+2);
displayOptionsInfo.brightness.generic.type = MTYPE_SLIDER;
displayOptionsInfo.brightness.generic.name = "Brightness:";
displayOptionsInfo.brightness.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
displayOptionsInfo.brightness.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.brightness.generic.id = ID_BRIGHTNESS;
displayOptionsInfo.brightness.generic.x = 400;
displayOptionsInfo.brightness.generic.y = y;
displayOptionsInfo.brightness.generic.x = 200;
displayOptionsInfo.brightness.generic.y = 64;
displayOptionsInfo.brightness.minvalue = 5;
displayOptionsInfo.brightness.maxvalue = 20;
if( !uis.glconfig.deviceSupportsGamma ) {
displayOptionsInfo.brightness.generic.flags |= QMF_GRAYED;
}
y += BIGCHAR_HEIGHT+2;
//y += BIGCHAR_HEIGHT+2;
displayOptionsInfo.screensize.generic.type = MTYPE_SLIDER;
displayOptionsInfo.screensize.generic.name = "Screen Size:";
displayOptionsInfo.screensize.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
displayOptionsInfo.screensize.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.screensize.generic.id = ID_SCREENSIZE;
displayOptionsInfo.screensize.generic.x = 400;
displayOptionsInfo.screensize.generic.y = y;
displayOptionsInfo.screensize.generic.x = 200;
displayOptionsInfo.screensize.generic.y = 64 + BIGCHAR_HEIGHT + 2;;
displayOptionsInfo.screensize.minvalue = 3;
displayOptionsInfo.screensize.maxvalue = 10;
//Elder: added
displayOptionsInfo.rq3_overbright.generic.type = MTYPE_RADIOBUTTON;
displayOptionsInfo.rq3_overbright.generic.name = "Overbright Bits:";
displayOptionsInfo.rq3_overbright.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
displayOptionsInfo.rq3_overbright.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.rq3_overbright.generic.id = ID_OVERBRIGHT;
displayOptionsInfo.rq3_overbright.generic.x = 200;
displayOptionsInfo.rq3_overbright.generic.y = 64 + 2 * (BIGCHAR_HEIGHT + 2);
displayOptionsInfo.back.generic.type = MTYPE_BITMAP;
displayOptionsInfo.back.generic.name = ART_BACK0;
displayOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.back.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.back.generic.id = ID_BACK;
displayOptionsInfo.back.generic.x = 0;
displayOptionsInfo.back.generic.y = 480-64;
displayOptionsInfo.back.width = 128;
displayOptionsInfo.back.height = 64;
displayOptionsInfo.back.generic.x = 8;
displayOptionsInfo.back.generic.y = 480-44;
displayOptionsInfo.back.width = 32;
displayOptionsInfo.back.height = 32;
displayOptionsInfo.back.focuspic = ART_BACK1;
// Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.banner );
// Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framel );
// Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framer );
/* Elder: removed
Menu_AddItem( &displayOptionsInfo.menu, &displayOptionsInfo.multim );
Menu_AddItem( &displayOptionsInfo.menu, &displayOptionsInfo.setupm );
Menu_AddItem( &displayOptionsInfo.menu, &displayOptionsInfo.demom );
Menu_AddItem( &displayOptionsInfo.menu, &displayOptionsInfo.modsm );
Menu_AddItem( &displayOptionsInfo.menu, &displayOptionsInfo.exitm );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.graphics );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.display );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.sound );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.network );
*/
//Elder: added
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_systemicon );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_setuptitle );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_graphics );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_display );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_sound );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_network );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_statustext );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.brightness );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.screensize );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.rq3_overbright );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.back );
displayOptionsInfo.brightness.curvalue = trap_Cvar_VariableValue("r_gamma") * 10;
displayOptionsInfo.screensize.curvalue = trap_Cvar_VariableValue( "cg_viewsize")/10;
//Elder: added
displayOptionsInfo.rq3_overbright.curvalue = trap_Cvar_VariableValue( "r_overbrightbits" ) != 0;
}
@ -279,10 +470,19 @@ UI_DisplayOptionsMenu_Cache
===============
*/
void UI_DisplayOptionsMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: removed
// trap_R_RegisterShaderNoMip( ART_FRAMEL );
// trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
//Elder: added
trap_R_RegisterShaderNoMip( RQ3_SYSTEM_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
trap_R_RegisterShaderNoMip( RQ3_GRAPHICS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DISPLAY_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SOUND_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_NETWORK_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
@ -294,5 +494,6 @@ UI_DisplayOptionsMenu
void UI_DisplayOptionsMenu( void ) {
UI_DisplayOptionsMenu_Init();
UI_PushMenu( &displayOptionsInfo.menu );
Menu_SetCursorToItem( &displayOptionsInfo.menu, &displayOptionsInfo.display );
//Elder: shifted to .rq3_display
Menu_SetCursorToItem( &displayOptionsInfo.menu, &displayOptionsInfo.rq3_display );
}

View file

@ -124,6 +124,17 @@ extern vmCvar_t ui_cdkeychecked;
#define QM_LOSTFOCUS 2
#define QM_ACTIVATED 3
// Elder: RQ3 Metric Definitions
#define RQ3_ICON_WIDTH 48
#define RQ3_ICON_HEIGHT 48
#define RQ3_BUTTON_WIDTH 32
#define RQ3_BUTTON_HEIGHT 32
#define RQ3_STATUSBAR_X 320
#define RQ3_STATUSBAR_Y 430
//Elder: Padding 8 pixels on each side
#define RQ3_BUTTON_PADDING 8
typedef struct _tag_menuframework
{
int cursor;
@ -251,6 +262,8 @@ extern sfxHandle_t menu_move_sound;
extern sfxHandle_t menu_out_sound;
extern sfxHandle_t menu_buzz_sound;
extern sfxHandle_t menu_null_sound;
//Elder: added
extern sfxHandle_t menu_type_sound;
extern sfxHandle_t weaponChangeSound;
extern vec4_t menu_text_color;
extern vec4_t menu_grayed_color;
@ -266,6 +279,10 @@ extern vec4_t color_blue;
extern vec4_t color_orange;
extern vec4_t color_red;
extern vec4_t color_dim;
//Elder: added colours
extern vec4_t color_deepdim;
extern vec4_t name_color;
extern vec4_t list_color;
extern vec4_t listbar_color;

View file

@ -11,39 +11,53 @@ MAIN MENU
#include "ui_local.h"
#define ID_SINGLEPLAYER 10
#define ID_MULTIPLAYER 11
#define ID_SETUP 12
#define ID_DEMOS 13
#define ID_CINEMATICS 14
#define ID_TEAMARENA 15
#define ID_TEAMARENA 15
#define ID_MODS 16
#define ID_EXIT 17
#define MAIN_BANNER_MODEL "models/mapobjects/banner/banner5.md3"
#define MAIN_MENU_VERTICAL_SPACING 34
//Elder: Define button images
#define RQ3_START_BUTTON "menu/art/rq3-menu-start.tga"
#define RQ3_SETUP_BUTTON "menu/art/rq3-menu-setup.tga"
#define RQ3_DEMOS_BUTTON "menu/art/rq3-menu-demos.tga"
#define RQ3_MODS_BUTTON "menu/art/rq3-menu-mods.tga"
#define RQ3_EXIT_BUTTON "menu/art/rq3-menu-exit.tga"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
typedef struct {
menuframework_s menu;
//Elder: Systematically replacing text with button pics
//Blaze: No single player, cinematics, team arena, and banner model
// menutext_s singleplayer;
menutext_s multiplayer;
menutext_s setup;
menutext_s demos;
// menutext_s multiplayer;
// menutext_s setup;
// menutext_s demos;
// menutext_s cinematics;
// menutext_s teamArena;
menutext_s mods;
menutext_s exit;
// menutext_s mods;
// menutext_s exit;
// qhandle_t bannerModel;
//Elder: RQ3 Button Images and status text
menubitmap_s rq3_startbutton;
menubitmap_s rq3_setupbutton;
menubitmap_s rq3_demosbutton;
menubitmap_s rq3_modsbutton;
menubitmap_s rq3_exitbutton;
menutext_s rq3_statustext;
} mainmenu_t;
static mainmenu_t s_main;
/*
=================
MainMenu_ExitAction
@ -65,44 +79,84 @@ Main_MenuEvent
=================
*/
void Main_MenuEvent (void* ptr, int event) {
if( event != QM_ACTIVATED ) {
return;
//Elder: Added status messages on event focus
if ( event == QM_LOSTFOCUS ) {
s_main.rq3_statustext.string = "";
}
else if( event == QM_GOTFOCUS ) {
//get menu item id
switch( ((menucommon_s*)ptr)->id ) {
case ID_MULTIPLAYER:
s_main.rq3_statustext.string = "Play Reaction Quake 3";
break;
case ID_SETUP:
s_main.rq3_statustext.string = "Configure Reaction Quake 3";
break;
case ID_DEMOS:
s_main.rq3_statustext.string = "Playback in-game demos";
break;
case ID_MODS:
s_main.rq3_statustext.string = "Change game modification";
break;
case ID_EXIT:
s_main.rq3_statustext.string = "Exit Reaction Quake 3";
break;
default:
s_main.rq3_statustext.string = "";
break;
}
}
switch( ((menucommon_s*)ptr)->id ) {
else if( event == QM_ACTIVATED ) {
s_main.rq3_statustext.string = "";
switch( ((menucommon_s*)ptr)->id ) {
//Blaze: This case nolonger exists
// case ID_SINGLEPLAYER:
// UI_SPLevelMenu();
// break;
case ID_MULTIPLAYER:
UI_ArenaServersMenu();
break;
case ID_MULTIPLAYER:
UI_ArenaServersMenu();
break;
case ID_SETUP:
UI_SetupMenu();
break;
case ID_SETUP:
UI_SetupMenu();
break;
case ID_DEMOS:
UI_DemosMenu();
break;
case ID_DEMOS:
UI_DemosMenu();
break;
//Blaze: This case nolonger exists
// case ID_CINEMATICS:
// UI_CinematicsMenu();
// break;
case ID_MODS:
UI_ModsMenu();
break;
case ID_MODS:
UI_ModsMenu();
break;
//Blaze: This case nolonger exists
// case ID_TEAMARENA:
// trap_Cvar_Set( "fs_game", "missionpack");
// trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
// break;
case ID_EXIT:
UI_ConfirmMenu( "EXIT GAME?", NULL, MainMenu_ExitAction );
break;
case ID_EXIT:
UI_ConfirmMenu( "EXIT REACTION?", NULL, MainMenu_ExitAction );
break;
}
}
else {
return;
}
}
@ -115,6 +169,15 @@ MainMenu_Cache
void MainMenu_Cache( void ) {
//Blaze: removed the banner
//s_main.bannerModel = trap_R_RegisterModel( MAIN_BANNER_MODEL );
//Elder: cache button images
trap_R_RegisterShaderNoMip( RQ3_START_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DEMOS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_MODS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_EXIT_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
@ -182,15 +245,20 @@ static void Main_MenuDraw( void ) {
trap_R_RenderScene( &refdef );
*/
// standard menu drawing
//Elder: "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &s_main.menu );
if (uis.demoversion) {
UI_DrawProportionalString( 320, 372, "DEMO FOR MATURE AUDIENCES DEMO", UI_CENTER|UI_SMALLFONT, color );
UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
} else {
UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
//Elder: Nudged slightly lower to accomodate status text
UI_DrawString( 320, 464, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
}
}
@ -222,6 +290,7 @@ static qboolean UI_TeamArenaExists( void ) {
}
qboolean trap_VerifyCDKey( const char *key, const char *chksum);
/*
===============
UI_MainMenu
@ -232,6 +301,8 @@ and that local cinematics are killed
===============
*/
void UI_MainMenu( void ) {
//Elder: "auto" x-alignment based on number of buttons
int buttonCount = 0;
int y;
qboolean teamArena = qfalse;
int style = UI_CENTER | UI_DROPSHADOW;
@ -256,10 +327,81 @@ void UI_MainMenu( void ) {
s_main.menu.fullscreen = qtrue;
s_main.menu.wrapAround = qtrue;
s_main.menu.showlogo = qtrue;
//Blaze: Reaction menu
y = 0;
y = 12;
//Elder: RQ3 Start Button
s_main.rq3_startbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_startbutton.generic.name = RQ3_START_BUTTON;
s_main.rq3_startbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_startbutton.generic.id = ID_MULTIPLAYER;
s_main.rq3_startbutton.generic.callback = Main_MenuEvent;
s_main.rq3_startbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_startbutton.generic.y = y;
s_main.rq3_startbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_startbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_startbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Setup Button
s_main.rq3_setupbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_setupbutton.generic.name = RQ3_SETUP_BUTTON;
s_main.rq3_setupbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_setupbutton.generic.id = ID_SETUP;
s_main.rq3_setupbutton.generic.callback = Main_MenuEvent;
s_main.rq3_setupbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_setupbutton.generic.y = y;
s_main.rq3_setupbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_setupbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_setupbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Demos Button
s_main.rq3_demosbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_demosbutton.generic.name = RQ3_DEMOS_BUTTON;
s_main.rq3_demosbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_demosbutton.generic.id = ID_DEMOS;
s_main.rq3_demosbutton.generic.callback = Main_MenuEvent;
s_main.rq3_demosbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_demosbutton.generic.y = y;
s_main.rq3_demosbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_demosbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_demosbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Mods Button
s_main.rq3_modsbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_modsbutton.generic.name = RQ3_MODS_BUTTON;
s_main.rq3_modsbutton.generic.flags = QMF_RIGHT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_modsbutton.generic.id = ID_MODS;
s_main.rq3_modsbutton.generic.callback = Main_MenuEvent;
s_main.rq3_modsbutton.generic.x = 640 - (RQ3_BUTTON_WIDTH + RQ3_BUTTON_PADDING);
s_main.rq3_modsbutton.generic.y = y;
s_main.rq3_modsbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_modsbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_modsbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Exit Button
s_main.rq3_exitbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_exitbutton.generic.name = RQ3_EXIT_BUTTON;
s_main.rq3_exitbutton.generic.flags = QMF_RIGHT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_exitbutton.generic.id = ID_EXIT;
s_main.rq3_exitbutton.generic.callback = Main_MenuEvent;
s_main.rq3_exitbutton.generic.x = 640;
s_main.rq3_exitbutton.generic.y = y;
s_main.rq3_exitbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_exitbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_exitbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Status Text
s_main.rq3_statustext.generic.type = MTYPE_TEXT;
s_main.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
s_main.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
s_main.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
s_main.rq3_statustext.string = "";
s_main.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
s_main.rq3_statustext.color = color_orange;
/*Elder: Replaced by RQ3 buttons above
//Blaze: This menu nolonger exists
/*
s_main.singleplayer.generic.type = MTYPE_PTEXT;
s_main.singleplayer.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
s_main.singleplayer.generic.x = 320;
@ -269,7 +411,6 @@ void UI_MainMenu( void ) {
s_main.singleplayer.string = "SINGLE PLAYER";
s_main.singleplayer.color = color_red;
s_main.singleplayer.style = style;
*/
//Blaze: Reaction menu
//y += MAIN_MENU_VERTICAL_SPACING;
@ -283,7 +424,7 @@ void UI_MainMenu( void ) {
s_main.multiplayer.string = "MULTIPLAYER";
s_main.multiplayer.color = color_red;
s_main.multiplayer.style = style;
//Blaze: Reaction Menu
//y += MAIN_MENU_VERTICAL_SPACING;
s_main.setup.generic.type = MTYPE_PTEXT;
@ -309,7 +450,6 @@ void UI_MainMenu( void ) {
//y += MAIN_MENU_VERTICAL_SPACING;
//Blaze: This menu nolonger exists
/*
s_main.cinematics.generic.type = MTYPE_PTEXT;
s_main.cinematics.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
s_main.cinematics.generic.x = 350;//Blaze: Menu x loc
@ -319,10 +459,9 @@ void UI_MainMenu( void ) {
s_main.cinematics.string = "CINEMATICS";
s_main.cinematics.color = color_red;
s_main.cinematics.style = style;
*/
//Blaze: This menu nolonger exists
/*
if (UI_TeamArenaExists()) {
teamArena = qtrue;
y += MAIN_MENU_VERTICAL_SPACING;
@ -336,7 +475,6 @@ void UI_MainMenu( void ) {
s_main.teamArena.color = color_red;
s_main.teamArena.style = style;
}
*/
//y += MAIN_MENU_VERTICAL_SPACING;
s_main.mods.generic.type = MTYPE_PTEXT;
@ -360,19 +498,32 @@ void UI_MainMenu( void ) {
s_main.exit.color = color_red;
s_main.exit.style = style;
*/
//Elder: Add RQ3 Stuff
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_startbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_setupbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_demosbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_modsbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_exitbutton );
Menu_AddItem( &s_main.menu, &s_main.rq3_statustext );
//Elder: Replaced by RQ3 Buttons above
//
//Blaze: This menu nolonger exists
//Menu_AddItem( &s_main.menu, &s_main.singleplayer );
Menu_AddItem( &s_main.menu, &s_main.multiplayer );
Menu_AddItem( &s_main.menu, &s_main.setup );
Menu_AddItem( &s_main.menu, &s_main.demos );
//Menu_AddItem( &s_main.menu, &s_main.multiplayer );
//Menu_AddItem( &s_main.menu, &s_main.setup );
//Menu_AddItem( &s_main.menu, &s_main.demos );
//Blaze: This menu nolonger exists
//Menu_AddItem( &s_main.menu, &s_main.cinematics );
//Blaze: This menu nolonger exists
//if (teamArena) {
// Menu_AddItem( &s_main.menu, &s_main.teamArena );
//}
Menu_AddItem( &s_main.menu, &s_main.mods );
Menu_AddItem( &s_main.menu, &s_main.exit );
//Menu_AddItem( &s_main.menu, &s_main.mods );
//Menu_AddItem( &s_main.menu, &s_main.exit );
trap_Key_SetCatcher( KEYCATCH_UI );
uis.menusp = 0;

View file

@ -233,6 +233,9 @@ void MField_CharEvent( mfield_t *edit, int ch ) {
return;
}
//Elder: sound added
trap_S_StartLocalSound( menu_type_sound, CHAN_LOCAL_SOUND );
if ( !trap_Key_GetOverstrikeMode() ) {
if ((edit->cursor == MAX_EDIT_LINE - 1) || (edit->maxchars && edit->cursor >= edit->maxchars))
return;

View file

@ -2,12 +2,14 @@
//
#include "ui_local.h"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
#define ART_FIGHT0 "menu/art/load_0"
#define ART_FIGHT1 "menu/art/load_1"
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
//Elder: changed filenames
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ART_FIGHT0 "menu/art/rq3-menu-go.tga"
#define ART_FIGHT1 "menu/art/rq3-menu-go-focus.tga"
//Elder: removed
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define MAX_MODS 64
#define NAMEBUFSIZE ( MAX_MODS * 48 )
@ -17,6 +19,9 @@
#define ID_GO 11
#define ID_LIST 12
//Elder: RQ3 assets
#define RQ3_MODS_ICON "menu/art/rq3-menu-mods.tga"
#define RQ3_MODS_TITLE "menu/art/rq3-title-mods.jpg"
typedef struct {
menuframework_s menu;
@ -25,11 +30,12 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: Don't need these anymore
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
menulist_s list;
@ -44,6 +50,9 @@ typedef struct {
char *descriptionList[MAX_MODS];
char *fs_gameList[MAX_MODS];
menubitmap_s rq3_modsicon;
menubitmap_s rq3_modstitle;
} mods_t;
static mods_t s_mods;
@ -163,6 +172,21 @@ static void UI_Mods_LoadMods( void ) {
}
}
/*
===============
Added by Elder
UI_Mods_MenuDraw
===============
*/
static void UI_Mods_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &s_mods.menu );
}
/*
===============
@ -174,6 +198,7 @@ static void UI_Mods_MenuInit( void ) {
memset( &s_mods, 0 ,sizeof(mods_t) );
UI_ModsMenu_Cache();//Blaze: Moved below the memset
s_mods.menu.draw = UI_Mods_MenuDraw;
s_mods.menu.wrapAround = qtrue;
s_mods.menu.fullscreen = qtrue;//Blaze: full screen
s_mods.menu.showlogo = qtrue;//Blaze: Show background logo
@ -202,6 +227,8 @@ static void UI_Mods_MenuInit( void ) {
s_mods.framer.width = 256;
s_mods.framer.height = 334;
*/
/* Elder: Don't need these either
s_mods.multim.generic.type = MTYPE_PTEXT;
s_mods.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_mods.multim.generic.x = 120;
@ -241,27 +268,49 @@ static void UI_Mods_MenuInit( void ) {
s_mods.exitm.string = "EXIT";
s_mods.exitm.color = color_red;
s_mods.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
s_mods.back.generic.type = MTYPE_BITMAP;
s_mods.back.generic.name = ART_BACK0;
s_mods.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_mods.back.generic.id = ID_BACK;
s_mods.back.generic.callback = UI_Mods_MenuEvent;
s_mods.back.generic.x = 0;
s_mods.back.generic.y = 480-64;
s_mods.back.width = 128;
s_mods.back.height = 64;
s_mods.back.focuspic = ART_BACK1;
//Elder: Info for mods icon
s_mods.rq3_modsicon.generic.type = MTYPE_BITMAP;
s_mods.rq3_modsicon.generic.name = RQ3_MODS_ICON;
s_mods.rq3_modsicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_mods.rq3_modsicon.generic.x = 0;
s_mods.rq3_modsicon.generic.y = 4;
s_mods.rq3_modsicon.width = RQ3_ICON_WIDTH;
s_mods.rq3_modsicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for mods title
s_mods.rq3_modstitle.generic.type = MTYPE_BITMAP;
s_mods.rq3_modstitle.generic.name = RQ3_MODS_TITLE;
s_mods.rq3_modstitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_mods.rq3_modstitle.generic.x = 64;
s_mods.rq3_modstitle.generic.y = 12;
s_mods.rq3_modstitle.width = 256;
s_mods.rq3_modstitle.height = 32;
//Back button
s_mods.back.generic.type = MTYPE_BITMAP;
s_mods.back.generic.name = ART_BACK0;
s_mods.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_mods.back.generic.id = ID_BACK;
s_mods.back.generic.callback = UI_Mods_MenuEvent;
s_mods.back.generic.x = 8;
s_mods.back.generic.y = 480-44;
s_mods.back.width = 32;
s_mods.back.height = 32;
s_mods.back.focuspic = ART_BACK1;
//Elder: some metric changes
s_mods.go.generic.type = MTYPE_BITMAP;
s_mods.go.generic.name = ART_FIGHT0;
s_mods.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_mods.go.generic.id = ID_GO;
s_mods.go.generic.callback = UI_Mods_MenuEvent;
s_mods.go.generic.x = 640;
s_mods.go.generic.y = 480-64;
s_mods.go.width = 128;
s_mods.go.height = 64;
s_mods.go.generic.x = 632;
s_mods.go.generic.y = 480-44;
s_mods.go.width = 64;
s_mods.go.height = 32;
s_mods.go.focuspic = ART_FIGHT1;
// scan for mods
@ -270,7 +319,8 @@ static void UI_Mods_MenuInit( void ) {
s_mods.list.generic.callback = UI_Mods_MenuEvent;
s_mods.list.generic.id = ID_LIST;
s_mods.list.generic.x = 320;
s_mods.list.generic.y = 130;
//Elder: Readjusted height
s_mods.list.generic.y = 64;
s_mods.list.width = 48;
s_mods.list.height = 14;
@ -280,11 +330,16 @@ static void UI_Mods_MenuInit( void ) {
// Menu_AddItem( &s_mods.menu, &s_mods.banner );
// Menu_AddItem( &s_mods.menu, &s_mods.framel );
// Menu_AddItem( &s_mods.menu, &s_mods.framer );
Menu_AddItem( &s_mods.menu, &s_mods.multim );
Menu_AddItem( &s_mods.menu, &s_mods.setupm );
Menu_AddItem( &s_mods.menu, &s_mods.demom );
Menu_AddItem( &s_mods.menu, &s_mods.modsm );
Menu_AddItem( &s_mods.menu, &s_mods.exitm );
//Elder: Don't need these
// Menu_AddItem( &s_mods.menu, &s_mods.multim );
// Menu_AddItem( &s_mods.menu, &s_mods.setupm );
// Menu_AddItem( &s_mods.menu, &s_mods.demom );
// Menu_AddItem( &s_mods.menu, &s_mods.modsm );
// Menu_AddItem( &s_mods.menu, &s_mods.exitm );
//Elder: Added
Menu_AddItem( &s_mods.menu, &s_mods.rq3_modsicon );
Menu_AddItem( &s_mods.menu, &s_mods.rq3_modstitle );
Menu_AddItem( &s_mods.menu, &s_mods.list );
Menu_AddItem( &s_mods.menu, &s_mods.back );
@ -301,8 +356,12 @@ void UI_ModsMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( ART_FIGHT0 );
trap_R_RegisterShaderNoMip( ART_FIGHT1 );
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: Removed
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: Added
trap_R_RegisterShaderNoMip( RQ3_MODS_ICON );
trap_R_RegisterShaderNoMip( RQ3_MODS_TITLE );
}

View file

@ -10,11 +10,11 @@ NETWORK OPTIONS MENU
#include "ui_local.h"
#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"
//Elder: removed
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ID_GRAPHICS 10
#define ID_DISPLAY 11
@ -22,16 +22,31 @@ NETWORK OPTIONS MENU
#define ID_NETWORK 13
#define ID_RATE 14
#define ID_BACK 15
#define ID_RATE2 16
//Elder: RQ3 stuff
#define RQ3_SYSTEM_ICON "menu/art/rq3-setup-system.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
#define RQ3_GRAPHICS_BUTTON "menu/art/rq3-system-graphics.tga"
#define RQ3_DISPLAY_BUTTON "menu/art/rq3-system-display.tga"
#define RQ3_SOUND_BUTTON "menu/art/rq3-system-sound.tga"
#define RQ3_NETWORK_BUTTON "menu/art/rq3-system-network.tga"
//Elder: Number of digits in rate field
#define MAX_RATE_INPUT 6
/* Elder: added a few more options - but not used anymore;
static const char *rate_items[] = {
"<= 28.8K",
"33.6K",
"56K",
"ISDN",
"LAN/Cable/xDSL",
"2500 - 28.8K",
"3000 - 33.6K",
"4000 - 56K",
"5000 - ISDN",
"8000 - Low-bandwidth Cable/DSL",
"10000 - High-bandwidth Cable/DSL",
"25000 - LAN/T1 or better",
0
};
*/
typedef struct {
menuframework_s menu;
@ -40,23 +55,39 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
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;
menulist_s rate;
//Elder: removed
// 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;
// menulist_s rate;
menubitmap_s back;
//Elder: RQ3 stuff
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_systemicon;
menubitmap_s rq3_graphics;
menubitmap_s rq3_display;
menubitmap_s rq3_sound;
menubitmap_s rq3_network;
menufield_s rate_input;
menutext_s rq3_statustext;
int rate_counter;
} networkOptionsInfo_t;
static networkOptionsInfo_t networkOptionsInfo;
//Elder: prototypes
static void Network_SaveChanges( void );
static sfxHandle_t Network_MenuKey( int key );
/*
@ -65,69 +96,192 @@ UI_NetworkOptionsMenu_Event
=================
*/
static void UI_NetworkOptionsMenu_Event( void* ptr, int event ) {
if( event != QM_ACTIVATED ) {
//Elder: for status bar
if( event == QM_LOSTFOCUS ) {
networkOptionsInfo.rq3_statustext.string = "";
return;
}
else if ( event == QM_GOTFOCUS ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
networkOptionsInfo.rq3_statustext.string = "Change graphics settings";
break;
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
networkOptionsInfo.rq3_statustext.string = "Change display settings";
break;
case ID_DISPLAY:
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
break;
case ID_RATE:
if( networkOptionsInfo.rate.curvalue == 0 ) {
trap_Cvar_SetValue( "rate", 2500 );
case ID_SOUND:
networkOptionsInfo.rq3_statustext.string = "Change sound settings";
break;
case ID_NETWORK:
networkOptionsInfo.rq3_statustext.string = "Change network settings";
break;
case ID_BACK:
networkOptionsInfo.rq3_statustext.string = "Return to setup menu";
break;
case ID_RATE2:
networkOptionsInfo.rq3_statustext.string = "Set rate: click to choose or type in manually";
break;
default:
networkOptionsInfo.rq3_statustext.string = "";
break;
}
else if( networkOptionsInfo.rate.curvalue == 1 ) {
trap_Cvar_SetValue( "rate", 3000 );
}
else if( networkOptionsInfo.rate.curvalue == 2 ) {
trap_Cvar_SetValue( "rate", 4000 );
}
else if( networkOptionsInfo.rate.curvalue == 3 ) {
trap_Cvar_SetValue( "rate", 5000 );
}
else if( networkOptionsInfo.rate.curvalue == 4 ) {
trap_Cvar_SetValue( "rate", 25000 );
}
break;
case ID_BACK:
UI_PopMenu();
break;
}
else if( event == QM_ACTIVATED ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
Network_SaveChanges();
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
Network_SaveChanges();
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
Network_SaveChanges();
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
break;
case ID_RATE2:
//Elder: click to toggle
if( networkOptionsInfo.rate_counter == 0 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "2500", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 2500 );
}
else if( networkOptionsInfo.rate_counter == 1 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "3000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 3000 );
}
else if( networkOptionsInfo.rate_counter == 2 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "4000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 4000 );
}
else if( networkOptionsInfo.rate_counter == 3 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "5000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 5000 );
}
//Elder: added
else if( networkOptionsInfo.rate_counter == 4 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "8000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 8000 );
}
else if( networkOptionsInfo.rate_counter == 5 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "10000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 10000 );
}
else if( networkOptionsInfo.rate_counter == 6 ) {
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, "25000", sizeof(networkOptionsInfo.rate_input.field.buffer) );
//trap_Cvar_SetValue( "rate", 25000 );
}
if (networkOptionsInfo.rate_counter >= 6) {
networkOptionsInfo.rate_counter = 0;
}
else {
networkOptionsInfo.rate_counter++;
}
break;
//case ID_RATE2:
//Elder: not used anymore - unreliable
// trap_Cvar_SetValue( "rate", atoi(networkOptionsInfo.rate_input.field.buffer));
//break;
case ID_BACK:
//Elder: added
Network_SaveChanges();
UI_PopMenu();
break;
}
}
}
/*
=================
Added by Elder
Network_SaveChanges
Borrowed concept from ui_playersettings.c
=================
*/
static void Network_SaveChanges( void ) {
//Elder: Who's going to have rates >999999, let alone 99999?
char s_rate[6];
Q_strncpyz( s_rate, networkOptionsInfo.rate_input.field.buffer, sizeof(s_rate) );
if (strlen(s_rate) > 0) {
// save rate cvar
trap_Cvar_SetValue( "rate", atoi(networkOptionsInfo.rate_input.field.buffer));
}
}
/*
=================
Added by Elder
Network_MenuKey
Borrowed concept from ui_playersettings.c
=================
*/
static sfxHandle_t Network_MenuKey( int key ) {
//commit changes if leaving menus
if( key == K_MOUSE2 || key == K_ESCAPE ) {
Network_SaveChanges();
}
return Menu_DefaultKey( &networkOptionsInfo.menu, key );
}
/*
===============
Added by Elder
UI_NetworkOptionsMenu_Draw
===============
*/
static void UI_NetworkOptionsMenu_Draw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &networkOptionsInfo.menu );
}
/*
===============
UI_NetworkOptionsMenu_Init
===============
*/
static void UI_NetworkOptionsMenu_Init( void ) {
int y;
int rate;
int y = 12;
//Elder: not needed anymore
//int rate;
int buttonCount = 0;
memset( &networkOptionsInfo, 0, sizeof(networkOptionsInfo) );
UI_NetworkOptionsMenu_Cache();
networkOptionsInfo.menu.wrapAround = qtrue;
networkOptionsInfo.menu.fullscreen = qtrue;
networkOptionsInfo.menu.showlogo = qtrue;
networkOptionsInfo.rate_counter = 0;
//Elder: added draw function
networkOptionsInfo.menu.draw = UI_NetworkOptionsMenu_Draw;
//Elder: added to trap rate setting on exit (see Network_MenuKey())
networkOptionsInfo.menu.key = Network_MenuKey;
networkOptionsInfo.menu.wrapAround = qtrue;
networkOptionsInfo.menu.fullscreen = qtrue;
networkOptionsInfo.menu.showlogo = qtrue;
/* networkOptionsInfo.banner.generic.type = MTYPE_BTEXT;
networkOptionsInfo.banner.generic.flags = QMF_CENTER_JUSTIFY;
@ -153,6 +307,7 @@ static void UI_NetworkOptionsMenu_Init( void ) {
networkOptionsInfo.framer.width = 256;
networkOptionsInfo.framer.height = 334;
*/
/*Elder: removed
networkOptionsInfo.multim.generic.type = MTYPE_PTEXT;
networkOptionsInfo.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
networkOptionsInfo.multim.generic.x = 120;
@ -192,7 +347,107 @@ static void UI_NetworkOptionsMenu_Init( void ) {
networkOptionsInfo.exitm.string = "EXIT";
networkOptionsInfo.exitm.color = color_red;
networkOptionsInfo.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
networkOptionsInfo.rq3_systemicon.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_systemicon.generic.name = RQ3_SYSTEM_ICON;
networkOptionsInfo.rq3_systemicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
networkOptionsInfo.rq3_systemicon.generic.x = 0;
networkOptionsInfo.rq3_systemicon.generic.y = 4;
networkOptionsInfo.rq3_systemicon.width = RQ3_ICON_WIDTH;
networkOptionsInfo.rq3_systemicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
networkOptionsInfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
networkOptionsInfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
networkOptionsInfo.rq3_setuptitle.generic.x = 64;
networkOptionsInfo.rq3_setuptitle.generic.y = 12;
networkOptionsInfo.rq3_setuptitle.width = 256;
networkOptionsInfo.rq3_setuptitle.height = 32;
//Elder: Info for rate_input text field
networkOptionsInfo.rate_input.generic.type = MTYPE_FIELD;
networkOptionsInfo.rate_input.generic.name = "Data Rate (BPS):";
networkOptionsInfo.rate_input.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_NUMBERSONLY|QMF_SMALLFONT;
networkOptionsInfo.rate_input.field.widthInChars = MAX_RATE_INPUT;
networkOptionsInfo.rate_input.field.maxchars = MAX_RATE_INPUT;
networkOptionsInfo.rate_input.generic.x = 200;
networkOptionsInfo.rate_input.generic.y = 64;
networkOptionsInfo.rate_input.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rate_input.generic.id = ID_RATE2;
// Elder: removed for type-in
//y = 240 - 1 * (BIGCHAR_HEIGHT+2);
/*
networkOptionsInfo.rate.generic.type = MTYPE_SPINCONTROL;
networkOptionsInfo.rate.generic.name = "Data Rate (BPS):";
networkOptionsInfo.rate.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
networkOptionsInfo.rate.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rate.generic.id = ID_RATE;
networkOptionsInfo.rate.generic.x = 200; //Elder: hmm- doesn't correspond to virtual coordinates?
networkOptionsInfo.rate.generic.y = 64;
networkOptionsInfo.rate.itemnames = rate_items;
*/
//Elder: RQ3 Graphics Button
networkOptionsInfo.rq3_graphics.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_graphics.generic.name = RQ3_GRAPHICS_BUTTON;
networkOptionsInfo.rq3_graphics.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rq3_graphics.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
networkOptionsInfo.rq3_graphics.generic.y = y;
networkOptionsInfo.rq3_graphics.generic.id = ID_GRAPHICS;
networkOptionsInfo.rq3_graphics.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rq3_graphics.width = RQ3_BUTTON_WIDTH;
networkOptionsInfo.rq3_graphics.height = RQ3_BUTTON_HEIGHT;
networkOptionsInfo.rq3_graphics.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Display Button
networkOptionsInfo.rq3_display.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_display.generic.name = RQ3_DISPLAY_BUTTON;
networkOptionsInfo.rq3_display.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rq3_display.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
networkOptionsInfo.rq3_display.generic.y = y;
networkOptionsInfo.rq3_display.generic.id = ID_DISPLAY;
networkOptionsInfo.rq3_display.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rq3_display.width = RQ3_BUTTON_WIDTH;
networkOptionsInfo.rq3_display.height = RQ3_BUTTON_HEIGHT;
networkOptionsInfo.rq3_display.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Sound Button
networkOptionsInfo.rq3_sound.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_sound.generic.name = RQ3_SOUND_BUTTON;
networkOptionsInfo.rq3_sound.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rq3_sound.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
networkOptionsInfo.rq3_sound.generic.y = y;
networkOptionsInfo.rq3_sound.generic.id = ID_SOUND;
networkOptionsInfo.rq3_sound.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rq3_sound.width = RQ3_BUTTON_WIDTH;
networkOptionsInfo.rq3_sound.height = RQ3_BUTTON_HEIGHT;
networkOptionsInfo.rq3_sound.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Network Button
networkOptionsInfo.rq3_network.generic.type = MTYPE_BITMAP;
networkOptionsInfo.rq3_network.generic.name = RQ3_NETWORK_BUTTON;
networkOptionsInfo.rq3_network.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rq3_network.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
networkOptionsInfo.rq3_network.generic.y = y;
networkOptionsInfo.rq3_network.generic.id = ID_NETWORK;
networkOptionsInfo.rq3_network.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rq3_network.width = RQ3_BUTTON_WIDTH;
networkOptionsInfo.rq3_network.height = RQ3_BUTTON_HEIGHT;
networkOptionsInfo.rq3_network.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Status Text
networkOptionsInfo.rq3_statustext.generic.type = MTYPE_TEXT;
networkOptionsInfo.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
networkOptionsInfo.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
networkOptionsInfo.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
networkOptionsInfo.rq3_statustext.string = "";
networkOptionsInfo.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
networkOptionsInfo.rq3_statustext.color = color_orange;
/* Elder: replaced by RQ3 buttons
networkOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
networkOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
networkOptionsInfo.graphics.generic.id = ID_GRAPHICS;
@ -202,6 +457,7 @@ static void UI_NetworkOptionsMenu_Init( void ) {
networkOptionsInfo.graphics.string = "GRAPHICS";
networkOptionsInfo.graphics.style = UI_RIGHT;
networkOptionsInfo.graphics.color = color_red;
networkOptionsInfo.display.generic.type = MTYPE_PTEXT;
networkOptionsInfo.display.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
@ -232,45 +488,50 @@ static void UI_NetworkOptionsMenu_Init( void ) {
networkOptionsInfo.network.string = "NETWORK";
networkOptionsInfo.network.style = UI_RIGHT;
networkOptionsInfo.network.color = color_red;
y = 240 - 1 * (BIGCHAR_HEIGHT+2);
networkOptionsInfo.rate.generic.type = MTYPE_SPINCONTROL;
networkOptionsInfo.rate.generic.name = "Data Rate:";
networkOptionsInfo.rate.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
networkOptionsInfo.rate.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rate.generic.id = ID_RATE;
networkOptionsInfo.rate.generic.x = 400;
networkOptionsInfo.rate.generic.y = y;
networkOptionsInfo.rate.itemnames = rate_items;
*/
networkOptionsInfo.back.generic.type = MTYPE_BITMAP;
networkOptionsInfo.back.generic.name = ART_BACK0;
networkOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
networkOptionsInfo.back.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.back.generic.id = ID_BACK;
networkOptionsInfo.back.generic.x = 0;
networkOptionsInfo.back.generic.y = 480-64;
networkOptionsInfo.back.width = 128;
networkOptionsInfo.back.height = 64;
networkOptionsInfo.back.generic.x = 8;
networkOptionsInfo.back.generic.y = 480-44;
networkOptionsInfo.back.width = 32;
networkOptionsInfo.back.height = 32;
networkOptionsInfo.back.focuspic = ART_BACK1;
//Elder: removed
// Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.banner );
// Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framel );
// Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framer );
Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.multim );
Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.setupm );
Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.demom );
Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.modsm );
Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.exitm );
// Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.multim );
// Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.setupm );
// Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.demom );
// Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.modsm );
// Menu_AddItem( &networkOptionsInfo.menu, &networkOptionsInfo.exitm );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.graphics );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.display );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.sound );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.network );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate );
//Elder: added
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_systemicon );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_setuptitle );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_graphics );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_display );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_sound );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_network );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate_input );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rq3_statustext );
//Elder: Removed for RQ3 stuff
//Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.graphics );
//Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.display );
//Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.sound );
//Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.network );
//Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate );
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.back );
rate = trap_Cvar_VariableValue( "rate" );
//Elder: copy cvar value into field buffer
Q_strncpyz( networkOptionsInfo.rate_input.field.buffer, UI_Cvar_VariableString("rate"), sizeof(networkOptionsInfo.rate_input.field.buffer) );
/*Elder: not needed anymore
if( rate <= 2500 ) {
networkOptionsInfo.rate.curvalue = 0;
}
@ -283,9 +544,16 @@ static void UI_NetworkOptionsMenu_Init( void ) {
else if( rate <= 5000 ) {
networkOptionsInfo.rate.curvalue = 3;
}
else {
else if( rate <= 8000 ) {
networkOptionsInfo.rate.curvalue = 4;
}
else if( rate <= 10000 ) {
networkOptionsInfo.rate.curvalue = 5;
}
else {
networkOptionsInfo.rate.curvalue = 6;
}
*/
}
@ -295,12 +563,24 @@ UI_NetworkOptionsMenu_Cache
===============
*/
void UI_NetworkOptionsMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: removed
// trap_R_RegisterShaderNoMip( ART_FRAMEL );
// trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
//Elder: added
trap_R_RegisterShaderNoMip( RQ3_SYSTEM_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
trap_R_RegisterShaderNoMip( RQ3_GRAPHICS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DISPLAY_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SOUND_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_NETWORK_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
// name
//static void Network_SetMenuItems( void ) {
//Q_strncpyz( s_playersettings.name.field.buffer, UI_Cvar_VariableString("name"), sizeof(s_playersettings.name.field.buffer) );
/*
===============
@ -310,5 +590,6 @@ UI_NetworkOptionsMenu
void UI_NetworkOptionsMenu( void ) {
UI_NetworkOptionsMenu_Init();
UI_PushMenu( &networkOptionsInfo.menu );
Menu_SetCursorToItem( &networkOptionsInfo.menu, &networkOptionsInfo.network );
//Elder: shifted to .rq3_network instead of .network
Menu_SetCursorToItem( &networkOptionsInfo.menu, &networkOptionsInfo.rq3_network );
}

View file

@ -1,3 +1,4 @@
//Elder note: It appears that Quake 3 doesn't use this menu anymore.
/*
=======================================================================
@ -8,9 +9,9 @@ SYSTEM CONFIGURATION MENU
#include "ui_local.h"
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
//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"
@ -29,11 +30,12 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//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;
@ -85,8 +87,9 @@ SystemConfig_Cache
===============
*/
void SystemConfig_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: removed
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
}
@ -138,6 +141,7 @@ void Options_MenuInit( void ) {
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;
@ -177,7 +181,7 @@ void Options_MenuInit( void ) {
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;
@ -236,11 +240,12 @@ void Options_MenuInit( void ) {
// 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 );
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 );
//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 );

View file

@ -2,12 +2,14 @@
//
#include "ui_local.h"
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ART_MODEL0 "menu/art/model_0"
#define ART_MODEL1 "menu/art/model_1"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
//#define ART_BACK0 "menu/art/back_0"
//#define ART_BACK1 "menu/art/back_1"
#define ART_FX_BASE "menu/art/fx_base"
#define ART_FX_BLUE "menu/art/fx_blue"
#define ART_FX_CYAN "menu/art/fx_cyan"
@ -17,6 +19,10 @@
#define ART_FX_WHITE "menu/art/fx_white"
#define ART_FX_YELLOW "menu/art/fx_yel"
//Elder: RQ3 stuff
#define RQ3_SETUP_ICON "menu/art/rq3-setup-player.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define ID_NAME 10
#define ID_HANDICAP 11
#define ID_EFFECTS 12
@ -33,12 +39,17 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
/* Elder: removed
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
*/
//Elder: RQ3 stuff
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_setupicon;
menubitmap_s player;
menufield_s name;
@ -47,7 +58,7 @@ typedef struct {
menubitmap_s back;
menubitmap_s model;
menubitmap_s item_null;
//menubitmap_s item_null;
qhandle_t fxBasePic;
qhandle_t fxPic[7];
@ -227,7 +238,7 @@ static void PlayerSettings_DrawPlayer( void *self ) {
UI_PlayerInfo_SetModel( &s_playersettings.playerinfo, buf );
strcpy( s_playersettings.playerModel, buf );
viewangles[YAW] = 180 - 30;
viewangles[YAW] = 180 - 60;
viewangles[PITCH] = 0;
viewangles[ROLL] = 0;
//Blaze: Default draw of player, changed WP_MACHINEGUN to WP_PISTOL
@ -333,6 +344,21 @@ static void PlayerSettings_MenuEvent( void* ptr, int event ) {
}
}
/*
===============
Added by Elder
PlayerSettings_MenuDraw
===============
*/
static void PlayerSettings_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &s_playersettings.menu );
}
/*
=================
@ -346,6 +372,7 @@ static void PlayerSettings_MenuInit( void ) {
PlayerSettings_Cache();
s_playersettings.menu.draw = PlayerSettings_MenuDraw;
s_playersettings.menu.key = PlayerSettings_MenuKey;
s_playersettings.menu.wrapAround = qtrue;
s_playersettings.menu.fullscreen = qtrue;
@ -374,6 +401,7 @@ static void PlayerSettings_MenuInit( void ) {
s_playersettings.framer.width = 256;
s_playersettings.framer.height = 334;
*/
/* Elder: removed
s_playersettings.multim.generic.type = MTYPE_PTEXT;
s_playersettings.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_playersettings.multim.generic.x = 120;
@ -414,7 +442,26 @@ static void PlayerSettings_MenuInit( void ) {
s_playersettings.exitm.string = "EXIT";
s_playersettings.exitm.color = color_red;
s_playersettings.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
s_playersettings.rq3_setupicon.generic.type = MTYPE_BITMAP;
s_playersettings.rq3_setupicon.generic.name = RQ3_SETUP_ICON;
s_playersettings.rq3_setupicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_playersettings.rq3_setupicon.generic.x = 0;
s_playersettings.rq3_setupicon.generic.y = 4;
s_playersettings.rq3_setupicon.width = RQ3_ICON_WIDTH;
s_playersettings.rq3_setupicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
s_playersettings.rq3_setuptitle.generic.type = MTYPE_BITMAP;
s_playersettings.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
s_playersettings.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_playersettings.rq3_setuptitle.generic.x = 64;
s_playersettings.rq3_setuptitle.generic.y = 12;
s_playersettings.rq3_setuptitle.width = 256;
s_playersettings.rq3_setuptitle.height = 32;
y = 144;
s_playersettings.name.generic.type = MTYPE_FIELD;
s_playersettings.name.generic.flags = QMF_NODEFAULTINIT;
@ -478,27 +525,31 @@ static void PlayerSettings_MenuInit( void ) {
s_playersettings.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_playersettings.back.generic.id = ID_BACK;
s_playersettings.back.generic.callback = PlayerSettings_MenuEvent;
s_playersettings.back.generic.x = 0;
s_playersettings.back.generic.y = 480-64;
s_playersettings.back.width = 128;
s_playersettings.back.height = 64;
s_playersettings.back.generic.x = 8;
s_playersettings.back.generic.y = 480-44;
s_playersettings.back.width = 32;
s_playersettings.back.height = 32;
s_playersettings.back.focuspic = ART_BACK1;
s_playersettings.item_null.generic.type = MTYPE_BITMAP;
s_playersettings.item_null.generic.flags = QMF_LEFT_JUSTIFY|QMF_MOUSEONLY|QMF_SILENT;
s_playersettings.item_null.generic.x = 0;
s_playersettings.item_null.generic.y = 0;
s_playersettings.item_null.width = 640;
s_playersettings.item_null.height = 480;
//s_playersettings.item_null.generic.type = MTYPE_BITMAP;
//s_playersettings.item_null.generic.flags = QMF_LEFT_JUSTIFY|QMF_MOUSEONLY|QMF_SILENT;
//s_playersettings.item_null.generic.x = 0;
//s_playersettings.item_null.generic.y = 0;
//s_playersettings.item_null.width = 640;
//s_playersettings.item_null.height = 480;
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.banner );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.framel );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.framer );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.multim );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.setupm );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.demom );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.modsm );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.exitm );
//Elder: removed
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.multim );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.setupm );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.demom );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.modsm );
// Menu_AddItem( &s_playersettings.menu, &s_playersettings.exitm );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.rq3_setupicon );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.rq3_setuptitle );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.name );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.handicap );
@ -508,7 +559,7 @@ static void PlayerSettings_MenuInit( void ) {
Menu_AddItem( &s_playersettings.menu, &s_playersettings.player );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.item_null );
//Menu_AddItem( &s_playersettings.menu, &s_playersettings.item_null );
PlayerSettings_SetMenuItems();
}
@ -520,12 +571,15 @@ PlayerSettings_Cache
=================
*/
void PlayerSettings_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_MODEL0 );
trap_R_RegisterShaderNoMip( ART_MODEL1 );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( RQ3_SETUP_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
s_playersettings.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE );
s_playersettings.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED );

View file

@ -11,13 +11,17 @@ GAME OPTIONS 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/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#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"
//Elder: RQ3 Setup assets
#define RQ3_SETUP_ICON "menu/art/rq3-setup-options.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.jpg"
#define PREFERENCES_X_POS 360
#define PREFERENCES_X_POS 200
#define ID_CROSSHAIR 127
#define ID_SIMPLEITEMS 128
@ -34,6 +38,9 @@ GAME OPTIONS MENU
#define NUM_CROSSHAIRS 10
//Elder: RQ3 stuff
#define ID_MUZZLEFLASH 139
typedef struct {
menuframework_s menu;
@ -41,11 +48,19 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: removed
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
//Elder: RQ3 Stuff
menubitmap_s rq3_setupicon;
menubitmap_s rq3_setuptitle;
menutext_s rq3_statustext;
menuradiobutton_s rq3_muzzleflash;
menulist_s crosshair;
menuradiobutton_s simpleitems;
@ -74,6 +89,22 @@ static const char *teamoverlay_names[] =
0
};
/*
===============
Added by Elder
Preferences_MenuDraw
===============
*/
static void Preferences_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &s_preferences.menu );
}
static void Preferences_SetMenuItems( void ) {
s_preferences.crosshair.curvalue = (int)trap_Cvar_VariableValue( "cg_drawCrosshair" ) % NUM_CROSSHAIRS;
s_preferences.simpleitems.curvalue = trap_Cvar_VariableValue( "cg_simpleItems" ) != 0;
@ -86,69 +117,139 @@ static void Preferences_SetMenuItems( void ) {
s_preferences.forcemodel.curvalue = trap_Cvar_VariableValue( "cg_forcemodel" ) != 0;
s_preferences.drawteamoverlay.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue( "cg_drawTeamOverlay" ) );
s_preferences.allowdownload.curvalue = trap_Cvar_VariableValue( "cl_allowDownload" ) != 0;
//Elder: added
s_preferences.rq3_muzzleflash.curvalue = trap_Cvar_VariableValue( "rxn_flash" ) != 0;
}
static void Preferences_Event( void* ptr, int notification ) {
if( notification != QM_ACTIVATED ) {
return;
static void Preferences_Event( void* ptr, int event ) {
//Elder: Added status messages on event focus
if ( event == QM_LOSTFOCUS ) {
s_preferences.rq3_statustext.string = "";
}
else if ( event == QM_GOTFOCUS ) {
//get menu item id
switch( ((menucommon_s*)ptr)->id ) {
case ID_CROSSHAIR:
s_preferences.rq3_statustext.string = "Change regular crosshair style";
break;
case ID_SIMPLEITEMS:
s_preferences.rq3_statustext.string = "Enable 2D sprite items";
break;
case ID_HIGHQUALITYSKY:
s_preferences.rq3_statustext.string = "Enable high quality sky";
break;
case ID_EJECTINGBRASS:
s_preferences.rq3_statustext.string = "Enable shell ejections";
break;
case ID_WALLMARKS:
s_preferences.rq3_statustext.string = "Enable wall marks";
break;
case ID_DYNAMICLIGHTS:
s_preferences.rq3_statustext.string = "Enable dynamic lighting";
break;
case ID_IDENTIFYTARGET:
s_preferences.rq3_statustext.string = "Enable crosshair target identification";
break;
case ID_SYNCEVERYFRAME:
s_preferences.rq3_statustext.string = "Enable V-SYNC (recommended off)";
break;
case ID_FORCEMODEL:
s_preferences.rq3_statustext.string = "Force player models to your own";
break;
case ID_DRAWTEAMOVERLAY:
s_preferences.rq3_statustext.string = "Choose team overlay position";
break;
case ID_ALLOWDOWNLOAD:
s_preferences.rq3_statustext.string = "Allow automatic downloads from server";
break;
case ID_MUZZLEFLASH:
s_preferences.rq3_statustext.string = "Enable weapon muzzle flashes";
break;
case ID_BACK:
s_preferences.rq3_statustext.string = "Return to main menu";
break;
default:
s_preferences.rq3_statustext.string = "";
break;
}
}
switch( ((menucommon_s*)ptr)->id ) {
case ID_CROSSHAIR:
s_preferences.crosshair.curvalue++;
if( s_preferences.crosshair.curvalue == NUM_CROSSHAIRS ) {
s_preferences.crosshair.curvalue = 0;
}
trap_Cvar_SetValue( "cg_drawCrosshair", s_preferences.crosshair.curvalue );
break;
case ID_SIMPLEITEMS:
trap_Cvar_SetValue( "cg_simpleItems", s_preferences.simpleitems.curvalue );
break;
case ID_HIGHQUALITYSKY:
trap_Cvar_SetValue( "r_fastsky", !s_preferences.highqualitysky.curvalue );
break;
case ID_EJECTINGBRASS:
if ( s_preferences.brass.curvalue )
trap_Cvar_Reset( "cg_brassTime" );
else
trap_Cvar_SetValue( "cg_brassTime", 0 );
break;
case ID_WALLMARKS:
trap_Cvar_SetValue( "cg_marks", s_preferences.wallmarks.curvalue );
break;
case ID_DYNAMICLIGHTS:
trap_Cvar_SetValue( "r_dynamiclight", s_preferences.dynamiclights.curvalue );
break;
case ID_IDENTIFYTARGET:
trap_Cvar_SetValue( "cg_drawCrosshairNames", s_preferences.identifytarget.curvalue );
break;
case ID_SYNCEVERYFRAME:
trap_Cvar_SetValue( "r_finish", s_preferences.synceveryframe.curvalue );
break;
case ID_FORCEMODEL:
trap_Cvar_SetValue( "cg_forcemodel", s_preferences.forcemodel.curvalue );
break;
case ID_DRAWTEAMOVERLAY:
trap_Cvar_SetValue( "cg_drawTeamOverlay", s_preferences.drawteamoverlay.curvalue );
break;
case ID_ALLOWDOWNLOAD:
trap_Cvar_SetValue( "cl_allowDownload", s_preferences.allowdownload.curvalue );
break;
case ID_BACK:
UI_PopMenu();
break;
else if ( event == QM_ACTIVATED ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_CROSSHAIR:
s_preferences.crosshair.curvalue++;
if( s_preferences.crosshair.curvalue == NUM_CROSSHAIRS ) {
s_preferences.crosshair.curvalue = 0;
}
trap_Cvar_SetValue( "cg_drawCrosshair", s_preferences.crosshair.curvalue );
break;
case ID_SIMPLEITEMS:
trap_Cvar_SetValue( "cg_simpleItems", s_preferences.simpleitems.curvalue );
break;
case ID_HIGHQUALITYSKY:
trap_Cvar_SetValue( "r_fastsky", !s_preferences.highqualitysky.curvalue );
break;
case ID_EJECTINGBRASS:
if ( s_preferences.brass.curvalue )
trap_Cvar_Reset( "cg_brassTime" );
else
trap_Cvar_SetValue( "cg_brassTime", 0 );
break;
case ID_WALLMARKS:
trap_Cvar_SetValue( "cg_marks", s_preferences.wallmarks.curvalue );
break;
case ID_DYNAMICLIGHTS:
trap_Cvar_SetValue( "r_dynamiclight", s_preferences.dynamiclights.curvalue );
break;
case ID_IDENTIFYTARGET:
trap_Cvar_SetValue( "cg_drawCrosshairNames", s_preferences.identifytarget.curvalue );
break;
case ID_SYNCEVERYFRAME:
trap_Cvar_SetValue( "r_finish", s_preferences.synceveryframe.curvalue );
break;
case ID_FORCEMODEL:
trap_Cvar_SetValue( "cg_forcemodel", s_preferences.forcemodel.curvalue );
break;
case ID_DRAWTEAMOVERLAY:
trap_Cvar_SetValue( "cg_drawTeamOverlay", s_preferences.drawteamoverlay.curvalue );
break;
case ID_ALLOWDOWNLOAD:
trap_Cvar_SetValue( "cl_allowDownload", s_preferences.allowdownload.curvalue );
break;
case ID_MUZZLEFLASH:
trap_Cvar_SetValue( "rxn_flash", s_preferences.allowdownload.curvalue );
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
}
@ -208,7 +309,8 @@ static void Preferences_MenuInit( void ) {
memset( &s_preferences, 0 ,sizeof(preferences_t) );
Preferences_Cache();
//Elder: added draw function
s_preferences.menu.draw = Preferences_MenuDraw;
s_preferences.menu.wrapAround = qtrue;
s_preferences.menu.fullscreen = qtrue;
s_preferences.menu.showlogo = qtrue;
@ -236,6 +338,7 @@ static void Preferences_MenuInit( void ) {
s_preferences.framer.width = 256;
s_preferences.framer.height = 334;
*/
/* Elder: removed
s_preferences.multim.generic.type = MTYPE_PTEXT;
s_preferences.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_preferences.multim.generic.x = 120;
@ -275,9 +378,27 @@ static void Preferences_MenuInit( void ) {
s_preferences.exitm.string = "EXIT";
s_preferences.exitm.color = color_red;
s_preferences.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for setup icon
s_preferences.rq3_setupicon.generic.type = MTYPE_BITMAP;
s_preferences.rq3_setupicon.generic.name = RQ3_SETUP_ICON;
s_preferences.rq3_setupicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_preferences.rq3_setupicon.generic.x = 0;
s_preferences.rq3_setupicon.generic.y = 4;
s_preferences.rq3_setupicon.width = RQ3_ICON_WIDTH;
s_preferences.rq3_setupicon.height = RQ3_ICON_HEIGHT;
y = 144;
//Elder: Info for setup title
s_preferences.rq3_setuptitle.generic.type = MTYPE_BITMAP;
s_preferences.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
s_preferences.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_preferences.rq3_setuptitle.generic.x = 64;
s_preferences.rq3_setuptitle.generic.y = 12;
s_preferences.rq3_setuptitle.width = 256;
s_preferences.rq3_setuptitle.height = 32;
y = 64;
s_preferences.crosshair.generic.type = MTYPE_TEXT;
s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
s_preferences.crosshair.generic.x = PREFERENCES_X_POS;
@ -327,6 +448,15 @@ static void Preferences_MenuInit( void ) {
s_preferences.dynamiclights.generic.x = PREFERENCES_X_POS;
s_preferences.dynamiclights.generic.y = y;
y += BIGCHAR_HEIGHT+2;
s_preferences.rq3_muzzleflash.generic.type = MTYPE_RADIOBUTTON;
s_preferences.rq3_muzzleflash.generic.name = "Muzzle Flash:";
s_preferences.rq3_muzzleflash.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_preferences.rq3_muzzleflash.generic.callback = Preferences_Event;
s_preferences.rq3_muzzleflash.generic.id = ID_MUZZLEFLASH;
s_preferences.rq3_muzzleflash.generic.x = PREFERENCES_X_POS;
s_preferences.rq3_muzzleflash.generic.y = y;
y += BIGCHAR_HEIGHT+2;
s_preferences.identifytarget.generic.type = MTYPE_RADIOBUTTON;
s_preferences.identifytarget.generic.name = "Identify Target:";
@ -382,32 +512,47 @@ static void Preferences_MenuInit( void ) {
s_preferences.allowdownload.generic.x = PREFERENCES_X_POS;
s_preferences.allowdownload.generic.y = y;
//Elder: RQ3 Status Text
s_preferences.rq3_statustext.generic.type = MTYPE_TEXT;
s_preferences.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
s_preferences.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
s_preferences.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
s_preferences.rq3_statustext.string = "";
s_preferences.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
s_preferences.rq3_statustext.color = color_orange;
y += BIGCHAR_HEIGHT+2;
s_preferences.back.generic.type = MTYPE_BITMAP;
s_preferences.back.generic.name = ART_BACK0;
s_preferences.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_preferences.back.generic.callback = Preferences_Event;
s_preferences.back.generic.id = ID_BACK;
s_preferences.back.generic.x = 0;
s_preferences.back.generic.y = 480-64;
s_preferences.back.width = 128;
s_preferences.back.height = 64;
s_preferences.back.generic.x = 8;
s_preferences.back.generic.y = 480-44;
s_preferences.back.width = 32;
s_preferences.back.height = 32;
s_preferences.back.focuspic = ART_BACK1;
// Menu_AddItem( &s_preferences.menu, &s_preferences.banner );
// Menu_AddItem( &s_preferences.menu, &s_preferences.framel );
// Menu_AddItem( &s_preferences.menu, &s_preferences.framer );
Menu_AddItem( &s_preferences.menu, &s_preferences.multim );
Menu_AddItem( &s_preferences.menu, &s_preferences.setupm );
Menu_AddItem( &s_preferences.menu, &s_preferences.demom );
Menu_AddItem( &s_preferences.menu, &s_preferences.modsm );
Menu_AddItem( &s_preferences.menu, &s_preferences.exitm );
//Elder: removed
// Menu_AddItem( &s_preferences.menu, &s_preferences.multim );
// Menu_AddItem( &s_preferences.menu, &s_preferences.setupm );
// Menu_AddItem( &s_preferences.menu, &s_preferences.demom );
// Menu_AddItem( &s_preferences.menu, &s_preferences.modsm );
// Menu_AddItem( &s_preferences.menu, &s_preferences.exitm );
//Elder: added
Menu_AddItem( &s_preferences.menu, &s_preferences.rq3_setupicon );
Menu_AddItem( &s_preferences.menu, &s_preferences.rq3_setuptitle );
Menu_AddItem( &s_preferences.menu, &s_preferences.crosshair );
Menu_AddItem( &s_preferences.menu, &s_preferences.simpleitems );
Menu_AddItem( &s_preferences.menu, &s_preferences.wallmarks );
Menu_AddItem( &s_preferences.menu, &s_preferences.brass );
Menu_AddItem( &s_preferences.menu, &s_preferences.dynamiclights );
Menu_AddItem( &s_preferences.menu, &s_preferences.rq3_muzzleflash );
Menu_AddItem( &s_preferences.menu, &s_preferences.identifytarget );
Menu_AddItem( &s_preferences.menu, &s_preferences.highqualitysky );
Menu_AddItem( &s_preferences.menu, &s_preferences.synceveryframe );
@ -417,6 +562,8 @@ static void Preferences_MenuInit( void ) {
Menu_AddItem( &s_preferences.menu, &s_preferences.back );
Menu_AddItem( &s_preferences.menu, &s_preferences.rq3_statustext );
Preferences_SetMenuItems();
}
@ -429,10 +576,13 @@ Preferences_Cache
void Preferences_Cache( void ) {
int n;
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: removed
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( RQ3_SETUP_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
s_preferences.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
}

View file

@ -11,6 +11,8 @@ sfxHandle_t menu_in_sound;
sfxHandle_t menu_move_sound;
sfxHandle_t menu_out_sound;
sfxHandle_t menu_buzz_sound;
//Elder: added
sfxHandle_t menu_type_sound;
sfxHandle_t menu_null_sound;
//sfxHandle_t weaponChangeSound;
@ -29,11 +31,16 @@ vec4_t color_orange = {1.00f, 0.43f, 0.00f, 1.00f};
vec4_t color_red = {1.00, 0.00, 0.00, 1.00};
vec4_t color_dim = {0.00, 0.00, 0.00, 0.25};
//Elder: Added new colors
vec4_t color_deepdim = {0.00, 0.00, 0.00, 0.75};
// current color scheme
vec4_t pulse_color = {1.00, 1.00, 1.00, 1.00};
vec4_t text_color_disabled = {0.50, 0.50, 0.50, 1.00}; // light gray
vec4_t text_color_normal = {1.00, 0.43f, 0.00, 1.00}; // light orange
vec4_t text_color_highlight = {1.00, 1.00, 0.00, 1.00}; // bright yellow
//Elder: modified
vec4_t text_color_highlight = {1.00, 1.00, 1.00, 1.00}; // bright white
//vec4_t text_color_highlight = {1.00, 1.00, 0.00, 1.00}; // bright yellow
vec4_t listbar_color = {1.00, 0.43f, 0.00, 0.30f}; // transluscent orange
vec4_t text_color_status = {1.00, 1.00, 1.00, 1.00}; // bright white
@ -1701,16 +1708,18 @@ void Menu_Cache( void )
uis.whiteShader = trap_R_RegisterShaderNoMip( "white" );
if ( uis.glconfig.hardwareType == GLHW_RAGEPRO ) {
// the blend effect turns to shit with the normal
uis.menuBackShader = trap_R_RegisterShaderNoMip( "menubackRagePro" );
uis.menuBackShader = trap_R_RegisterShaderNoMip( "rq3-menubackRagePro" );
} else {
uis.menuBackShader = trap_R_RegisterShaderNoMip( "menuback" );
uis.menuBackShader = trap_R_RegisterShaderNoMip( "rq3-menuback" );
}
uis.menuBackNoLogoShader = trap_R_RegisterShaderNoMip( "menubacknologo" );
uis.menuBackNoLogoShader = trap_R_RegisterShaderNoMip( "rq3-menubacknologo" );
menu_in_sound = trap_S_RegisterSound( "sound/misc/menu1.wav", qfalse );
menu_move_sound = trap_S_RegisterSound( "sound/misc/menu2.wav", qfalse );
menu_out_sound = trap_S_RegisterSound( "sound/misc/menu3.wav", qfalse );
menu_buzz_sound = trap_S_RegisterSound( "sound/misc/menu4.wav", qfalse );
//Elder: added
menu_type_sound = trap_S_RegisterSound( "sound/misc/menu_type.wav", qfalse );
weaponChangeSound = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse );
// need a nonzero sound, make an empty sound for this

View file

@ -13,10 +13,11 @@ SETUP MENU
#define SETUP_MENU_VERTICAL_SPACING 20//Changed to 20
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
//Elder: Don't need these either
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ID_CUSTOMIZEPLAYER 10
#define ID_CUSTOMIZECONTROLS 11
@ -28,6 +29,16 @@ SETUP MENU
#define ID_DEFAULTS 17
#define ID_BACK 18
//Elder: RQ3 Setup assets
#define RQ3_SETUP_ICON "menu/art/rq3-menu-setup.tga"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.jpg"
#define RQ3_SETUP_DEFAULTS "menu/art/rq3-setup-defaults.jpg"
#define RQ3_SETUP_PLAYER "menu/art/rq3-setup-player.jpg"
#define RQ3_SETUP_CONTROLS "menu/art/rq3-setup-controls.jpg"
#define RQ3_SETUP_CDKEY "menu/art/rq3-setup-cdkey.jpg"
#define RQ3_SETUP_SYSTEM "menu/art/rq3-setup-system.jpg"
#define RQ3_SETUP_OPTIONS "menu/art/rq3-setup-options.jpg"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
typedef struct {
menuframework_s menu;
@ -36,21 +47,36 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: Don't need these anymore either
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
menutext_s setupplayer;
menutext_s setupcontrols;
menutext_s setupsystem;
menutext_s game;
menutext_s cdkey;
// menutext_s setupplayer;
// menutext_s setupcontrols;
// menutext_s setupsystem;
// menutext_s game;
// menutext_s cdkey;
// menutext_s load;
// menutext_s save;
menutext_s defaults;
// menutext_s defaults;
menubitmap_s back;
//Elder: RQ3 Menu buttons
menubitmap_s rq3_setupicon;
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_setupcdkey;
menubitmap_s rq3_setupdefaults;
menubitmap_s rq3_setupcontrols;
menubitmap_s rq3_setupplayer;
menubitmap_s rq3_setupoptions;
menubitmap_s rq3_setupsystem;
menutext_s rq3_statustext;
} setupMenuInfo_t;
static setupMenuInfo_t setupMenuInfo;
@ -81,6 +107,21 @@ static void Setup_ResetDefaults_Draw( void ) {
UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 1, "options to their default values.", UI_CENTER|UI_SMALLFONT, color_yellow );
}
/*
===============
Added by Elder
Setup_MenuDraw
===============
*/
static void Setup_MenuDraw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &setupMenuInfo.menu );
}
/*
===============
@ -88,30 +129,68 @@ UI_SetupMenu_Event
===============
*/
static void UI_SetupMenu_Event( void *ptr, int event ) {
if( event != QM_ACTIVATED ) {
return;
//Elder: Added status messages on event focus
if ( event == QM_LOSTFOCUS ) {
setupMenuInfo.rq3_statustext.string = "";
}
else if( event == QM_GOTFOCUS ) {
//get menu item id
switch( ((menucommon_s*)ptr)->id ) {
case ID_CUSTOMIZEPLAYER:
setupMenuInfo.rq3_statustext.string = "Change player settings";
break;
case ID_CUSTOMIZECONTROLS:
setupMenuInfo.rq3_statustext.string = "Change Reaction controls";
break;
case ID_SYSTEMCONFIG:
setupMenuInfo.rq3_statustext.string = "Change system settings";
break;
case ID_GAME:
setupMenuInfo.rq3_statustext.string = "Change game options";
break;
case ID_CDKEY:
setupMenuInfo.rq3_statustext.string = "Set the Quake 3 CD-key";
break;
case ID_DEFAULTS:
setupMenuInfo.rq3_statustext.string = "Reset all settings back to default";
break;
switch( ((menucommon_s*)ptr)->id ) {
case ID_CUSTOMIZEPLAYER:
UI_PlayerSettingsMenu();
break;
case ID_BACK:
setupMenuInfo.rq3_statustext.string = "Return to main menu";
break;
default:
setupMenuInfo.rq3_statustext.string = "";
break;
}
}
else if( event == QM_ACTIVATED ) {
setupMenuInfo.rq3_statustext.string = "";
switch( ((menucommon_s*)ptr)->id ) {
case ID_CUSTOMIZEPLAYER:
UI_PlayerSettingsMenu();
break;
case ID_CUSTOMIZECONTROLS:
UI_ControlsMenu();
break;
case ID_CUSTOMIZECONTROLS:
UI_ControlsMenu();
break;
case ID_SYSTEMCONFIG:
UI_GraphicsOptionsMenu();
break;
case ID_SYSTEMCONFIG:
UI_GraphicsOptionsMenu();
break;
case ID_GAME:
UI_PreferencesMenu();
break;
case ID_GAME:
UI_PreferencesMenu();
break;
case ID_CDKEY:
UI_CDKeyMenu();
break;
case ID_CDKEY:
UI_CDKeyMenu();
break;
// case ID_LOAD:
// UI_LoadConfigMenu();
@ -121,13 +200,14 @@ static void UI_SetupMenu_Event( void *ptr, int event ) {
// UI_SaveConfigMenu();
// break;
case ID_DEFAULTS:
UI_ConfirmMenu( "SET TO DEFAULTS?", Setup_ResetDefaults_Draw, Setup_ResetDefaults_Action );
break;
case ID_DEFAULTS:
UI_ConfirmMenu( "SET TO DEFAULTS?", Setup_ResetDefaults_Draw, Setup_ResetDefaults_Action );
break;
case ID_BACK:
UI_PopMenu();
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
}
@ -138,11 +218,15 @@ UI_SetupMenu_Init
===============
*/
static void UI_SetupMenu_Init( void ) {
int y,x;
int y, buttonCount;
y = 12;
buttonCount = 0;
UI_SetupMenu_Cache();
memset( &setupMenuInfo, 0, sizeof(setupMenuInfo) );
//Elder: added draw function
setupMenuInfo.menu.draw = Setup_MenuDraw;
setupMenuInfo.menu.wrapAround = qtrue;
setupMenuInfo.menu.fullscreen = qtrue;
setupMenuInfo.menu.showlogo = qtrue;//Blaze: Show Background logo
@ -171,6 +255,7 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.framer.width = 256;
setupMenuInfo.framer.height = 334;
*/
/*Elder: Removed
setupMenuInfo.multim.generic.type = MTYPE_PTEXT;
setupMenuInfo.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
setupMenuInfo.multim.generic.x = 120;
@ -211,9 +296,10 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.exitm.string = "EXIT";
setupMenuInfo.exitm.color = color_red;
setupMenuInfo.exitm.style = UI_CENTER | UI_DROPSHADOW;
y = 34;//Blaze: Changed from 134
x = 240;
*/
//y = 64;//Blaze: Changed from 134
//x = 64;
/* Elder Replaced by RQ3 Buttons
setupMenuInfo.setupplayer.generic.type = MTYPE_PTEXT;
setupMenuInfo.setupplayer.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.setupplayer.generic.x = x;
@ -234,8 +320,9 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.setupcontrols.string = "CONTROLS";
setupMenuInfo.setupcontrols.color = color_red;
setupMenuInfo.setupcontrols.style = UI_SMALLFONT;
y += SETUP_MENU_VERTICAL_SPACING;
*/
/*
//y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.setupsystem.generic.type = MTYPE_PTEXT;
setupMenuInfo.setupsystem.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.setupsystem.generic.x = x;
@ -246,7 +333,7 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.setupsystem.color = color_red;
setupMenuInfo.setupsystem.style = UI_SMALLFONT;
y += SETUP_MENU_VERTICAL_SPACING;
//y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.game.generic.type = MTYPE_PTEXT;
setupMenuInfo.game.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.game.generic.x = x;
@ -256,7 +343,8 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.game.string = "OPTIONS";
setupMenuInfo.game.color = color_red;
setupMenuInfo.game.style = UI_SMALLFONT;
*/
/*Elder: replaced by RQ3 buttons
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.cdkey.generic.type = MTYPE_PTEXT;
setupMenuInfo.cdkey.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
@ -304,39 +392,154 @@ static void UI_SetupMenu_Init( void ) {
setupMenuInfo.defaults.color = color_red;
setupMenuInfo.defaults.style = UI_SMALLFONT;
}
*/
//Elder: Info for setup icon
setupMenuInfo.rq3_setupicon.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupicon.generic.name = RQ3_SETUP_ICON;
setupMenuInfo.rq3_setupicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
setupMenuInfo.rq3_setupicon.generic.x = 0;
setupMenuInfo.rq3_setupicon.generic.y = 4;
setupMenuInfo.rq3_setupicon.width = RQ3_ICON_WIDTH;
setupMenuInfo.rq3_setupicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
setupMenuInfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
setupMenuInfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
setupMenuInfo.rq3_setuptitle.generic.x = 64;
setupMenuInfo.rq3_setuptitle.generic.y = 12;
setupMenuInfo.rq3_setuptitle.width = 256;
setupMenuInfo.rq3_setuptitle.height = 32;
//Elder: RQ3 Player Button
setupMenuInfo.rq3_setupplayer.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupplayer.generic.name = RQ3_SETUP_PLAYER;
setupMenuInfo.rq3_setupplayer.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupplayer.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupplayer.generic.y = y;
setupMenuInfo.rq3_setupplayer.generic.id = ID_CUSTOMIZEPLAYER;
setupMenuInfo.rq3_setupplayer.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupplayer.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupplayer.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupplayer.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Controls Button
setupMenuInfo.rq3_setupcontrols.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupcontrols.generic.name = RQ3_SETUP_CONTROLS;
setupMenuInfo.rq3_setupcontrols.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupcontrols.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupcontrols.generic.y = y;
setupMenuInfo.rq3_setupcontrols.generic.id = ID_CUSTOMIZECONTROLS;
setupMenuInfo.rq3_setupcontrols.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupcontrols.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupcontrols.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupcontrols.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 System Button
setupMenuInfo.rq3_setupsystem.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupsystem.generic.name = RQ3_SETUP_SYSTEM;
setupMenuInfo.rq3_setupsystem.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupsystem.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupsystem.generic.y = y;
setupMenuInfo.rq3_setupsystem.generic.id = ID_SYSTEMCONFIG;
setupMenuInfo.rq3_setupsystem.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupsystem.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupsystem.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupsystem.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Options Button
setupMenuInfo.rq3_setupoptions.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupoptions.generic.name = RQ3_SETUP_OPTIONS;
setupMenuInfo.rq3_setupoptions.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupoptions.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupoptions.generic.y = y;
setupMenuInfo.rq3_setupoptions.generic.id = ID_GAME;
setupMenuInfo.rq3_setupoptions.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupoptions.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupoptions.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupoptions.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 CDKEY Button
setupMenuInfo.rq3_setupcdkey.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupcdkey.generic.name = RQ3_SETUP_CDKEY;
setupMenuInfo.rq3_setupcdkey.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupcdkey.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupcdkey.generic.y = y;
setupMenuInfo.rq3_setupcdkey.generic.id = ID_CDKEY;
setupMenuInfo.rq3_setupcdkey.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupcdkey.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupcdkey.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupcdkey.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Defaults Button
setupMenuInfo.rq3_setupdefaults.generic.type = MTYPE_BITMAP;
setupMenuInfo.rq3_setupdefaults.generic.name = RQ3_SETUP_DEFAULTS;
setupMenuInfo.rq3_setupdefaults.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
setupMenuInfo.rq3_setupdefaults.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
setupMenuInfo.rq3_setupdefaults.generic.y = y;
setupMenuInfo.rq3_setupdefaults.generic.id = ID_DEFAULTS;
setupMenuInfo.rq3_setupdefaults.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.rq3_setupdefaults.width = RQ3_BUTTON_WIDTH;
setupMenuInfo.rq3_setupdefaults.height = RQ3_BUTTON_HEIGHT;
setupMenuInfo.rq3_setupdefaults.focuspic = RQ3_FOCUS_BUTTON;
//Back button
setupMenuInfo.back.generic.type = MTYPE_BITMAP;
setupMenuInfo.back.generic.name = ART_BACK0;
setupMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.back.generic.id = ID_BACK;
setupMenuInfo.back.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.back.generic.x = 0;
setupMenuInfo.back.generic.y = 480-64;
setupMenuInfo.back.width = 128;
setupMenuInfo.back.height = 64;
setupMenuInfo.back.generic.x = 8;
setupMenuInfo.back.generic.y = 480-44;
setupMenuInfo.back.width = 32;
setupMenuInfo.back.height = 32;
setupMenuInfo.back.focuspic = ART_BACK1;
//Elder: RQ3 Status Text
setupMenuInfo.rq3_statustext.generic.type = MTYPE_TEXT;
setupMenuInfo.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
setupMenuInfo.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
setupMenuInfo.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
setupMenuInfo.rq3_statustext.string = "";
setupMenuInfo.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
setupMenuInfo.rq3_statustext.color = color_orange;
//Blaze: Dont need this
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.banner );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.framel );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.framer );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.multim );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupm );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.demom );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.modsm );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.exitm );
//Elder: Or this
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.multim );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupm );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.demom );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.modsm );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.exitm );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupplayer );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupcontrols );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupsystem );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.game );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.cdkey );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupplayer );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupcontrols );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupsystem );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.game );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.cdkey );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.load );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.save );
if( !trap_Cvar_VariableValue( "cl_paused" ) ) {
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.defaults );
}
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.back );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupicon );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setuptitle );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupplayer );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupcontrols );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupsystem );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupoptions );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupcdkey );
if( !trap_Cvar_VariableValue( "cl_paused" ) ) {
//Elder: Changed
//Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.defaults );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_setupdefaults );
}
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.rq3_statustext );
}
@ -348,8 +551,20 @@ UI_SetupMenu_Cache
void UI_SetupMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: Removed
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
//Elder: Added
trap_R_RegisterShaderNoMip( RQ3_SETUP_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
trap_R_RegisterShaderNoMip( RQ3_SETUP_CDKEY );
trap_R_RegisterShaderNoMip( RQ3_SETUP_DEFAULTS );
trap_R_RegisterShaderNoMip( RQ3_SETUP_PLAYER );
trap_R_RegisterShaderNoMip( RQ3_SETUP_CONTROLS );
trap_R_RegisterShaderNoMip( RQ3_SETUP_SYSTEM );
trap_R_RegisterShaderNoMip( RQ3_SETUP_OPTIONS );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}

View file

@ -11,10 +11,11 @@ SOUND OPTIONS MENU
#include "ui_local.h"
#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"
//Elder: removed
//#define ART_FRAMEL "menu/art/frame2_l"
//#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ID_GRAPHICS 10
#define ID_DISPLAY 11
@ -26,6 +27,15 @@ SOUND OPTIONS MENU
//#define ID_A3D 17
#define ID_BACK 18
//Elder: RQ3 stuff
#define RQ3_SYSTEM_ICON "menu/art/rq3-setup-system.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
#define RQ3_GRAPHICS_BUTTON "menu/art/rq3-system-graphics.tga"
#define RQ3_DISPLAY_BUTTON "menu/art/rq3-system-display.tga"
#define RQ3_SOUND_BUTTON "menu/art/rq3-system-sound.tga"
#define RQ3_NETWORK_BUTTON "menu/art/rq3-system-network.tga"
static const char *quality_items[] = {
"Low", "High", 0
@ -37,16 +47,25 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: not needed anymore
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
//Elder: replaced by RQ3 buttons
// menutext_s graphics;
// menutext_s display;
// menutext_s sound;
// menutext_s network;
menutext_s graphics;
menutext_s display;
menutext_s sound;
menutext_s network;
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_systemicon;
menubitmap_s rq3_graphics;
menubitmap_s rq3_display;
menubitmap_s rq3_sound;
menubitmap_s rq3_network;
menutext_s rq3_statustext;
menuslider_s sfxvolume;
menuslider_s musicvolume;
@ -65,64 +84,117 @@ UI_SoundOptionsMenu_Event
=================
*/
static void UI_SoundOptionsMenu_Event( void* ptr, int event ) {
if( event != QM_ACTIVATED ) {
//Elder: for status bar
if( event == QM_LOSTFOCUS ) {
soundOptionsInfo.rq3_statustext.string = "";
return;
}
else if ( event == QM_GOTFOCUS ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
soundOptionsInfo.rq3_statustext.string = "Change graphics settings";
break;
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
soundOptionsInfo.rq3_statustext.string = "Change display settings";
break;
case ID_DISPLAY:
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
case ID_EFFECTSVOLUME:
trap_Cvar_SetValue( "s_volume", soundOptionsInfo.sfxvolume.curvalue / 10 );
break;
case ID_MUSICVOLUME:
trap_Cvar_SetValue( "s_musicvolume", soundOptionsInfo.musicvolume.curvalue / 10 );
break;
case ID_QUALITY:
if( soundOptionsInfo.quality.curvalue ) {
trap_Cvar_SetValue( "s_khz", 22 );
trap_Cvar_SetValue( "s_compression", 0 );
case ID_SOUND:
soundOptionsInfo.rq3_statustext.string = "Change sound settings";
break;
case ID_NETWORK:
soundOptionsInfo.rq3_statustext.string = "Change network settings";
break;
case ID_BACK:
soundOptionsInfo.rq3_statustext.string = "Return to setup menu";
break;
case ID_QUALITY:
//Q_strcat UI_Cvar_VariableString("s_khz")
//Get khz value and compression value
//Concatenate into one string with "Current settings: "
//output to rq3_statustext.string
//soundOptionsInfo.rq3_statustext.string =
break;
default:
soundOptionsInfo.rq3_statustext.string = "";
break;
}
else {
trap_Cvar_SetValue( "s_khz", 11 );
trap_Cvar_SetValue( "s_compression", 1 );
}
UI_ForceMenuOff();
trap_Cmd_ExecuteText( EXEC_APPEND, "snd_restart\n" );
break;
/*
case ID_A3D:
if( soundOptionsInfo.a3d.curvalue ) {
trap_Cmd_ExecuteText( EXEC_NOW, "s_enable_a3d\n" );
}
else {
trap_Cmd_ExecuteText( EXEC_NOW, "s_disable_a3d\n" );
}
soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );
break;
*/
case ID_BACK:
UI_PopMenu();
break;
}
else if ( event == QM_ACTIVATED ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
UI_PopMenu();
UI_GraphicsOptionsMenu();
break;
case ID_DISPLAY:
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
case ID_EFFECTSVOLUME:
trap_Cvar_SetValue( "s_volume", soundOptionsInfo.sfxvolume.curvalue / 10 );
break;
case ID_MUSICVOLUME:
trap_Cvar_SetValue( "s_musicvolume", soundOptionsInfo.musicvolume.curvalue / 10 );
break;
case ID_QUALITY:
if( soundOptionsInfo.quality.curvalue ) {
trap_Cvar_SetValue( "s_khz", 22 );
trap_Cvar_SetValue( "s_compression", 0 );
}
else {
trap_Cvar_SetValue( "s_khz", 11 );
trap_Cvar_SetValue( "s_compression", 1 );
}
UI_ForceMenuOff();
trap_Cmd_ExecuteText( EXEC_APPEND, "snd_restart\n" );
break;
/*
case ID_A3D:
if( soundOptionsInfo.a3d.curvalue ) {
trap_Cmd_ExecuteText( EXEC_NOW, "s_enable_a3d\n" );
}
else {
trap_Cmd_ExecuteText( EXEC_NOW, "s_disable_a3d\n" );
}
soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );
break;
*/
case ID_BACK:
UI_PopMenu();
break;
}
}
}
/*
===============
Added by Elder
UI_SoundOptionsMenu_Draw
===============
*/
static void UI_SoundOptionsMenu_Draw( void ) {
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
// standard menu drawing
Menu_Draw( &soundOptionsInfo.menu );
}
@ -132,11 +204,14 @@ UI_SoundOptionsMenu_Init
===============
*/
static void UI_SoundOptionsMenu_Init( void ) {
int y;
int y = 12;
int buttonCount = 0;
memset( &soundOptionsInfo, 0, sizeof(soundOptionsInfo) );
UI_SoundOptionsMenu_Cache();
//Elder: added draw function
soundOptionsInfo.menu.draw = UI_SoundOptionsMenu_Draw;
soundOptionsInfo.menu.wrapAround = qtrue;
soundOptionsInfo.menu.fullscreen = qtrue;
soundOptionsInfo.menu.showlogo = qtrue;
@ -165,6 +240,7 @@ static void UI_SoundOptionsMenu_Init( void ) {
soundOptionsInfo.framer.width = 256;
soundOptionsInfo.framer.height = 334;
*/
/* Elder: not needed anymore
soundOptionsInfo.multim.generic.type = MTYPE_PTEXT;
soundOptionsInfo.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
soundOptionsInfo.multim.generic.x = 120;
@ -204,7 +280,84 @@ static void UI_SoundOptionsMenu_Init( void ) {
soundOptionsInfo.exitm.string = "EXIT";
soundOptionsInfo.exitm.color = color_red;
soundOptionsInfo.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
soundOptionsInfo.rq3_systemicon.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_systemicon.generic.name = RQ3_SYSTEM_ICON;
soundOptionsInfo.rq3_systemicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
soundOptionsInfo.rq3_systemicon.generic.x = 0;
soundOptionsInfo.rq3_systemicon.generic.y = 4;
soundOptionsInfo.rq3_systemicon.width = RQ3_ICON_WIDTH;
soundOptionsInfo.rq3_systemicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
soundOptionsInfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
soundOptionsInfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
soundOptionsInfo.rq3_setuptitle.generic.x = 64;
soundOptionsInfo.rq3_setuptitle.generic.y = 12;
soundOptionsInfo.rq3_setuptitle.width = 256;
soundOptionsInfo.rq3_setuptitle.height = 32;
//Elder: RQ3 Graphics Button
soundOptionsInfo.rq3_graphics.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_graphics.generic.name = RQ3_GRAPHICS_BUTTON;
soundOptionsInfo.rq3_graphics.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
soundOptionsInfo.rq3_graphics.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
soundOptionsInfo.rq3_graphics.generic.y = y;
soundOptionsInfo.rq3_graphics.generic.id = ID_GRAPHICS;
soundOptionsInfo.rq3_graphics.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.rq3_graphics.width = RQ3_BUTTON_WIDTH;
soundOptionsInfo.rq3_graphics.height = RQ3_BUTTON_HEIGHT;
soundOptionsInfo.rq3_graphics.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Display Button
soundOptionsInfo.rq3_display.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_display.generic.name = RQ3_DISPLAY_BUTTON;
soundOptionsInfo.rq3_display.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
soundOptionsInfo.rq3_display.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
soundOptionsInfo.rq3_display.generic.y = y;
soundOptionsInfo.rq3_display.generic.id = ID_DISPLAY;
soundOptionsInfo.rq3_display.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.rq3_display.width = RQ3_BUTTON_WIDTH;
soundOptionsInfo.rq3_display.height = RQ3_BUTTON_HEIGHT;
soundOptionsInfo.rq3_display.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Sound Button
soundOptionsInfo.rq3_sound.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_sound.generic.name = RQ3_SOUND_BUTTON;
soundOptionsInfo.rq3_sound.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
soundOptionsInfo.rq3_sound.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
soundOptionsInfo.rq3_sound.generic.y = y;
soundOptionsInfo.rq3_sound.generic.id = ID_SOUND;
soundOptionsInfo.rq3_sound.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.rq3_sound.width = RQ3_BUTTON_WIDTH;
soundOptionsInfo.rq3_sound.height = RQ3_BUTTON_HEIGHT;
soundOptionsInfo.rq3_sound.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Network Button
soundOptionsInfo.rq3_network.generic.type = MTYPE_BITMAP;
soundOptionsInfo.rq3_network.generic.name = RQ3_NETWORK_BUTTON;
soundOptionsInfo.rq3_network.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
soundOptionsInfo.rq3_network.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
soundOptionsInfo.rq3_network.generic.y = y;
soundOptionsInfo.rq3_network.generic.id = ID_NETWORK;
soundOptionsInfo.rq3_network.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.rq3_network.width = RQ3_BUTTON_WIDTH;
soundOptionsInfo.rq3_network.height = RQ3_BUTTON_HEIGHT;
soundOptionsInfo.rq3_network.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Status Text
soundOptionsInfo.rq3_statustext.generic.type = MTYPE_TEXT;
soundOptionsInfo.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
soundOptionsInfo.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
soundOptionsInfo.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
soundOptionsInfo.rq3_statustext.string = "";
soundOptionsInfo.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
soundOptionsInfo.rq3_statustext.color = color_orange;
/* Elder: replaced by RQ3 buttons
soundOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
soundOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
soundOptionsInfo.graphics.generic.id = ID_GRAPHICS;
@ -244,37 +397,38 @@ static void UI_SoundOptionsMenu_Init( void ) {
soundOptionsInfo.network.string = "NETWORK";
soundOptionsInfo.network.style = UI_RIGHT;
soundOptionsInfo.network.color = color_red;
*/
y = 240 - 1.5 * (BIGCHAR_HEIGHT + 2);
// y = 240 - 1.5 * (BIGCHAR_HEIGHT + 2);
soundOptionsInfo.sfxvolume.generic.type = MTYPE_SLIDER;
soundOptionsInfo.sfxvolume.generic.name = "Effects Volume:";
soundOptionsInfo.sfxvolume.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.sfxvolume.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.sfxvolume.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.sfxvolume.generic.id = ID_EFFECTSVOLUME;
soundOptionsInfo.sfxvolume.generic.x = 400;
soundOptionsInfo.sfxvolume.generic.y = y;
soundOptionsInfo.sfxvolume.generic.x = 200;
soundOptionsInfo.sfxvolume.generic.y = 64;
soundOptionsInfo.sfxvolume.minvalue = 0;
soundOptionsInfo.sfxvolume.maxvalue = 10;
y += BIGCHAR_HEIGHT+2;
// y += BIGCHAR_HEIGHT+2;
soundOptionsInfo.musicvolume.generic.type = MTYPE_SLIDER;
soundOptionsInfo.musicvolume.generic.name = "Music Volume:";
soundOptionsInfo.musicvolume.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.musicvolume.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.musicvolume.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.musicvolume.generic.id = ID_MUSICVOLUME;
soundOptionsInfo.musicvolume.generic.x = 400;
soundOptionsInfo.musicvolume.generic.y = y;
soundOptionsInfo.musicvolume.generic.x = 200;
soundOptionsInfo.musicvolume.generic.y = 64 + BIGCHAR_HEIGHT + 2;
soundOptionsInfo.musicvolume.minvalue = 0;
soundOptionsInfo.musicvolume.maxvalue = 10;
y += BIGCHAR_HEIGHT+2;
// y += BIGCHAR_HEIGHT+2;
soundOptionsInfo.quality.generic.type = MTYPE_SPINCONTROL;
soundOptionsInfo.quality.generic.name = "Sound Quality:";
soundOptionsInfo.quality.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.quality.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
soundOptionsInfo.quality.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.quality.generic.id = ID_QUALITY;
soundOptionsInfo.quality.generic.x = 400;
soundOptionsInfo.quality.generic.y = y;
soundOptionsInfo.quality.generic.x = 200;
soundOptionsInfo.quality.generic.y = 64 + (BIGCHAR_HEIGHT + 2) * 2;
soundOptionsInfo.quality.itemnames = quality_items;
/*
y += BIGCHAR_HEIGHT+2;
@ -291,25 +445,34 @@ static void UI_SoundOptionsMenu_Init( void ) {
soundOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
soundOptionsInfo.back.generic.callback = UI_SoundOptionsMenu_Event;
soundOptionsInfo.back.generic.id = ID_BACK;
soundOptionsInfo.back.generic.x = 0;
soundOptionsInfo.back.generic.y = 480-64;
soundOptionsInfo.back.width = 128;
soundOptionsInfo.back.height = 64;
soundOptionsInfo.back.generic.x = 8;
soundOptionsInfo.back.generic.y = 480-44;
soundOptionsInfo.back.width = 32;
soundOptionsInfo.back.height = 32;
soundOptionsInfo.back.focuspic = ART_BACK1;
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.banner );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.framel );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.framer );
Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.multim );
Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.setupm );
Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.demom );
Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.modsm );
Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.exitm );
//Elder: not needed anymore
// Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.multim );
// Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.setupm );
// Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.demom );
// Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.modsm );
// Menu_AddItem( &soundOptionsInfo.menu, &soundOptionsInfo.exitm );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.graphics );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.display );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.sound );
// Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.network );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.graphics );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.display );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.sound );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.network );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_systemicon );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_setuptitle );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_graphics );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_display );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_sound );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_network );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.rq3_statustext );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.sfxvolume );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.musicvolume );
Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.quality );
@ -329,13 +492,20 @@ UI_SoundOptionsMenu_Cache
===============
*/
void UI_SoundOptionsMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
//trap_R_RegisterShaderNoMip( ART_FRAMEL );
//trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
//Elder: added
trap_R_RegisterShaderNoMip( RQ3_SYSTEM_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
trap_R_RegisterShaderNoMip( RQ3_GRAPHICS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DISPLAY_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SOUND_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_NETWORK_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
/*
===============
UI_SoundOptionsMenu
@ -344,5 +514,6 @@ UI_SoundOptionsMenu
void UI_SoundOptionsMenu( void ) {
UI_SoundOptionsMenu_Init();
UI_PushMenu( &soundOptionsInfo.menu );
Menu_SetCursorToItem( &soundOptionsInfo.menu, &soundOptionsInfo.sound );
//Elder: shifted to .rq3_sound instead of .sound
Menu_SetCursorToItem( &soundOptionsInfo.menu, &soundOptionsInfo.rq3_sound );
}

View file

@ -12,16 +12,22 @@ DRIVER INFORMATION MENU
=======================================================================
*/
//Elder: remove
//#define DRIVERINFO_FRAMEL "menu/art/frame2_l"
//#define DRIVERINFO_FRAMER "menu/art/frame1_r"
#define DRIVERINFO_BACK0 "menu/art/rq3-menu-back.tga"
#define DRIVERINFO_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define RQ3_SYSTEM_ICON "menu/art/rq3-setup-system.jpg"
#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define DRIVERINFO_FRAMEL "menu/art/frame2_l"
#define DRIVERINFO_FRAMER "menu/art/frame1_r"
#define DRIVERINFO_BACK0 "menu/art/back_0"
#define DRIVERINFO_BACK1 "menu/art/back_1"
static char* driverinfo_artlist[] =
{
DRIVERINFO_FRAMEL,
DRIVERINFO_FRAMER,
//Elder: removed
// DRIVERINFO_FRAMEL,
// DRIVERINFO_FRAMER,
RQ3_SYSTEM_ICON,
RQ3_SETUP_TITLE,
DRIVERINFO_BACK0,
DRIVERINFO_BACK1,
NULL,
@ -33,12 +39,17 @@ typedef struct
{
menuframework_s menu;
// menutext_s banner;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: removed
// menutext_s multim;
// menutext_s setupm;
// menutext_s demom;
// menutext_s modsm;
// menutext_s exitm;
//Elder: RQ3 stuff
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_systemicon;
menubitmap_s back;
// menubitmap_s framel;
// menubitmap_s framer;
@ -75,20 +86,38 @@ DriverInfo_MenuDraw
static void DriverInfo_MenuDraw( void )
{
int i;
int y;
int x, y;
//Elder: added
char sVendor[256];
Menu_Draw( &s_driverinfo.menu );
//Elder: "Dim" mask
UI_FillRect( 0, 0, 640, 480, color_deepdim );
UI_DrawString( 100, 64, "VENDOR", UI_RIGHT|UI_SMALLFONT, color_red );
UI_DrawString( 100, 96, "PIXELFORMAT", UI_RIGHT|UI_SMALLFONT, color_red );
UI_DrawString( 100, 112, "EXTENSIONS", UI_RIGHT|UI_SMALLFONT, color_red );
UI_DrawString( 320, 80, "VENDOR", UI_CENTER|UI_SMALLFONT, color_red );
UI_DrawString( 320, 152, "PIXELFORMAT", UI_CENTER|UI_SMALLFONT, color_red );
UI_DrawString( 320, 192, "EXTENSIONS", UI_CENTER|UI_SMALLFONT, color_red );
//Elder: consolidated into one string - bad coding? :(
Q_strncpyz(sVendor, uis.glconfig.vendor_string, sizeof(sVendor));
Q_strcat(sVendor, sizeof(sVendor), " (");
Q_strcat(sVendor, sizeof(sVendor), uis.glconfig.version_string);
Q_strcat(sVendor, sizeof(sVendor), ")");
UI_DrawString( 320, 80+16, uis.glconfig.vendor_string, UI_CENTER|UI_SMALLFONT, text_color_normal );
UI_DrawString( 320, 96+16, uis.glconfig.version_string, UI_CENTER|UI_SMALLFONT, text_color_normal );
UI_DrawString( 320, 112+16, uis.glconfig.renderer_string, UI_CENTER|UI_SMALLFONT, text_color_normal );
UI_DrawString( 320, 152+16, va ("color(%d-bits) Z(%d-bits) stencil(%d-bits)", uis.glconfig.colorBits, uis.glconfig.depthBits, uis.glconfig.stencilBits), UI_CENTER|UI_SMALLFONT, text_color_normal );
UI_DrawString( 110, 64, sVendor, UI_LEFT|UI_SMALLFONT, text_color_normal );
//Elder: removed
//UI_DrawString( 110, 64, uis.glconfig.vendor_string, UI_LEFT|UI_SMALLFONT, text_color_normal );
//UI_DrawString( 110, 80, uis.glconfig.version_string, UI_LEFT|UI_SMALLFONT, text_color_normal );
UI_DrawString( 110, 80, uis.glconfig.renderer_string, UI_LEFT|UI_SMALLFONT, text_color_normal );
UI_DrawString( 110, 96, va ("color(%d-bits) Z(%d-bits) stencil(%d-bits)", uis.glconfig.colorBits, uis.glconfig.depthBits, uis.glconfig.stencilBits), UI_LEFT|UI_SMALLFONT, text_color_normal );
// double column
x = 110;
y = 112;
//Elder: strings[0] has some weird shit in it after going through the players menu so don't print it
//I don't know why baseq3 doesn't have this problem, but just that it's the cause of a mucky
//GL extension string formation
/* Old code:
y = 192+16;
for (i=0; i<s_driverinfo.numstrings/2; i++) {
UI_DrawString( 320-4, y, s_driverinfo.strings[i*2], UI_RIGHT|UI_SMALLFONT, text_color_normal );
@ -98,6 +127,39 @@ static void DriverInfo_MenuDraw( void )
if (s_driverinfo.numstrings & 1)
UI_DrawString( 320, y, s_driverinfo.strings[s_driverinfo.numstrings-1], UI_CENTER|UI_SMALLFONT, text_color_normal );
*/
//Elder: new GL extension drawing code
for (i=1; i<s_driverinfo.numstrings; i++) {
UI_DrawString( x, y, s_driverinfo.strings[i], UI_LEFT|UI_SMALLFONT, text_color_normal );
y += SMALLCHAR_HEIGHT;
//one line before letterbox
if ( y > (426 - SMALLCHAR_HEIGHT * 2) ) {
//end of the line
if (x == 370) {
break;
}
//switch columns and reset y
else {
y = 112;
x = 370;
}
}
}
//Indicates number of extensions not shown
if (i < s_driverinfo.numstrings) {
UI_DrawString( 320, y, va ("Extensions not listed: %i", s_driverinfo.numstrings - i - 1), UI_CENTER|UI_SMALLFONT|UI_PULSE, color_yellow );
}
//Elder: "Letterbox" mask
UI_FillRect( 0, 0, 640, 54, color_black);
UI_FillRect( 0, 426, 640, 54, color_black);
//Elder: moved outside the mask scope
Menu_Draw( &s_driverinfo.menu );
}
/*
@ -107,6 +169,7 @@ DriverInfo_Cache
*/
void DriverInfo_Cache( void )
{
int i;
// touch all our pics
@ -116,6 +179,8 @@ void DriverInfo_Cache( void )
break;
trap_R_RegisterShaderNoMip(driverinfo_artlist[i]);
}
}
/*
@ -161,6 +226,7 @@ static void UI_DriverInfo_Menu( void )
s_driverinfo.framer.width = 256;
s_driverinfo.framer.height = 334;
*/
/* Elder: removed
s_driverinfo.multim.generic.type = MTYPE_PTEXT;
s_driverinfo.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_driverinfo.multim.generic.x = 120;
@ -201,16 +267,35 @@ static void UI_DriverInfo_Menu( void )
s_driverinfo.exitm.string = "EXIT";
s_driverinfo.exitm.color = color_red;
s_driverinfo.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
s_driverinfo.rq3_systemicon.generic.type = MTYPE_BITMAP;
s_driverinfo.rq3_systemicon.generic.name = RQ3_SYSTEM_ICON;
s_driverinfo.rq3_systemicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_driverinfo.rq3_systemicon.generic.x = 0;
s_driverinfo.rq3_systemicon.generic.y = 4;
s_driverinfo.rq3_systemicon.width = RQ3_ICON_WIDTH;
s_driverinfo.rq3_systemicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
s_driverinfo.rq3_setuptitle.generic.type = MTYPE_BITMAP;
s_driverinfo.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
s_driverinfo.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_driverinfo.rq3_setuptitle.generic.x = 64;
s_driverinfo.rq3_setuptitle.generic.y = 12;
s_driverinfo.rq3_setuptitle.width = 256;
s_driverinfo.rq3_setuptitle.height = 32;
s_driverinfo.back.generic.type = MTYPE_BITMAP;
s_driverinfo.back.generic.name = DRIVERINFO_BACK0;
s_driverinfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_driverinfo.back.generic.callback = DriverInfo_Event;
s_driverinfo.back.generic.id = ID_DRIVERINFOBACK;
s_driverinfo.back.generic.x = 0;
s_driverinfo.back.generic.y = 480-64;
s_driverinfo.back.width = 128;
s_driverinfo.back.height = 64;
s_driverinfo.back.generic.x = 8;
s_driverinfo.back.generic.y = 480-44;
s_driverinfo.back.width = 32;
s_driverinfo.back.height = 32;
s_driverinfo.back.focuspic = DRIVERINFO_BACK1;
strcpy( s_driverinfo.stringbuff, uis.glconfig.extensions_string );
@ -242,12 +327,15 @@ static void UI_DriverInfo_Menu( void )
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.banner );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.framel );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.framer );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.multim );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.setupm );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.demom );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.modsm );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.exitm );
//Elder: removed
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.multim );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.setupm );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.demom );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.modsm );
// Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.exitm );
Menu_AddItem( &s_driverinfo.menu, ( void * ) &s_driverinfo.rq3_systemicon );
Menu_AddItem( &s_driverinfo.menu, ( void * ) &s_driverinfo.rq3_setuptitle );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.back );
UI_PushMenu( &s_driverinfo.menu );
@ -261,12 +349,12 @@ GRAPHICS OPTIONS MENU
=======================================================================
*/
#define GRAPHICSOPTIONS_FRAMEL "menu/art/frame2_l"
#define GRAPHICSOPTIONS_FRAMER "menu/art/frame1_r"
#define GRAPHICSOPTIONS_BACK0 "menu/art/back_0"
#define GRAPHICSOPTIONS_BACK1 "menu/art/back_1"
#define GRAPHICSOPTIONS_ACCEPT0 "menu/art/accept_0"
#define GRAPHICSOPTIONS_ACCEPT1 "menu/art/accept_1"
//#define GRAPHICSOPTIONS_FRAMEL "menu/art/frame2_l"
//#define GRAPHICSOPTIONS_FRAMER "menu/art/frame1_r"
#define GRAPHICSOPTIONS_BACK0 "menu/art/rq3-menu-back.tga"
#define GRAPHICSOPTIONS_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define GRAPHICSOPTIONS_ACCEPT0 "menu/art/rq3-menu-go.tga"
#define GRAPHICSOPTIONS_ACCEPT1 "menu/art/rq3-menu-go-focus.tga"
static const char *s_drivers[] =
{
@ -285,6 +373,16 @@ static const char *s_drivers[] =
#define ID_SOUND 108
#define ID_NETWORK 109
//Elder: RQ3 stuff - first two defined at top of file
//#define RQ3_SYSTEM_ICON "menu/art/rq3-setup-system.jpg"
//#define RQ3_SETUP_TITLE "menu/art/rq3-title-setup.tga"
#define RQ3_FOCUS_BUTTON "menu/art/rq3-menu-focus.tga"
#define RQ3_GRAPHICS_BUTTON "menu/art/rq3-system-graphics.tga"
#define RQ3_DISPLAY_BUTTON "menu/art/rq3-system-display.tga"
#define RQ3_SOUND_BUTTON "menu/art/rq3-system-sound.tga"
#define RQ3_NETWORK_BUTTON "menu/art/rq3-system-network.tga"
#define RQ3_DRIVERINFO_BUTTON "menu/art/rq3-system-driverinfo.jpg"
typedef struct {
menuframework_s menu;
@ -292,16 +390,27 @@ typedef struct {
// menutext_s banner;
// menubitmap_s framel;
// menubitmap_s framer;
menutext_s multim;
menutext_s setupm;
menutext_s demom;
menutext_s modsm;
menutext_s exitm;
//Elder: removed
// 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;
// menutext_s graphics;
// menutext_s display;
// menutext_s sound;
// menutext_s network;
//Elder: RQ3 stuff
menubitmap_s rq3_setuptitle;
menubitmap_s rq3_systemicon;
menubitmap_s rq3_graphics;
menubitmap_s rq3_display;
menubitmap_s rq3_sound;
menubitmap_s rq3_network;
menubitmap_s rq3_driverinfo;
menutext_s rq3_statustext;
menulist_s list;
menulist_s mode;
@ -314,7 +423,8 @@ typedef struct {
menulist_s colordepth;
menulist_s geometry;
menulist_s filter;
menutext_s driverinfo;
//Elder: removed
//menutext_s driverinfo;
menubitmap_s apply;
menubitmap_s back;
@ -501,71 +611,79 @@ GraphicsOptions_ApplyChanges
*/
static void GraphicsOptions_ApplyChanges( void *unused, int notification )
{
if (notification != QM_ACTIVATED)
//Elder: some quick modifications
if (notification == QM_GOTFOCUS) {
s_graphicsoptions.rq3_statustext.string = "Apply changes";
return;
switch ( s_graphicsoptions.texturebits.curvalue )
{
case 0:
trap_Cvar_SetValue( "r_texturebits", 0 );
break;
case 1:
trap_Cvar_SetValue( "r_texturebits", 16 );
break;
case 2:
trap_Cvar_SetValue( "r_texturebits", 32 );
break;
}
trap_Cvar_SetValue( "r_picmip", 3 - s_graphicsoptions.tq.curvalue );
trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
trap_Cvar_Set( "r_glDriver", ( char * ) s_drivers[s_graphicsoptions.driver.curvalue] );
switch ( s_graphicsoptions.colordepth.curvalue )
{
case 0:
trap_Cvar_SetValue( "r_colorbits", 0 );
trap_Cvar_SetValue( "r_depthbits", 0 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 1:
trap_Cvar_SetValue( "r_colorbits", 16 );
trap_Cvar_SetValue( "r_depthbits", 16 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 2:
trap_Cvar_SetValue( "r_colorbits", 32 );
trap_Cvar_SetValue( "r_depthbits", 24 );
break;
else if (notification == QM_LOSTFOCUS) {
s_graphicsoptions.rq3_statustext.string = "";
return;
}
trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );
if ( s_graphicsoptions.geometry.curvalue == 2 )
{
trap_Cvar_SetValue( "r_lodBias", 0 );
trap_Cvar_SetValue( "r_subdivisions", 4 );
}
else if ( s_graphicsoptions.geometry.curvalue == 1 )
{
trap_Cvar_SetValue( "r_lodBias", 1 );
trap_Cvar_SetValue( "r_subdivisions", 12 );
}
else
{
trap_Cvar_SetValue( "r_lodBias", 1 );
trap_Cvar_SetValue( "r_subdivisions", 20 );
}
if ( s_graphicsoptions.filter.curvalue )
{
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
}
else
{
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
}
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
else if (notification == QM_ACTIVATED) {
switch ( s_graphicsoptions.texturebits.curvalue )
{
case 0:
trap_Cvar_SetValue( "r_texturebits", 0 );
break;
case 1:
trap_Cvar_SetValue( "r_texturebits", 16 );
break;
case 2:
trap_Cvar_SetValue( "r_texturebits", 32 );
break;
}
trap_Cvar_SetValue( "r_picmip", 3 - s_graphicsoptions.tq.curvalue );
trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
trap_Cvar_Set( "r_glDriver", ( char * ) s_drivers[s_graphicsoptions.driver.curvalue] );
switch ( s_graphicsoptions.colordepth.curvalue )
{
case 0:
trap_Cvar_SetValue( "r_colorbits", 0 );
trap_Cvar_SetValue( "r_depthbits", 0 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 1:
trap_Cvar_SetValue( "r_colorbits", 16 );
trap_Cvar_SetValue( "r_depthbits", 16 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 2:
trap_Cvar_SetValue( "r_colorbits", 32 );
trap_Cvar_SetValue( "r_depthbits", 24 );
break;
}
trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );
if ( s_graphicsoptions.geometry.curvalue == 2 )
{
trap_Cvar_SetValue( "r_lodBias", 0 );
trap_Cvar_SetValue( "r_subdivisions", 4 );
}
else if ( s_graphicsoptions.geometry.curvalue == 1 )
{
trap_Cvar_SetValue( "r_lodBias", 1 );
trap_Cvar_SetValue( "r_subdivisions", 12 );
}
else
{
trap_Cvar_SetValue( "r_lodBias", 1 );
trap_Cvar_SetValue( "r_subdivisions", 20 );
}
if ( s_graphicsoptions.filter.curvalue )
{
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
}
else
{
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
}
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
}
}
/*
@ -576,60 +694,99 @@ GraphicsOptions_Event
static void GraphicsOptions_Event( void* ptr, int event ) {
InitialVideoOptions_s *ivo;
if( event != QM_ACTIVATED ) {
return;
//Elder: for status bar
if( event == QM_LOSTFOCUS ) {
s_graphicsoptions.rq3_statustext.string = "";
return;
}
else if ( event == QM_GOTFOCUS ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_GRAPHICS:
s_graphicsoptions.rq3_statustext.string = "Change graphics settings";
break;
switch( ((menucommon_s*)ptr)->id ) {
case ID_MODE:
// clamp 3dfx video modes
if ( s_graphicsoptions.driver.curvalue == 1 )
{
if ( s_graphicsoptions.mode.curvalue < 2 )
s_graphicsoptions.mode.curvalue = 2;
else if ( s_graphicsoptions.mode.curvalue > 6 )
s_graphicsoptions.mode.curvalue = 6;
case ID_DISPLAY:
s_graphicsoptions.rq3_statustext.string = "Change display settings";
break;
case ID_SOUND:
s_graphicsoptions.rq3_statustext.string = "Change sound settings";
break;
case ID_NETWORK:
s_graphicsoptions.rq3_statustext.string = "Change network settings";
break;
case ID_BACK2:
s_graphicsoptions.rq3_statustext.string = "Return to setup menu";
break;
case ID_MODE:
s_graphicsoptions.rq3_statustext.string = "Change video resolution";
break;
case ID_DRIVERINFO:
s_graphicsoptions.rq3_statustext.string = "View driver info and GL extensions";
break;
default:
s_graphicsoptions.rq3_statustext.string = "";
break;
}
break;
case ID_LIST:
ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
s_graphicsoptions.mode.curvalue = ivo->mode;
s_graphicsoptions.tq.curvalue = ivo->tq;
s_graphicsoptions.lighting.curvalue = ivo->lighting;
s_graphicsoptions.colordepth.curvalue = ivo->colordepth;
s_graphicsoptions.texturebits.curvalue = ivo->texturebits;
s_graphicsoptions.geometry.curvalue = ivo->geometry;
s_graphicsoptions.filter.curvalue = ivo->filter;
s_graphicsoptions.fs.curvalue = ivo->fullscreen;
break;
case ID_DRIVERINFO:
UI_DriverInfo_Menu();
break;
case ID_BACK2:
UI_PopMenu();
break;
case ID_GRAPHICS:
break;
case ID_DISPLAY:
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
}
else if ( event == QM_ACTIVATED ) {
switch( ((menucommon_s*)ptr)->id ) {
case ID_MODE:
// clamp 3dfx video modes
if ( s_graphicsoptions.driver.curvalue == 1 )
{
if ( s_graphicsoptions.mode.curvalue < 2 )
s_graphicsoptions.mode.curvalue = 2;
else if ( s_graphicsoptions.mode.curvalue > 6 )
s_graphicsoptions.mode.curvalue = 6;
}
break;
case ID_LIST:
ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
s_graphicsoptions.mode.curvalue = ivo->mode;
s_graphicsoptions.tq.curvalue = ivo->tq;
s_graphicsoptions.lighting.curvalue = ivo->lighting;
s_graphicsoptions.colordepth.curvalue = ivo->colordepth;
s_graphicsoptions.texturebits.curvalue = ivo->texturebits;
s_graphicsoptions.geometry.curvalue = ivo->geometry;
s_graphicsoptions.filter.curvalue = ivo->filter;
s_graphicsoptions.fs.curvalue = ivo->fullscreen;
break;
case ID_DRIVERINFO:
UI_DriverInfo_Menu();
break;
case ID_BACK2:
UI_PopMenu();
break;
case ID_GRAPHICS:
break;
case ID_DISPLAY:
UI_PopMenu();
UI_DisplayOptionsMenu();
break;
case ID_SOUND:
UI_PopMenu();
UI_SoundOptionsMenu();
break;
case ID_NETWORK:
UI_PopMenu();
UI_NetworkOptionsMenu();
break;
}
}
}
@ -657,6 +814,11 @@ void GraphicsOptions_MenuDraw (void)
//APSFIX - rework this
GraphicsOptions_UpdateMenuItems();
//Elder: "Dim" and "Letterbox" mask
UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_deepdim );
UI_FillRect( 0, 0, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
Menu_Draw( &s_graphicsoptions.menu );
}
@ -831,17 +993,18 @@ void GraphicsOptions_MenuInit( void )
0
};
int y;
int y = 12;
int buttonCount = 0;
// zero set all our globals
memset( &s_graphicsoptions, 0 ,sizeof(graphicsoptions_t) );
GraphicsOptions_Cache();
s_graphicsoptions.menu.draw = GraphicsOptions_MenuDraw;
s_graphicsoptions.menu.wrapAround = qtrue;
s_graphicsoptions.menu.fullscreen = qtrue;
s_graphicsoptions.menu.showlogo = qtrue;
s_graphicsoptions.menu.draw = GraphicsOptions_MenuDraw;
/* s_graphicsoptions.banner.generic.type = MTYPE_BTEXT;
s_graphicsoptions.banner.generic.x = 320;
@ -866,6 +1029,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.framer.width = 256;
s_graphicsoptions.framer.height = 334;
*/
/* Elder: removed
s_graphicsoptions.multim.generic.type = MTYPE_PTEXT;
s_graphicsoptions.multim.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
s_graphicsoptions.multim.generic.x = 120;
@ -905,7 +1069,84 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.exitm.string = "EXIT";
s_graphicsoptions.exitm.color = color_red;
s_graphicsoptions.exitm.style = UI_CENTER | UI_DROPSHADOW;
*/
//Elder: Info for system icon
s_graphicsoptions.rq3_systemicon.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_systemicon.generic.name = RQ3_SYSTEM_ICON;
s_graphicsoptions.rq3_systemicon.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_graphicsoptions.rq3_systemicon.generic.x = 0;
s_graphicsoptions.rq3_systemicon.generic.y = 4;
s_graphicsoptions.rq3_systemicon.width = RQ3_ICON_WIDTH;
s_graphicsoptions.rq3_systemicon.height = RQ3_ICON_HEIGHT;
//Elder: Info for setup title
s_graphicsoptions.rq3_setuptitle.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_setuptitle.generic.name = RQ3_SETUP_TITLE;
s_graphicsoptions.rq3_setuptitle.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
s_graphicsoptions.rq3_setuptitle.generic.x = 64;
s_graphicsoptions.rq3_setuptitle.generic.y = 12;
s_graphicsoptions.rq3_setuptitle.width = 256;
s_graphicsoptions.rq3_setuptitle.height = 32;
//Elder: RQ3 Graphics Button
s_graphicsoptions.rq3_graphics.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_graphics.generic.name = RQ3_GRAPHICS_BUTTON;
s_graphicsoptions.rq3_graphics.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_graphicsoptions.rq3_graphics.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_graphicsoptions.rq3_graphics.generic.y = y;
s_graphicsoptions.rq3_graphics.generic.id = ID_GRAPHICS;
s_graphicsoptions.rq3_graphics.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.rq3_graphics.width = RQ3_BUTTON_WIDTH;
s_graphicsoptions.rq3_graphics.height = RQ3_BUTTON_HEIGHT;
s_graphicsoptions.rq3_graphics.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Display Button
s_graphicsoptions.rq3_display.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_display.generic.name = RQ3_DISPLAY_BUTTON;
s_graphicsoptions.rq3_display.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_graphicsoptions.rq3_display.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_graphicsoptions.rq3_display.generic.y = y;
s_graphicsoptions.rq3_display.generic.id = ID_DISPLAY;
s_graphicsoptions.rq3_display.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.rq3_display.width = RQ3_BUTTON_WIDTH;
s_graphicsoptions.rq3_display.height = RQ3_BUTTON_HEIGHT;
s_graphicsoptions.rq3_display.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Sound Button
s_graphicsoptions.rq3_sound.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_sound.generic.name = RQ3_SOUND_BUTTON;
s_graphicsoptions.rq3_sound.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_graphicsoptions.rq3_sound.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_graphicsoptions.rq3_sound.generic.y = y;
s_graphicsoptions.rq3_sound.generic.id = ID_SOUND;
s_graphicsoptions.rq3_sound.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.rq3_sound.width = RQ3_BUTTON_WIDTH;
s_graphicsoptions.rq3_sound.height = RQ3_BUTTON_HEIGHT;
s_graphicsoptions.rq3_sound.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Network Button
s_graphicsoptions.rq3_network.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_network.generic.name = RQ3_NETWORK_BUTTON;
s_graphicsoptions.rq3_network.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_graphicsoptions.rq3_network.generic.x = 320 + (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_graphicsoptions.rq3_network.generic.y = y;
s_graphicsoptions.rq3_network.generic.id = ID_NETWORK;
s_graphicsoptions.rq3_network.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.rq3_network.width = RQ3_BUTTON_WIDTH;
s_graphicsoptions.rq3_network.height = RQ3_BUTTON_HEIGHT;
s_graphicsoptions.rq3_network.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Status Text
s_graphicsoptions.rq3_statustext.generic.type = MTYPE_TEXT;
s_graphicsoptions.rq3_statustext.generic.flags = QMF_CENTER_JUSTIFY;
s_graphicsoptions.rq3_statustext.generic.x = RQ3_STATUSBAR_X;
s_graphicsoptions.rq3_statustext.generic.y = RQ3_STATUSBAR_Y;
s_graphicsoptions.rq3_statustext.string = "";
s_graphicsoptions.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
s_graphicsoptions.rq3_statustext.color = color_orange;
/* Elder: removed for RQ3 stuff
s_graphicsoptions.graphics.generic.type = MTYPE_PTEXT;
s_graphicsoptions.graphics.generic.flags = QMF_RIGHT_JUSTIFY;
s_graphicsoptions.graphics.generic.id = ID_GRAPHICS;
@ -945,12 +1186,13 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.network.string = "NETWORK";
s_graphicsoptions.network.style = UI_RIGHT;
s_graphicsoptions.network.color = color_red;
y = 240 - 6 * (BIGCHAR_HEIGHT + 2);
*/
y = 64;
s_graphicsoptions.list.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.list.generic.name = "Graphics Settings:";
s_graphicsoptions.list.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.list.generic.x = 400;
s_graphicsoptions.list.generic.x = 200;
s_graphicsoptions.list.generic.y = y;
s_graphicsoptions.list.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.list.generic.id = ID_LIST;
@ -960,7 +1202,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.driver.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.driver.generic.name = "GL Driver:";
s_graphicsoptions.driver.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.driver.generic.x = 400;
s_graphicsoptions.driver.generic.x = 200;
s_graphicsoptions.driver.generic.y = y;
s_graphicsoptions.driver.itemnames = s_driver_names;
s_graphicsoptions.driver.curvalue = (uis.glconfig.driverType == GLDRV_VOODOO);
@ -970,7 +1212,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.allow_extensions.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.allow_extensions.generic.name = "GL Extensions:";
s_graphicsoptions.allow_extensions.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.allow_extensions.generic.x = 400;
s_graphicsoptions.allow_extensions.generic.x = 200;
s_graphicsoptions.allow_extensions.generic.y = y;
s_graphicsoptions.allow_extensions.itemnames = enabled_names;
y += BIGCHAR_HEIGHT+2;
@ -979,7 +1221,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.mode.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.mode.generic.name = "Video Mode:";
s_graphicsoptions.mode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.mode.generic.x = 400;
s_graphicsoptions.mode.generic.x = 200;
s_graphicsoptions.mode.generic.y = y;
s_graphicsoptions.mode.itemnames = resolutions;
s_graphicsoptions.mode.generic.callback = GraphicsOptions_Event;
@ -990,7 +1232,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.colordepth.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.colordepth.generic.name = "Color Depth:";
s_graphicsoptions.colordepth.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.colordepth.generic.x = 400;
s_graphicsoptions.colordepth.generic.x = 200;
s_graphicsoptions.colordepth.generic.y = y;
s_graphicsoptions.colordepth.itemnames = colordepth_names;
y += BIGCHAR_HEIGHT+2;
@ -999,7 +1241,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.fs.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.fs.generic.name = "Fullscreen:";
s_graphicsoptions.fs.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.fs.generic.x = 400;
s_graphicsoptions.fs.generic.x = 200;
s_graphicsoptions.fs.generic.y = y;
s_graphicsoptions.fs.itemnames = enabled_names;
y += BIGCHAR_HEIGHT+2;
@ -1008,7 +1250,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.lighting.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.lighting.generic.name = "Lighting:";
s_graphicsoptions.lighting.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.lighting.generic.x = 400;
s_graphicsoptions.lighting.generic.x = 200;
s_graphicsoptions.lighting.generic.y = y;
s_graphicsoptions.lighting.itemnames = lighting_names;
y += BIGCHAR_HEIGHT+2;
@ -1017,7 +1259,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.geometry.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.geometry.generic.name = "Geometric Detail:";
s_graphicsoptions.geometry.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.geometry.generic.x = 400;
s_graphicsoptions.geometry.generic.x = 200;
s_graphicsoptions.geometry.generic.y = y;
s_graphicsoptions.geometry.itemnames = quality_names;
y += BIGCHAR_HEIGHT+2;
@ -1026,7 +1268,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.tq.generic.type = MTYPE_SLIDER;
s_graphicsoptions.tq.generic.name = "Texture Detail:";
s_graphicsoptions.tq.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.tq.generic.x = 400;
s_graphicsoptions.tq.generic.x = 200;
s_graphicsoptions.tq.generic.y = y;
s_graphicsoptions.tq.minvalue = 0;
s_graphicsoptions.tq.maxvalue = 3;
@ -1037,7 +1279,7 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.texturebits.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.texturebits.generic.name = "Texture Quality:";
s_graphicsoptions.texturebits.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.texturebits.generic.x = 400;
s_graphicsoptions.texturebits.generic.x = 200;
s_graphicsoptions.texturebits.generic.y = y;
s_graphicsoptions.texturebits.itemnames = tq_names;
y += BIGCHAR_HEIGHT+2;
@ -1046,11 +1288,12 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.filter.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.filter.generic.name = "Texture Filter:";
s_graphicsoptions.filter.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.filter.generic.x = 400;
s_graphicsoptions.filter.generic.x = 200;
s_graphicsoptions.filter.generic.y = y;
s_graphicsoptions.filter.itemnames = filter_names;
y += 2*BIGCHAR_HEIGHT;
/* Elder: replaced by RQ3 button
s_graphicsoptions.driverinfo.generic.type = MTYPE_PTEXT;
s_graphicsoptions.driverinfo.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.driverinfo.generic.callback = GraphicsOptions_Event;
@ -1061,41 +1304,63 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.driverinfo.style = UI_CENTER|UI_SMALLFONT;
s_graphicsoptions.driverinfo.color = color_red;
y += BIGCHAR_HEIGHT+2;
*/
s_graphicsoptions.rq3_driverinfo.generic.type = MTYPE_BITMAP;
s_graphicsoptions.rq3_driverinfo.generic.name = RQ3_DRIVERINFO_BUTTON;
s_graphicsoptions.rq3_driverinfo.generic.flags = QMF_RIGHT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_graphicsoptions.rq3_driverinfo.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.rq3_driverinfo.generic.id = ID_DRIVERINFO;
s_graphicsoptions.rq3_driverinfo.generic.x = 640;
s_graphicsoptions.rq3_driverinfo.generic.y = 12;
s_graphicsoptions.rq3_driverinfo.width = RQ3_BUTTON_WIDTH;
s_graphicsoptions.rq3_driverinfo.height = RQ3_BUTTON_HEIGHT;
s_graphicsoptions.rq3_driverinfo.focuspic = RQ3_FOCUS_BUTTON;
s_graphicsoptions.back.generic.type = MTYPE_BITMAP;
s_graphicsoptions.back.generic.name = GRAPHICSOPTIONS_BACK0;
s_graphicsoptions.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.back.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.back.generic.id = ID_BACK2;
s_graphicsoptions.back.generic.x = 0;
s_graphicsoptions.back.generic.y = 480-64;
s_graphicsoptions.back.width = 128;
s_graphicsoptions.back.height = 64;
s_graphicsoptions.back.generic.x = 8;
s_graphicsoptions.back.generic.y = 480-44;
s_graphicsoptions.back.width = 32;
s_graphicsoptions.back.height = 32;
s_graphicsoptions.back.focuspic = GRAPHICSOPTIONS_BACK1;
s_graphicsoptions.apply.generic.type = MTYPE_BITMAP;
s_graphicsoptions.apply.generic.name = GRAPHICSOPTIONS_ACCEPT0;
s_graphicsoptions.apply.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_HIDDEN|QMF_INACTIVE;
s_graphicsoptions.apply.generic.callback = GraphicsOptions_ApplyChanges;
s_graphicsoptions.apply.generic.x = 640;
s_graphicsoptions.apply.generic.y = 480-64;
s_graphicsoptions.apply.width = 128;
s_graphicsoptions.apply.height = 64;
s_graphicsoptions.apply.generic.x = 632 ;
s_graphicsoptions.apply.generic.y = 480-44;
s_graphicsoptions.apply.width = 64;
s_graphicsoptions.apply.height = 32;
s_graphicsoptions.apply.focuspic = GRAPHICSOPTIONS_ACCEPT1;
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.banner );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framel );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framer );
Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.multim );
Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.setupm );
Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.demom );
Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.modsm );
Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.exitm );
// Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.multim );
// Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.setupm );
// Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.demom );
// Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.modsm );
// Menu_AddItem( &s_graphicsoptions.menu, &s_graphicsoptions.exitm );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.graphics );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.display );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.sound );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.network );
//Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.graphics );
//Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.display );
//Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.sound );
//Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.network );
//Elder: added
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_systemicon );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_setuptitle );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_graphics );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_display );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_sound );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_network );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_statustext );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.rq3_driverinfo );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.list );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driver );
@ -1108,7 +1373,8 @@ void GraphicsOptions_MenuInit( void )
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.tq );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.texturebits );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.filter );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driverinfo );
//Elder: removed
//Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driverinfo );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.back );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.apply );
@ -1130,12 +1396,22 @@ GraphicsOptions_Cache
=================
*/
void GraphicsOptions_Cache( void ) {
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMEL );
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMER );
//trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMEL );
//trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMER );
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_BACK0 );
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_BACK1 );
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_ACCEPT0 );
trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_ACCEPT1 );
//Elder: added
trap_R_RegisterShaderNoMip( RQ3_SYSTEM_ICON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_TITLE );
trap_R_RegisterShaderNoMip( RQ3_GRAPHICS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DISPLAY_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SOUND_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_NETWORK_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_DRIVERINFO_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
@ -1147,6 +1423,6 @@ UI_GraphicsOptionsMenu
void UI_GraphicsOptionsMenu( void ) {
GraphicsOptions_MenuInit();
UI_PushMenu( &s_graphicsoptions.menu );
Menu_SetCursorToItem( &s_graphicsoptions.menu, &s_graphicsoptions.graphics );
Menu_SetCursorToItem( &s_graphicsoptions.menu, &s_graphicsoptions.rq3_graphics );
}