0-21-00 (BETA 1 Pending)
UI
This commit is contained in:
Victor Chow 2001-11-15 04:20:46 +00:00
parent ab6ec2739f
commit 3d159ba382
3 changed files with 113 additions and 48 deletions

View file

@ -116,6 +116,7 @@ typedef struct
#define ID_OPENDOOR 37
#define ID_DROPWEAP 38
#define ID_DROPITEM 39
#define ID_IRVISION 40
// all others
#define ID_FREELOOK 40
@ -250,6 +251,7 @@ typedef struct
menuaction_s opendoor;
menuaction_s dropweap;
menuaction_s dropitem;
menuaction_s irvision;
menuradiobutton_s joyenable;
menuslider_s joythreshold;
@ -311,10 +313,11 @@ static bind_t g_bindings[] =
{"messagemode4", "chat - attacker", ID_CHAT4, ANIM_CHAT, -1, -1, -1, -1},
{"bandage", "Bandage", ID_BANDAGE, ANIM_IDLE, -1, -1, -1, -1},
{"+button5", "Reload", ID_RELOAD, ANIM_RELOAD, -1, -1, -1, -1},
{"weapon", "Weapon mode", ID_WEAPON, ANIM_IDLE, -1, -1, -1, -1},
{"opendoor", "Open door", ID_OPENDOOR, ANIM_IDLE, -1, -1, -1, -1},
{"weapon", "Weapon Mode", ID_WEAPON, ANIM_IDLE, -1, -1, -1, -1},
{"opendoor", "Open Door", ID_OPENDOOR, ANIM_IDLE, -1, -1, -1, -1},
{"dropweapon", "Drop Weapon", ID_DROPWEAP, ANIM_IDLE, -1, -1, -1, -1},
{"dropitem", "Drop Item", ID_DROPITEM, ANIM_IDLE, -1, -1, -1, -1},
{"irvision", "IR Vision", ID_DROPITEM, ANIM_IDLE, -1, -1, -1, -1},
{(char*)NULL, (char*)NULL, 0, 0, -1, -1, -1, -1},
};
@ -403,6 +406,7 @@ static menucommon_s *g_reaction_controls[] = {
(menucommon_s *)&s_controls.opendoor,
(menucommon_s *)&s_controls.dropweap,
(menucommon_s *)&s_controls.dropitem,
(menucommon_s *)&s_controls.irvision,
NULL,
};
@ -1910,6 +1914,12 @@ static void Controls_MenuInit( void )
s_controls.dropitem.generic.ownerdraw = Controls_DrawKeyBinding;
s_controls.dropitem.generic.id = ID_DROPITEM;
s_controls.irvision.generic.type = MTYPE_ACTION;
s_controls.irvision.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_GRAYED|QMF_HIDDEN;
s_controls.irvision.generic.callback = Controls_ActionEvent;
s_controls.irvision.generic.ownerdraw = Controls_DrawKeyBinding;
s_controls.irvision.generic.id = ID_IRVISION;
s_controls.joyenable.generic.type = MTYPE_RADIOBUTTON;
s_controls.joyenable.generic.flags = QMF_SMALLFONT;
s_controls.joyenable.generic.x = SCREEN_WIDTH/2;
@ -2018,7 +2028,7 @@ static void Controls_MenuInit( void )
Menu_AddItem( &s_controls.menu, &s_controls.opendoor );
Menu_AddItem( &s_controls.menu, &s_controls.dropweap );
Menu_AddItem( &s_controls.menu, &s_controls.dropitem );
Menu_AddItem( &s_controls.menu, &s_controls.irvision );
Menu_AddItem( &s_controls.menu, &s_controls.back );

View file

@ -2,15 +2,17 @@
//
#include "ui_local.h"
#define SERVERINFO_FRAMEL "menu/art/frame2_l"
#define SERVERINFO_FRAMER "menu/art/frame1_r"
#define SERVERINFO_BACK0 "menu/art/back_0"
#define SERVERINFO_BACK1 "menu/art/back_1"
//#define SERVERINFO_FRAMEL "menu/art/frame2_l"
//#define SERVERINFO_FRAMER "menu/art/frame1_r"
//#define SERVERINFO_BACK0 "menu/art/back_0"
//#define SERVERINFO_BACK1 "menu/art/back_1"
#define SERVERINFO_BACK0 "menu/art/rq3-menu-back.tga"
#define SERVERINFO_BACK1 "menu/art/rq3-menu-back-focus.tga"
static char* serverinfo_artlist[] =
{
SERVERINFO_FRAMEL,
SERVERINFO_FRAMER,
//SERVERINFO_FRAMEL,
//SERVERINFO_FRAMER,
SERVERINFO_BACK0,
SERVERINFO_BACK1,
NULL
@ -111,7 +113,15 @@ static void ServerInfo_MenuDraw( void )
char value[MAX_INFO_VALUE];
int y;
y = SCREEN_HEIGHT/2 - s_serverinfo.numlines*(SMALLCHAR_HEIGHT)/2 - 20;
//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_FillRect( 0, 54, SCREEN_WIDTH, 2, color_red);
UI_FillRect( 0, 426, SCREEN_WIDTH, 2, color_red);
//y = SCREEN_HEIGHT/2 - s_serverinfo.numlines*(SMALLCHAR_HEIGHT)/2 - 54; //20;
y = 56;
s = s_serverinfo.info;
while ( s ) {
Info_NextPair( &s, key, value );
@ -209,7 +219,7 @@ void UI_ServerInfoMenu( void )
s_serverinfo.add.generic.callback = ServerInfo_Event;
s_serverinfo.add.generic.id = ID_ADD;
s_serverinfo.add.generic.x = 320;
s_serverinfo.add.generic.y = 371;
s_serverinfo.add.generic.y = 480 - 36;
s_serverinfo.add.string = "ADD TO FAVORITES";
s_serverinfo.add.style = UI_CENTER|UI_SMALLFONT;
s_serverinfo.add.color = color_red;
@ -222,10 +232,10 @@ void UI_ServerInfoMenu( void )
s_serverinfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_serverinfo.back.generic.callback = ServerInfo_Event;
s_serverinfo.back.generic.id = ID_BACK;
s_serverinfo.back.generic.x = 0;
s_serverinfo.back.generic.y = 480-64;
s_serverinfo.back.width = 128;
s_serverinfo.back.height = 64;
s_serverinfo.back.generic.x = 8;
s_serverinfo.back.generic.y = 480-44;
s_serverinfo.back.width = 32;
s_serverinfo.back.height = 32;
s_serverinfo.back.focuspic = SERVERINFO_BACK1;
trap_GetConfigString( CS_SERVERINFO, s_serverinfo.info, MAX_INFO_STRING );

View file

@ -12,12 +12,15 @@ START SERVER MENU *****
#include "ui_local.h"
#define GAMESERVER_BACK0 "menu/art/back_0"
#define GAMESERVER_BACK1 "menu/art/back_1"
//#define GAMESERVER_BACK0 "menu/art/back_0"
//#define GAMESERVER_BACK1 "menu/art/back_1"
#define GAMESERVER_BACK0 "menu/art/rq3-menu-back.tga"
#define GAMESERVER_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define GAMESERVER_NEXT0 "menu/art/next_0"
#define GAMESERVER_NEXT1 "menu/art/next_1"
#define GAMESERVER_FRAMEL "menu/art/frame2_l"
#define GAMESERVER_FRAMER "menu/art/frame1_r"
//#define GAMESERVER_FRAMEL "menu/art/frame2_l"
//#define GAMESERVER_FRAMER "menu/art/frame1_r"
#define GAMESERVER_SELECT "menu/art/maps_select"
#define GAMESERVER_SELECTED "menu/art/maps_selected"
#define GAMESERVER_FIGHT0 "menu/art/fight_0"
@ -361,6 +364,18 @@ static void StartServer_LevelshotDraw( void *self ) {
}
static void StartServer_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);
UI_FillRect( 0, 54, SCREEN_WIDTH, 2, color_red);
UI_FillRect( 0, 426, SCREEN_WIDTH, 2, color_red);
// standard menu drawing
Menu_Draw( &s_startserver.menu );
}
/*
=================
StartServer_MenuInit
@ -377,6 +392,7 @@ static void StartServer_MenuInit( void ) {
StartServer_Cache();
s_startserver.menu.draw = StartServer_MenuDraw;
s_startserver.menu.wrapAround = qtrue;
s_startserver.menu.fullscreen = qtrue;
s_startserver.menu.showlogo = qtrue;
@ -492,7 +508,7 @@ static void StartServer_MenuInit( void ) {
s_startserver.arrows.generic.name = GAMESERVER_ARROWS;
s_startserver.arrows.generic.flags = QMF_INACTIVE;
s_startserver.arrows.generic.x = 260;
s_startserver.arrows.generic.y = 400;
s_startserver.arrows.generic.y = 388;
s_startserver.arrows.width = 128;
s_startserver.arrows.height = 32;
@ -501,7 +517,7 @@ static void StartServer_MenuInit( void ) {
s_startserver.prevpage.generic.callback = StartServer_MenuEvent;
s_startserver.prevpage.generic.id = ID_PREVPAGE;
s_startserver.prevpage.generic.x = 260;
s_startserver.prevpage.generic.y = 400;
s_startserver.prevpage.generic.y = 388;
s_startserver.prevpage.width = 64;
s_startserver.prevpage.height = 32;
s_startserver.prevpage.focuspic = GAMESERVER_ARROWSL;
@ -511,7 +527,7 @@ static void StartServer_MenuInit( void ) {
s_startserver.nextpage.generic.callback = StartServer_MenuEvent;
s_startserver.nextpage.generic.id = ID_NEXTPAGE;
s_startserver.nextpage.generic.x = 321;
s_startserver.nextpage.generic.y = 400;
s_startserver.nextpage.generic.y = 388;
s_startserver.nextpage.width = 64;
s_startserver.nextpage.height = 32;
s_startserver.nextpage.focuspic = GAMESERVER_ARROWSR;
@ -529,10 +545,10 @@ static void StartServer_MenuInit( void ) {
s_startserver.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_startserver.back.generic.callback = StartServer_MenuEvent;
s_startserver.back.generic.id = ID_STARTSERVERBACK;
s_startserver.back.generic.x = 0;
s_startserver.back.generic.y = 480-64;
s_startserver.back.width = 128;
s_startserver.back.height = 64;
s_startserver.back.generic.x = 8;
s_startserver.back.generic.y = 480-44;
s_startserver.back.width = 32;
s_startserver.back.height = 32;
s_startserver.back.focuspic = GAMESERVER_BACK1;
s_startserver.next.generic.type = MTYPE_BITMAP;
@ -540,10 +556,10 @@ static void StartServer_MenuInit( void ) {
s_startserver.next.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_startserver.next.generic.callback = StartServer_MenuEvent;
s_startserver.next.generic.id = ID_STARTSERVERNEXT;
s_startserver.next.generic.x = 640;
s_startserver.next.generic.y = 480-64;
s_startserver.next.width = 128;
s_startserver.next.height = 64;
s_startserver.next.generic.x = 640-8;
s_startserver.next.generic.y = 480-44;
s_startserver.next.width = 64;
s_startserver.next.height = 32;
s_startserver.next.focuspic = GAMESERVER_NEXT1;
s_startserver.item_null.generic.type = MTYPE_BITMAP;
@ -1253,6 +1269,18 @@ static void PlayerName_Draw( void *item ) {
}
static void ServerOptions_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);
UI_FillRect( 0, 54, SCREEN_WIDTH, 2, color_red);
UI_FillRect( 0, 426, SCREEN_WIDTH, 2, color_red);
// standard menu drawing
Menu_Draw( &s_serveroptions.menu );
}
/*
=================
ServerOptions_MenuInit
@ -1270,6 +1298,7 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
ServerOptions_Cache();
s_serveroptions.menu.draw = ServerOptions_MenuDraw;
s_serveroptions.menu.wrapAround = qtrue;
s_serveroptions.menu.fullscreen = qtrue;
s_serveroptions.menu.showlogo = qtrue;
@ -1424,10 +1453,10 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
s_serveroptions.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_serveroptions.back.generic.callback = ServerOptions_Event;
s_serveroptions.back.generic.id = ID_BACK;
s_serveroptions.back.generic.x = 0;
s_serveroptions.back.generic.y = 480-64;
s_serveroptions.back.width = 128;
s_serveroptions.back.height = 64;
s_serveroptions.back.generic.x = 8;
s_serveroptions.back.generic.y = 480-44;
s_serveroptions.back.width = 32;
s_serveroptions.back.height = 32;
s_serveroptions.back.focuspic = GAMESERVER_BACK1;
s_serveroptions.next.generic.type = MTYPE_BITMAP;
@ -1447,10 +1476,10 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
s_serveroptions.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_serveroptions.go.generic.callback = ServerOptions_Event;
s_serveroptions.go.generic.id = ID_GO;
s_serveroptions.go.generic.x = 640;
s_serveroptions.go.generic.y = 480-64;
s_serveroptions.go.width = 128;
s_serveroptions.go.height = 64;
s_serveroptions.go.generic.x = 640-8;
s_serveroptions.go.generic.y = 480-44;
s_serveroptions.go.width = 64;
s_serveroptions.go.height = 32;
s_serveroptions.go.focuspic = GAMESERVER_FIGHT1;
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.banner );
@ -1531,8 +1560,11 @@ BOT SELECT MENU *****
*/
#define BOTSELECT_BACK0 "menu/art/back_0"
#define BOTSELECT_BACK1 "menu/art/back_1"
//#define BOTSELECT_BACK0 "menu/art/back_0"
//#define BOTSELECT_BACK1 "menu/art/back_1"
#define BOTSELECT_BACK0 "menu/art/rq3-menu-back.tga"
#define BOTSELECT_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define BOTSELECT_ACCEPT0 "menu/art/accept_0"
#define BOTSELECT_ACCEPT1 "menu/art/accept_1"
#define BOTSELECT_SELECT "menu/art/opponents_select"
@ -1857,11 +1889,24 @@ void UI_BotSelectMenu_Cache( void ) {
}
static void UI_BotSelectMenu_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);
UI_FillRect( 0, 54, SCREEN_WIDTH, 2, color_red);
UI_FillRect( 0, 426, SCREEN_WIDTH, 2, color_red);
// standard menu drawing
Menu_Draw( &botSelectInfo.menu );
}
static void UI_BotSelectMenu_Init( char *bot ) {
int i, j, k;
int x, y;
memset( &botSelectInfo, 0 ,sizeof(botSelectInfo) );
botSelectInfo.menu.draw = UI_BotSelectMenu_MenuDraw;
botSelectInfo.menu.wrapAround = qtrue;
botSelectInfo.menu.fullscreen = qtrue;
botSelectInfo.menu.showlogo = qtrue;//Blaze: show bg logo
@ -1947,20 +1992,20 @@ static void UI_BotSelectMenu_Init( char *bot ) {
botSelectInfo.back.generic.name = BOTSELECT_BACK0;
botSelectInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
botSelectInfo.back.generic.callback = UI_BotSelectMenu_BackEvent;
botSelectInfo.back.generic.x = 0;
botSelectInfo.back.generic.y = 480-64;
botSelectInfo.back.width = 128;
botSelectInfo.back.height = 64;
botSelectInfo.back.generic.x = 8;
botSelectInfo.back.generic.y = 480-44;
botSelectInfo.back.width = 32;
botSelectInfo.back.height = 32;
botSelectInfo.back.focuspic = BOTSELECT_BACK1;
botSelectInfo.go.generic.type = MTYPE_BITMAP;
botSelectInfo.go.generic.name = BOTSELECT_ACCEPT0;
botSelectInfo.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
botSelectInfo.go.generic.callback = UI_BotSelectMenu_SelectEvent;
botSelectInfo.go.generic.x = 640;
botSelectInfo.go.generic.y = 480-64;
botSelectInfo.go.width = 128;
botSelectInfo.go.height = 64;
botSelectInfo.go.generic.x = 640-8;
botSelectInfo.go.generic.y = 480-44;
botSelectInfo.go.width = 64;
botSelectInfo.go.height = 32;
botSelectInfo.go.focuspic = BOTSELECT_ACCEPT1;
Menu_AddItem( &botSelectInfo.menu, &botSelectInfo.banner );