updates to more ui_*.c files

This commit is contained in:
Walter Julius Hennecke 2014-11-08 11:47:20 +01:00
parent 2341196c1b
commit 211d287385
5 changed files with 1333 additions and 1311 deletions

View file

@ -3,17 +3,21 @@
#include "ui_local.h"
#include "ui_logger.h"
#define MAX_MODS 64
#define NAMEBUFSIZE ( MAX_MODS * 48 )
#define GAMEBUFSIZE ( MAX_MODS * 16 )
enum ui_modsLimits_e {
MAX_MODS = 64,
NAMEBUFSIZE = (MAX_MODS * 48),
GAMEBUFSIZE = (MAX_MODS * 16)
};
#define ID_BACK 10
#define ID_GO 11
#define ID_LIST 12
#define ID_MAINMENU 100
enum ui_modsIDs_e {
ID_BACK = 10,
ID_GO,
ID_LIST,
ID_MAINMENU = 100
};
typedef struct
typedef struct
{
menuframework_s menu;
@ -45,20 +49,20 @@ static mods_t s_mods;
Mods_MenuEvent
===============
*/
static void Mods_MenuEvent( void *ptr, int32_t event )
static void Mods_MenuEvent(void *ptr, int32_t event)
{
UI_LogFuncBegin();
if( event != QM_ACTIVATED )
if (event != QM_ACTIVATED)
{
UI_LogFuncEnd();
return;
}
switch ( ((menucommon_s*)ptr)->id )
switch (((menucommon_s*)ptr)->id)
{
case ID_GO:
trap_Cvar_Set( "fs_game", s_mods.fs_gameList[s_mods.list.curvalue] );
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
trap_Cvar_Set("fs_game", s_mods.fs_gameList[s_mods.list.curvalue]);
trap_Cmd_ExecuteText(EXEC_APPEND, "vid_restart;");
UI_PopMenu();
break;
@ -75,18 +79,18 @@ static void Mods_MenuEvent( void *ptr, int32_t event )
UI_Mods_ParseInfos
===============
*/
static void UI_Mods_ParseInfos( char *modDir, char *modDesc )
static void UI_Mods_ParseInfos(char *modDir, char *modDesc)
{
UI_LogFuncBegin();
s_mods.fs_gameList[s_mods.list.numitems] = s_mods.fs_gamePtr;
Q_strncpyz( s_mods.fs_gamePtr, modDir, 16 );
Q_strncpyz(s_mods.fs_gamePtr, modDir, 16);
s_mods.descriptionList[s_mods.list.numitems] = s_mods.descriptionPtr;
Q_strncpyz( s_mods.descriptionPtr, modDesc, 48 );
Q_strncpyz(s_mods.descriptionPtr, modDesc, 48);
s_mods.list.itemnames[s_mods.list.numitems] = s_mods.descriptionPtr;
s_mods.descriptionPtr += strlen( s_mods.descriptionPtr ) + 1;
s_mods.fs_gamePtr += strlen( s_mods.fs_gamePtr ) + 1;
s_mods.descriptionPtr += strlen(s_mods.descriptionPtr) + 1;
s_mods.fs_gamePtr += strlen(s_mods.fs_gamePtr) + 1;
s_mods.list.numitems++;
UI_LogFuncEnd();
}
@ -96,7 +100,7 @@ static void UI_Mods_ParseInfos( char *modDir, char *modDesc )
Mods_LoadMods
===============
*/
static void Mods_LoadMods( void )
static void Mods_LoadMods(void)
{
UI_LogFuncBegin();
int32_t numdirs;
@ -115,18 +119,18 @@ static void Mods_LoadMods( void )
s_mods.list.itemnames[0] = s_mods.descriptionList[0] = (char*)menu_normal_text[MNT_ELITEFORCE_HOLOMATCH];
s_mods.fs_gameList[0] = "";
numdirs = trap_FS_GetFileList( "$modlist", "", dirlist, sizeof(dirlist) );
dirptr = dirlist;
for( i = 0; i < numdirs && s_mods.list.numitems < MAX_MODS; i++ )
numdirs = trap_FS_GetFileList("$modlist", "", dirlist, sizeof(dirlist));
dirptr = dirlist;
for (i = 0; i < numdirs && s_mods.list.numitems < MAX_MODS; i++)
{
dirlen = strlen( dirptr ) + 1;
dirlen = strlen(dirptr) + 1;
descptr = dirptr + dirlen;
UI_Mods_ParseInfos( dirptr, descptr);
UI_Mods_ParseInfos(dirptr, descptr);
dirptr += dirlen + strlen(descptr) + 1;
}
trap_Print(va("%i mods parsed\n", s_mods.list.numitems));
if (s_mods.list.numitems > MAX_MODS)
if (s_mods.list.numitems > MAX_MODS)
{
s_mods.list.numitems = MAX_MODS;
}
@ -139,43 +143,43 @@ static void Mods_LoadMods( void )
M_MainMenu_Graphics
=================
*/
void ModsMenu_Graphics (void)
void ModsMenu_Graphics(void)
{
UI_LogFuncBegin();
// Draw the basic screen layout
UI_MenuFrame(&s_mods.menu);
UI_DrawProportionalString( 74, 66, "66",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 84, "122855",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 188, "81",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 206, "4561",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 395, "2000",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 66, "66", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 84, "122855", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 188, "81", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 206, "4561", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 395, "2000", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30,203, 47, 123, uis.whiteShader); // Top left column square on bottom 3rd
UI_DrawHandlePic(30,328, 47, 61, uis.whiteShader); // Bottom left column square on bottom 3rd
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30, 203, 47, 123, uis.whiteShader); // Top left column square on bottom 3rd
UI_DrawHandlePic(30, 328, 47, 61, uis.whiteShader); // Bottom left column square on bottom 3rd
UI_DrawProportionalString( 74, 206, "38",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 332, "28",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 206, "38", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 332, "28", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
trap_R_SetColor( colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic(127, 167, 32, 32, s_mods.corner_ul);
UI_DrawHandlePic(550, 167, 32, 32, s_mods.corner_ur);
trap_R_SetColor(colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic(127, 167, 32, 32, s_mods.corner_ul);
UI_DrawHandlePic(550, 167, 32, 32, s_mods.corner_ur);
UI_DrawHandlePic(127, 410, 32, 32, s_mods.corner_ll);
UI_DrawHandlePic(550, 410, 32, 32, s_mods.corner_lr);
UI_DrawHandlePic(127, 410, 32, 32, s_mods.corner_ll);
UI_DrawHandlePic(550, 410, 32, 32, s_mods.corner_lr);
UI_DrawHandlePic(149, 167, 402, 18, uis.whiteShader); // Top line
UI_DrawHandlePic(127, 192, 18, 215, uis.whiteShader); // Left side
UI_DrawHandlePic(554, 192, 18, 215, uis.whiteShader); // Right side
UI_DrawHandlePic(149, 167, 402, 18, uis.whiteShader); // Top line
UI_DrawHandlePic(127, 192, 18, 215, uis.whiteShader); // Left side
UI_DrawHandlePic(554, 192, 18, 215, uis.whiteShader); // Right side
UI_DrawHandlePic(149, 414, 133, 18, uis.whiteShader); // Bottom line to left of button
UI_DrawHandlePic(418, 414, 133, 18, uis.whiteShader); // Bottom line to right of button
UI_DrawHandlePic(149, 414, 133, 18, uis.whiteShader); // Bottom line to left of button
UI_DrawHandlePic(418, 414, 133, 18, uis.whiteShader); // Bottom line to right of button
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawProportionalString( 152, 168, menu_normal_text[MNT_AVAILABLEMODS], UI_SMALLFONT, colorTable[CT_BLACK]); //colorTable[CT_LTPURPLE3] //210
UI_DrawProportionalString( 568, 170, "38-56",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawProportionalString(152, 168, menu_normal_text[MNT_AVAILABLEMODS], UI_SMALLFONT, colorTable[CT_BLACK]); //colorTable[CT_LTPURPLE3] //210
UI_DrawProportionalString(568, 170, "38-56", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_LogFuncEnd();
}
@ -184,13 +188,13 @@ void ModsMenu_Graphics (void)
ModsMenu_Draw
=================
*/
void ModsMenu_Draw (void)
void ModsMenu_Draw(void)
{
UI_LogFuncBegin();
// Draw graphics particular to Mods Menu
ModsMenu_Graphics();
Menu_Draw( &s_mods.menu );
Menu_Draw(&s_mods.menu);
UI_LogFuncEnd();
}
@ -199,13 +203,13 @@ void ModsMenu_Draw (void)
UI_Mods_Cache
=================
*/
void UI_ModsMenu_Cache( void )
void UI_ModsMenu_Cache(void)
{
UI_LogFuncBegin();
s_mods.corner_ul = trap_R_RegisterShaderNoMip("menu/common/corner_ul_18_18.tga");
s_mods.corner_ur = trap_R_RegisterShaderNoMip("menu/common/corner_ur_18_18.tga");
s_mods.corner_ll = trap_R_RegisterShaderNoMip("menu/common/corner_ll_18_18.tga");
s_mods.corner_lr = trap_R_RegisterShaderNoMip("menu/common/corner_lr_18_18.tga");
s_mods.corner_ul = trap_R_RegisterShaderNoMip("menu/common/corner_ul_18_18.tga");
s_mods.corner_ur = trap_R_RegisterShaderNoMip("menu/common/corner_ur_18_18.tga");
s_mods.corner_ll = trap_R_RegisterShaderNoMip("menu/common/corner_ll_18_18.tga");
s_mods.corner_lr = trap_R_RegisterShaderNoMip("menu/common/corner_lr_18_18.tga");
UI_LogFuncEnd();
}
@ -214,73 +218,73 @@ void UI_ModsMenu_Cache( void )
UI_Mods_MenuInit
===============
*/
static void UI_Mods_MenuInit( void )
static void UI_Mods_MenuInit(void)
{
UI_LogFuncBegin();
// Menu Data
memset( &s_mods, 0 ,sizeof(mods_t) );
s_mods.menu.wrapAround = qtrue;
s_mods.menu.fullscreen = qtrue;
s_mods.menu.draw = ModsMenu_Draw;
s_mods.menu.descX = MENU_DESC_X;
s_mods.menu.descY = MENU_DESC_Y;
s_mods.menu.titleX = MENU_TITLE_X;
s_mods.menu.titleY = MENU_TITLE_Y;
s_mods.menu.titleI = MNT_MODS_TITLE;
s_mods.menu.footNoteEnum = MNT_MODS;
memset(&s_mods, 0, sizeof(mods_t));
s_mods.menu.wrapAround = qtrue;
s_mods.menu.fullscreen = qtrue;
s_mods.menu.draw = ModsMenu_Draw;
s_mods.menu.descX = MENU_DESC_X;
s_mods.menu.descY = MENU_DESC_Y;
s_mods.menu.titleX = MENU_TITLE_X;
s_mods.menu.titleY = MENU_TITLE_Y;
s_mods.menu.titleI = MNT_MODS_TITLE;
s_mods.menu.footNoteEnum = MNT_MODS;
UI_ModsMenu_Cache();
// Button Data
s_mods.mainmenu.generic.type = MTYPE_BITMAP;
s_mods.mainmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_mods.mainmenu.generic.x = 482;
s_mods.mainmenu.generic.y = 136;
s_mods.mainmenu.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
s_mods.mainmenu.generic.id = ID_MAINMENU;
s_mods.mainmenu.generic.callback = Mods_MenuEvent;
s_mods.mainmenu.width = MENU_BUTTON_MED_WIDTH;
s_mods.mainmenu.height = MENU_BUTTON_MED_HEIGHT;
s_mods.mainmenu.color = CT_DKPURPLE1;
s_mods.mainmenu.color2 = CT_LTPURPLE1;
s_mods.mainmenu.textX = MENU_BUTTON_TEXT_X;
s_mods.mainmenu.textY = MENU_BUTTON_TEXT_Y;
s_mods.mainmenu.textEnum = MBT_MAINMENU;
s_mods.mainmenu.textcolor = CT_BLACK;
s_mods.mainmenu.textcolor2 = CT_WHITE;
s_mods.mainmenu.generic.type = MTYPE_BITMAP;
s_mods.mainmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_mods.mainmenu.generic.x = 482;
s_mods.mainmenu.generic.y = 136;
s_mods.mainmenu.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
s_mods.mainmenu.generic.id = ID_MAINMENU;
s_mods.mainmenu.generic.callback = Mods_MenuEvent;
s_mods.mainmenu.width = MENU_BUTTON_MED_WIDTH;
s_mods.mainmenu.height = MENU_BUTTON_MED_HEIGHT;
s_mods.mainmenu.color = CT_DKPURPLE1;
s_mods.mainmenu.color2 = CT_LTPURPLE1;
s_mods.mainmenu.textX = MENU_BUTTON_TEXT_X;
s_mods.mainmenu.textY = MENU_BUTTON_TEXT_Y;
s_mods.mainmenu.textEnum = MBT_MAINMENU;
s_mods.mainmenu.textcolor = CT_BLACK;
s_mods.mainmenu.textcolor2 = CT_WHITE;
s_mods.go.generic.type = MTYPE_BITMAP;
s_mods.go.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_mods.go.generic.x = 285;
s_mods.go.generic.y = 414;
s_mods.go.generic.name = GRAPHIC_SQUARE;
s_mods.go.generic.id = ID_GO;
s_mods.go.generic.callback = Mods_MenuEvent;
s_mods.go.width = MENU_BUTTON_MED_WIDTH;
s_mods.go.height = MENU_BUTTON_MED_HEIGHT;
s_mods.go.color = CT_DKPURPLE1;
s_mods.go.color2 = CT_LTPURPLE1;
s_mods.go.textX = MENU_BUTTON_TEXT_X;
s_mods.go.textY = MENU_BUTTON_TEXT_Y;
s_mods.go.textEnum = MBT_LOADMOD;
s_mods.go.textcolor = CT_BLACK;
s_mods.go.textcolor2 = CT_WHITE;
s_mods.go.generic.type = MTYPE_BITMAP;
s_mods.go.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_mods.go.generic.x = 285;
s_mods.go.generic.y = 414;
s_mods.go.generic.name = GRAPHIC_SQUARE;
s_mods.go.generic.id = ID_GO;
s_mods.go.generic.callback = Mods_MenuEvent;
s_mods.go.width = MENU_BUTTON_MED_WIDTH;
s_mods.go.height = MENU_BUTTON_MED_HEIGHT;
s_mods.go.color = CT_DKPURPLE1;
s_mods.go.color2 = CT_LTPURPLE1;
s_mods.go.textX = MENU_BUTTON_TEXT_X;
s_mods.go.textY = MENU_BUTTON_TEXT_Y;
s_mods.go.textEnum = MBT_LOADMOD;
s_mods.go.textcolor = CT_BLACK;
s_mods.go.textcolor2 = CT_WHITE;
// scan for mods
s_mods.list.generic.type = MTYPE_SCROLLLIST;
s_mods.list.generic.flags = QMF_PULSEIFFOCUS;
s_mods.list.generic.callback = Mods_MenuEvent;
s_mods.list.generic.id = ID_LIST;
s_mods.list.generic.x = 159;
s_mods.list.generic.y = 195;
s_mods.list.width = 48;
s_mods.list.height = 14;
s_mods.list.generic.type = MTYPE_SCROLLLIST;
s_mods.list.generic.flags = QMF_PULSEIFFOCUS;
s_mods.list.generic.callback = Mods_MenuEvent;
s_mods.list.generic.id = ID_LIST;
s_mods.list.generic.x = 159;
s_mods.list.generic.y = 195;
s_mods.list.width = 48;
s_mods.list.height = 14;
Mods_LoadMods();
Menu_AddItem( &s_mods.menu, &s_mods.mainmenu );
Menu_AddItem( &s_mods.menu, &s_mods.list );
Menu_AddItem( &s_mods.menu, &s_mods.go );
Menu_AddItem(&s_mods.menu, &s_mods.mainmenu);
Menu_AddItem(&s_mods.menu, &s_mods.list);
Menu_AddItem(&s_mods.menu, &s_mods.go);
UI_LogFuncEnd();
}
@ -290,10 +294,10 @@ static void UI_Mods_MenuInit( void )
UI_ModsMenu
===============
*/
void UI_ModsMenu( void )
void UI_ModsMenu(void)
{
UI_LogFuncBegin();
UI_Mods_MenuInit();
UI_PushMenu( &s_mods.menu );
UI_PushMenu(&s_mods.menu);
UI_LogFuncEnd();
}

View file

@ -2,29 +2,33 @@
UI_MOTD.C
The MotD thing
RPG-X - Marcin - 15/12/2008
**********************************************************************/
RPG-X - Marcin - 15/12/2008
**********************************************************************/
#include "../qcommon/stv_version.h"
#include "ui_local.h"
#include "ui_logger.h"
#define ID_CONTINUE 10
#define ID_DISCONNECT 11
#define ID_ARROWUP 100
#define ID_ARROWDOWN 101
enum ui_motdIDs_e {
ID_CONTINUE = 10,
ID_DISCONNECT,
ID_ARROWUP = 100,
ID_ARROWDOWN
};
#define MIN_MOTD_LINES 20
#define MAX_MOTD_LINES 256
enum ui_motdLimits_e {
MIN_MOTD_LINES = 20,
MAX_MOTD_LINES = 256
};
extern void InGame_LeaveAction( qboolean result );
extern void InGame_LeaveAction(qboolean result);
char motdtext[MAX_MOTD_LINES][256];
int32_t motdtextnum;
typedef struct {
menuframework_s menu;
menubitmap_s quitmenu;
menuframework_s menu;
menubitmap_s quitmenu;
menubitmap_s disconnect;
menubitmap_s arrowdwn;
menubitmap_s arrowup;
@ -40,33 +44,33 @@ static motdstuff_t s_motdstuff;
M_Motd_Event
=================
*/
static void M_MotdMenu_Event( void *ptr, int32_t notification )
static void M_MotdMenu_Event(void *ptr, int32_t notification)
{
UI_LogFuncBegin();
if( notification != QM_ACTIVATED ) {
if (notification != QM_ACTIVATED) {
UI_LogFuncEnd();
return;
}
switch ( ((menucommon_s*)ptr)->id ) {
switch (((menucommon_s*)ptr)->id) {
case ID_DISCONNECT:
UI_ConfirmMenu( menu_normal_text[MNT_LEAVE_MATCH], 0, InGame_LeaveAction );
UI_ConfirmMenu(menu_normal_text[MNT_LEAVE_MATCH], 0, InGame_LeaveAction);
break;
case ID_CONTINUE:
UI_PopMenu();
break;
case ID_ARROWUP:
if ( s_motdstuff.scrollnum > 0 ) {
if (s_motdstuff.scrollnum > 0) {
s_motdstuff.scrollnum -= 3;
}
break;
case ID_ARROWDOWN:
if ( s_motdstuff.scrollnum + MIN_MOTD_LINES < motdtextnum ) {
if (s_motdstuff.scrollnum + MIN_MOTD_LINES < motdtextnum) {
s_motdstuff.scrollnum += 3;
}
}
UI_LogFuncEnd();
UI_LogFuncEnd();
}
/*
@ -74,11 +78,11 @@ static void M_MotdMenu_Event( void *ptr, int32_t notification )
MotdMenu_Key
=================
*/
sfxHandle_t MotdMenu_Key( int32_t key )
sfxHandle_t MotdMenu_Key(int32_t key)
{
UI_LogFuncBegin();
UI_LogFuncEnd();
return ( Menu_DefaultKey( &s_motdstuff.menu, key ) );
return (Menu_DefaultKey(&s_motdstuff.menu, key));
}
/*
@ -86,36 +90,36 @@ sfxHandle_t MotdMenu_Key( int32_t key )
M_MotdMenu_Graphics
=================
*/
static void M_MotdMenu_Graphics( void )
static void M_MotdMenu_Graphics(void)
{
UI_LogFuncBegin();
int32_t i;
int32_t x = 15;
int32_t y = 15;
int32_t x = 15;
int32_t y = 15;
for (i = s_motdstuff.scrollnum; i < motdtextnum && i < (MIN_MOTD_LINES + s_motdstuff.scrollnum); ++i) {
UI_DrawProportionalString( x, y, motdtext[i], UI_SMALLFONT | UI_LEFT, colorTable[CT_WHITE]);
y += 21;
UI_DrawProportionalString(x, y, motdtext[i], UI_SMALLFONT | UI_LEFT, colorTable[CT_WHITE]);
y += 21;
}
//UI_FrameBottom_Graphics(); // Bottom two thirds
// Print version
UI_DrawProportionalString( 371, 445, Q3_VERSION, UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(371, 445, Q3_VERSION, UI_TINYFONT, colorTable[CT_BLACK]);
trap_R_SetColor( colorTable[s_motdstuff.quitmenu.color] );
UI_DrawHandlePic(s_motdstuff.quitmenu.generic.x - 14,
s_motdstuff.quitmenu.generic.y,
trap_R_SetColor(colorTable[s_motdstuff.quitmenu.color]);
UI_DrawHandlePic(s_motdstuff.quitmenu.generic.x - 14,
s_motdstuff.quitmenu.generic.y,
MENU_BUTTON_MED_HEIGHT, s_motdstuff.quitmenu.height, uis.graphicButtonLeftEnd);
UI_DrawHandlePic(s_motdstuff.disconnect.generic.x - 14,
s_motdstuff.disconnect.generic.y,
s_motdstuff.disconnect.generic.y,
MENU_BUTTON_MED_HEIGHT, s_motdstuff.disconnect.height, uis.graphicButtonLeftEnd);
trap_R_SetColor( colorTable[CT_LTBLUE1]); //LTBROWN1]);
UI_DrawHandlePic( 28, 440, 287, 17, uis.whiteShader); // Bottom front Line
trap_R_SetColor(colorTable[CT_LTBLUE1]); //LTBROWN1]);
UI_DrawHandlePic(28, 440, 287, 17, uis.whiteShader); // Bottom front Line
UI_DrawHandlePic( 0, 440, 25, 25, s_motdstuff.halfroundl_22);
UI_DrawHandlePic( 319, 440, 25, 25, uis.halfroundr_22);
UI_DrawHandlePic(0, 440, 25, 25, s_motdstuff.halfroundl_22);
UI_DrawHandlePic(319, 440, 25, 25, uis.halfroundr_22);
trap_R_SetColor(NULL);
UI_LogFuncEnd();
@ -126,12 +130,12 @@ static void M_MotdMenu_Graphics( void )
MotdMenu_Draw
===============
*/
static void MotdMenu_Draw( void )
static void MotdMenu_Draw(void)
{
UI_LogFuncBegin();
M_MotdMenu_Graphics();
M_MotdMenu_Graphics();
UI_LogFuncEnd();
Menu_Draw( &s_motdstuff.menu );
Menu_Draw(&s_motdstuff.menu);
}
/*
@ -139,10 +143,10 @@ static void MotdMenu_Draw( void )
UI_MotdMenu_Cache
===============
*/
void UI_MotdMenu_Cache( void )
void UI_MotdMenu_Cache(void)
{
UI_LogFuncBegin();
s_motdstuff.halfroundl_22 = trap_R_RegisterShaderNoMip( "menu/common/halfroundl_22.tga" );
s_motdstuff.halfroundl_22 = trap_R_RegisterShaderNoMip("menu/common/halfroundl_22.tga");
UI_LogFuncEnd();
}
@ -151,90 +155,90 @@ void UI_MotdMenu_Cache( void )
MotdMenu_Init
===============
*/
void MotdMenu_Init( void )
void MotdMenu_Init(void)
{
UI_LogFuncBegin();
s_motdstuff.menu.nitems = 0;
s_motdstuff.menu.draw = MotdMenu_Draw;
s_motdstuff.menu.key = MotdMenu_Key;
s_motdstuff.menu.wrapAround = qtrue;
s_motdstuff.menu.descX = MENU_DESC_X;
s_motdstuff.menu.descY = MENU_DESC_Y;
s_motdstuff.menu.titleX = MENU_TITLE_X;
s_motdstuff.menu.titleY = MENU_TITLE_Y;
s_motdstuff.menu.nitems = 0;
s_motdstuff.menu.draw = MotdMenu_Draw;
s_motdstuff.menu.key = MotdMenu_Key;
s_motdstuff.menu.wrapAround = qtrue;
s_motdstuff.menu.descX = MENU_DESC_X;
s_motdstuff.menu.descY = MENU_DESC_Y;
s_motdstuff.menu.titleX = MENU_TITLE_X;
s_motdstuff.menu.titleY = MENU_TITLE_Y;
s_motdstuff.quitmenu.generic.type = MTYPE_BITMAP;
s_motdstuff.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.quitmenu.generic.x = 500;
s_motdstuff.quitmenu.generic.y = 440;
s_motdstuff.quitmenu.generic.name = GRAPHIC_BUTTONRIGHT;
s_motdstuff.quitmenu.generic.id = ID_CONTINUE;
s_motdstuff.quitmenu.generic.callback = M_MotdMenu_Event;
s_motdstuff.quitmenu.width = MENU_BUTTON_MED_WIDTH;
s_motdstuff.quitmenu.height = MENU_BUTTON_MED_HEIGHT;
s_motdstuff.quitmenu.color = CT_DKORANGE;
s_motdstuff.quitmenu.color2 = CT_LTORANGE;
s_motdstuff.quitmenu.textX = MENU_BUTTON_TEXT_X;
s_motdstuff.quitmenu.textY = MENU_BUTTON_TEXT_Y;
s_motdstuff.quitmenu.textEnum = MBT_CONTINUE;
s_motdstuff.quitmenu.textcolor = CT_BLACK;
s_motdstuff.quitmenu.textcolor2 = CT_WHITE;
s_motdstuff.quitmenu.generic.type = MTYPE_BITMAP;
s_motdstuff.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.quitmenu.generic.x = 500;
s_motdstuff.quitmenu.generic.y = 440;
s_motdstuff.quitmenu.generic.name = GRAPHIC_BUTTONRIGHT;
s_motdstuff.quitmenu.generic.id = ID_CONTINUE;
s_motdstuff.quitmenu.generic.callback = M_MotdMenu_Event;
s_motdstuff.quitmenu.width = MENU_BUTTON_MED_WIDTH;
s_motdstuff.quitmenu.height = MENU_BUTTON_MED_HEIGHT;
s_motdstuff.quitmenu.color = CT_DKORANGE;
s_motdstuff.quitmenu.color2 = CT_LTORANGE;
s_motdstuff.quitmenu.textX = MENU_BUTTON_TEXT_X;
s_motdstuff.quitmenu.textY = MENU_BUTTON_TEXT_Y;
s_motdstuff.quitmenu.textEnum = MBT_CONTINUE;
s_motdstuff.quitmenu.textcolor = CT_BLACK;
s_motdstuff.quitmenu.textcolor2 = CT_WHITE;
s_motdstuff.disconnect.generic.type = MTYPE_BITMAP;
s_motdstuff.disconnect.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.disconnect.generic.x = 350;
s_motdstuff.disconnect.generic.y = 440;
s_motdstuff.disconnect.generic.name = GRAPHIC_BUTTONRIGHT;
s_motdstuff.disconnect.generic.id = ID_DISCONNECT;
s_motdstuff.disconnect.generic.callback = M_MotdMenu_Event;
s_motdstuff.disconnect.width = MENU_BUTTON_MED_WIDTH;
s_motdstuff.disconnect.height = MENU_BUTTON_MED_HEIGHT;
s_motdstuff.disconnect.color = CT_DKORANGE;
s_motdstuff.disconnect.color2 = CT_LTORANGE;
s_motdstuff.disconnect.textX = MENU_BUTTON_TEXT_X;
s_motdstuff.disconnect.textY = MENU_BUTTON_TEXT_Y;
s_motdstuff.disconnect.textEnum = MBT_INGAMELEAVE;
s_motdstuff.disconnect.textcolor = CT_BLACK;
s_motdstuff.disconnect.textcolor2 = CT_WHITE;
s_motdstuff.disconnect.generic.type = MTYPE_BITMAP;
s_motdstuff.disconnect.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.disconnect.generic.x = 350;
s_motdstuff.disconnect.generic.y = 440;
s_motdstuff.disconnect.generic.name = GRAPHIC_BUTTONRIGHT;
s_motdstuff.disconnect.generic.id = ID_DISCONNECT;
s_motdstuff.disconnect.generic.callback = M_MotdMenu_Event;
s_motdstuff.disconnect.width = MENU_BUTTON_MED_WIDTH;
s_motdstuff.disconnect.height = MENU_BUTTON_MED_HEIGHT;
s_motdstuff.disconnect.color = CT_DKORANGE;
s_motdstuff.disconnect.color2 = CT_LTORANGE;
s_motdstuff.disconnect.textX = MENU_BUTTON_TEXT_X;
s_motdstuff.disconnect.textY = MENU_BUTTON_TEXT_Y;
s_motdstuff.disconnect.textEnum = MBT_INGAMELEAVE;
s_motdstuff.disconnect.textcolor = CT_BLACK;
s_motdstuff.disconnect.textcolor2 = CT_WHITE;
s_motdstuff.arrowup.generic.type = MTYPE_BITMAP;
s_motdstuff.arrowup.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.arrowup.generic.x = 610;
s_motdstuff.arrowup.generic.y = 10;
s_motdstuff.arrowup.generic.name = "menu/common/arrow_up_16.tga";
s_motdstuff.arrowup.generic.id = ID_ARROWUP;
s_motdstuff.arrowup.generic.callback = M_MotdMenu_Event;
s_motdstuff.arrowup.width = 16;
s_motdstuff.arrowup.height = 16;
s_motdstuff.arrowup.color = CT_DKBLUE1;
s_motdstuff.arrowup.color2 = CT_LTBLUE1;
s_motdstuff.arrowup.textX = 0;
s_motdstuff.arrowup.textY = 0;
s_motdstuff.arrowup.textEnum = MBT_NONE;
s_motdstuff.arrowup.textcolor = CT_BLACK;
s_motdstuff.arrowup.textcolor2 = CT_WHITE;
s_motdstuff.arrowup.generic.type = MTYPE_BITMAP;
s_motdstuff.arrowup.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.arrowup.generic.x = 610;
s_motdstuff.arrowup.generic.y = 10;
s_motdstuff.arrowup.generic.name = "menu/common/arrow_up_16.tga";
s_motdstuff.arrowup.generic.id = ID_ARROWUP;
s_motdstuff.arrowup.generic.callback = M_MotdMenu_Event;
s_motdstuff.arrowup.width = 16;
s_motdstuff.arrowup.height = 16;
s_motdstuff.arrowup.color = CT_DKBLUE1;
s_motdstuff.arrowup.color2 = CT_LTBLUE1;
s_motdstuff.arrowup.textX = 0;
s_motdstuff.arrowup.textY = 0;
s_motdstuff.arrowup.textEnum = MBT_NONE;
s_motdstuff.arrowup.textcolor = CT_BLACK;
s_motdstuff.arrowup.textcolor2 = CT_WHITE;
s_motdstuff.arrowdwn.generic.type = MTYPE_BITMAP;
s_motdstuff.arrowdwn.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.arrowdwn.generic.x = 610;
s_motdstuff.arrowdwn.generic.y = 420;
s_motdstuff.arrowdwn.generic.name = "menu/common/arrow_dn_16.tga";
s_motdstuff.arrowdwn.generic.id = ID_ARROWDOWN;
s_motdstuff.arrowdwn.generic.callback = M_MotdMenu_Event;
s_motdstuff.arrowdwn.width = 16;
s_motdstuff.arrowdwn.height = 16;
s_motdstuff.arrowdwn.color = CT_DKBLUE1;
s_motdstuff.arrowdwn.color2 = CT_LTBLUE1;
s_motdstuff.arrowdwn.textX = 0;
s_motdstuff.arrowdwn.textY = 0;
s_motdstuff.arrowdwn.textEnum = MBT_NONE;
s_motdstuff.arrowdwn.textcolor = CT_BLACK;
s_motdstuff.arrowdwn.textcolor2 = CT_WHITE;
s_motdstuff.arrowdwn.generic.type = MTYPE_BITMAP;
s_motdstuff.arrowdwn.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_motdstuff.arrowdwn.generic.x = 610;
s_motdstuff.arrowdwn.generic.y = 420;
s_motdstuff.arrowdwn.generic.name = "menu/common/arrow_dn_16.tga";
s_motdstuff.arrowdwn.generic.id = ID_ARROWDOWN;
s_motdstuff.arrowdwn.generic.callback = M_MotdMenu_Event;
s_motdstuff.arrowdwn.width = 16;
s_motdstuff.arrowdwn.height = 16;
s_motdstuff.arrowdwn.color = CT_DKBLUE1;
s_motdstuff.arrowdwn.color2 = CT_LTBLUE1;
s_motdstuff.arrowdwn.textX = 0;
s_motdstuff.arrowdwn.textY = 0;
s_motdstuff.arrowdwn.textEnum = MBT_NONE;
s_motdstuff.arrowdwn.textcolor = CT_BLACK;
s_motdstuff.arrowdwn.textcolor2 = CT_WHITE;
Menu_AddItem( &s_motdstuff.menu, &s_motdstuff.quitmenu );
Menu_AddItem( &s_motdstuff.menu, &s_motdstuff.disconnect );
Menu_AddItem( &s_motdstuff.menu, &s_motdstuff.arrowup );
Menu_AddItem( &s_motdstuff.menu, &s_motdstuff.arrowdwn );
Menu_AddItem(&s_motdstuff.menu, &s_motdstuff.quitmenu);
Menu_AddItem(&s_motdstuff.menu, &s_motdstuff.disconnect);
Menu_AddItem(&s_motdstuff.menu, &s_motdstuff.arrowup);
Menu_AddItem(&s_motdstuff.menu, &s_motdstuff.arrowdwn);
UI_LogFuncEnd();
}
@ -243,13 +247,13 @@ void MotdMenu_Init( void )
MotdReset
===============
*/
void MotdReset( void )
void MotdReset(void)
{
UI_LogFuncBegin();
int32_t i;
motdtextnum = 0;
for ( i = 0; i < MAX_MOTD_LINES; ++i ) {
for (i = 0; i < MAX_MOTD_LINES; ++i) {
*motdtext[i] = '\0';
}
UI_LogFuncEnd();
@ -260,7 +264,7 @@ void MotdReset( void )
MotdReceiveLine
===============
*/
void MotdReceiveLine( const char *txt )
void MotdReceiveLine(const char *txt)
{
UI_LogFuncBegin();
Q_strncpyz(motdtext[motdtextnum], txt, sizeof (motdtext[motdtextnum]));
@ -273,23 +277,23 @@ void MotdReceiveLine( const char *txt )
UI_MotdMenu
===============
*/
void UI_MotdMenu( void )
void UI_MotdMenu(void)
{
UI_LogFuncBegin();
memset( &s_motdstuff, 0, sizeof( s_motdstuff ) );
memset(&s_motdstuff, 0, sizeof(s_motdstuff));
uis.menusp = 0;
uis.menusp = 0;
ingameFlag = qtrue;
ingameFlag = qtrue;
Mouse_Show();
Mouse_Show();
UI_MotdMenu_Cache();
UI_MotdMenu_Cache();
MotdMenu_Init();
MotdMenu_Init();
UI_PushMenu( &s_motdstuff.menu );
UI_PushMenu(&s_motdstuff.menu);
Menu_AdjustCursor( &s_motdstuff.menu, 1 );
Menu_AdjustCursor(&s_motdstuff.menu, 1);
UI_LogFuncEnd();
}

View file

@ -2,7 +2,7 @@
UI_msd.C
User interface trigger from within game
**********************************************************************/
**********************************************************************/
#include "ui_local.h"
#include "ui_logger.h"
@ -23,20 +23,22 @@ typedef struct //static
const char *model;
} msd_t;
msd_t s_msd;
msd_t s_msd;
//s_msd.maxhull
#define ID_QUIT 10
enum ui_msdIDs {
ID_QUIT = 10
};
void UI_msdMenu_Cache (void);
void UI_msdMenu_Cache(void);
/*
=================
M_msd_Event
=================
*/
static void M_msd_Event (void* ptr, int32_t notification)
static void M_msd_Event(void* ptr, int32_t notification)
{
UI_LogFuncBegin();
int32_t id;
@ -47,7 +49,7 @@ static void M_msd_Event (void* ptr, int32_t notification)
/*if ( notification != QM_ACTIVATED )
{
return;
return;
}*/
if ((id == ID_QUIT) && (notification == QM_ACTIVATED))
@ -60,9 +62,9 @@ static void M_msd_Event (void* ptr, int32_t notification)
msdMenu_Key
=================
*/
sfxHandle_t msdMenu_Key (int32_t key)
sfxHandle_t msdMenu_Key(int32_t key)
{
return ( Menu_DefaultKey( &s_msd.menu, key ) );
return (Menu_DefaultKey(&s_msd.menu, key));
}
extern qhandle_t leftRound;
@ -83,7 +85,7 @@ qhandle_t model;
M_msdMenu_Graphics
=================
*/
static void M_msdMenu_Graphics (void)
static void M_msdMenu_Graphics(void)
{
UI_LogFuncBegin();
/*Notes:
@ -99,189 +101,205 @@ static void M_msdMenu_Graphics (void)
*/
//menubitmap_s *holdDeck;
//int32_t i;
int32_t length,xTurboStart, lengthshield, lengthhull;
int32_t length, xTurboStart, lengthshield, lengthhull;
//int32_t numColor, roundColor;
// Draw the basic screen frame
// Upper corners
trap_R_SetColor( colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic( 20, 24, 64, 32, corner_ul_24_60); // Upper corner
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
UI_DrawHandlePic(20, 24, 64, 32, corner_ul_24_60); // Upper corner
// Lower corners
//colorTable[CT_VDKPURPLE2]
trap_R_SetColor( colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic( 20, 440, 64, 16, corner_ll_12_60); //
trap_R_SetColor(colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic(20, 440, 64, 16, corner_ll_12_60); //
xTurboStart = 604;
length = UI_ProportionalStringWidth( "MASTER SYSTEMS DISPLAY",UI_BIGFONT);
length = UI_ProportionalStringWidth("MASTER SYSTEMS DISPLAY", UI_BIGFONT);
length += 4;
// Upper half
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic( 79, 24, xTurboStart - (79 + length), PROP_BIG_HEIGHT, uis.whiteShader); // Top left line
UI_DrawHandlePic( 20, 60, 60, 40, uis.whiteShader); //
trap_R_SetColor( colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic( 20, 106, 60, 11, uis.whiteShader); //
if(s_msd.alertstate == 2){
UI_DrawHandlePic( 20, 123, 60, 250, redalert); // Alert Fade Red
}else if(s_msd.alertstate == 1){
UI_DrawHandlePic( 20, 123, 60, 250, yellowalert); // Alert Fade Yellow
}else if(s_msd.alertstate == 3){
UI_DrawHandlePic( 20, 123, 60, 250, bluealert); // Alert Fade Blue
}else{
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic( 20, 123, 60, 250, uis.whiteShader); // Left hand column
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic(79, 24, xTurboStart - (79 + length), PROP_BIG_HEIGHT, uis.whiteShader); // Top left line
UI_DrawHandlePic(20, 60, 60, 40, uis.whiteShader); //
trap_R_SetColor(colorTable[CT_DKPURPLE3]);
UI_DrawHandlePic(20, 106, 60, 11, uis.whiteShader); //
if (s_msd.alertstate == 2){
UI_DrawHandlePic(20, 123, 60, 250, redalert); // Alert Fade Red
}
else if (s_msd.alertstate == 1){
UI_DrawHandlePic(20, 123, 60, 250, yellowalert); // Alert Fade Yellow
}
else if (s_msd.alertstate == 3){
UI_DrawHandlePic(20, 123, 60, 250, bluealert); // Alert Fade Blue
}
else{
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic(20, 123, 60, 250, uis.whiteShader); // Left hand column
}
// Lower half
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 20, 380, 60, 70, uis.whiteShader); // Left Column
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(20, 380, 60, 70, uis.whiteShader); // Left Column
// Bottom line
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 69, 443, 287, 12, uis.whiteShader); //
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //colorTable[CT_DKGOLD1]
UI_DrawHandlePic(364, 443, 260, 12, uis.whiteShader); // Bottom line
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(69, 443, 287, 12, uis.whiteShader); //
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //colorTable[CT_DKGOLD1]
UI_DrawHandlePic(364, 443, 260, 12, uis.whiteShader); // Bottom line
if(s_msd.alertstate == 2)
UI_DrawProportionalString( xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_RED]);
else if(s_msd.alertstate == 1)
UI_DrawProportionalString( xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_YELLOW]);
else if(s_msd.alertstate == 3)
UI_DrawProportionalString( xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_BLUE]);
else
UI_DrawProportionalString( xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_WHITE]);
if (s_msd.alertstate == 2)
UI_DrawProportionalString(xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_RED]);
else if (s_msd.alertstate == 1)
UI_DrawProportionalString(xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_YELLOW]);
else if (s_msd.alertstate == 3)
UI_DrawProportionalString(xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_BLUE]);
else
UI_DrawProportionalString(xTurboStart, 24,
"MASTER SYSTEMS DISPLAY", UI_BIGFONT | UI_RIGHT, colorTable[CT_WHITE]);
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic( 607, 24, -16, 32, leftRound);
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //DKGOLD1
UI_DrawHandlePic(607, 24, -16, 32, leftRound);
// MSD Model
UI_DrawHandlePic( 100, 60, 500, 250, model);
UI_DrawHandlePic(100, 60, 500, 250, model);
// health Bars
lengthshield = (int32_t)(498 * s_msd.currshield / s_msd.maxshield);
lengthhull = (int32_t)(498 * s_msd.currhull / s_msd.maxhull);
trap_R_SetColor( colorTable[CT_BLACK] );
UI_DrawHandlePic( 100, 320, 500, 49, uis.whiteShader); //background
trap_R_SetColor( colorTable[CT_VDKBLUE1] );
trap_R_SetColor(colorTable[CT_BLACK]);
UI_DrawHandlePic(100, 320, 500, 49, uis.whiteShader); //background
trap_R_SetColor(colorTable[CT_VDKBLUE1]);
//trap_R_SetColor( colorTable[CT_VDKPURPLE2] );
UI_DrawHandlePic( 101, 321, 498, 23, uis.whiteShader); //Shield Bar BG
trap_R_SetColor( colorTable[CT_VDKRED1] );
UI_DrawHandlePic(101, 321, 498, 23, uis.whiteShader); //Shield Bar BG
trap_R_SetColor(colorTable[CT_VDKRED1]);
//trap_R_SetColor( colorTable[CT_VDKORANGE] );
UI_DrawHandlePic( 101, 345, 498, 23, uis.whiteShader); //Health Bar BG
UI_DrawHandlePic(101, 345, 498, 23, uis.whiteShader); //Health Bar BG
//Shield Bar
if(s_msd.shieldstate == 1){
trap_R_SetColor( colorTable[CT_DKBLUE1] );
UI_DrawHandlePic( 101, 321, lengthshield, 23, uis.whiteShader);
UI_DrawProportionalString(103, 323, va("Shields at %.1f Percent", (lengthshield / 4.98)), UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == 0){
UI_DrawProportionalString(103, 323, "Shields are on standby", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == -2){
UI_DrawProportionalString(103, 323, "Shields are offline", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == -1){
UI_DrawProportionalString(103, 323, "Shields are inoperable", UI_TINYFONT, colorTable[CT_MDGREY]);
if (s_msd.shieldstate == 1){
trap_R_SetColor(colorTable[CT_DKBLUE1]);
UI_DrawHandlePic(101, 321, lengthshield, 23, uis.whiteShader);
UI_DrawProportionalString(103, 323, va("Shields at %.1f Percent", (lengthshield / 4.98)), UI_TINYFONT, colorTable[CT_MDGREY]);
}
trap_R_SetColor( colorTable[CT_DKRED1] );
UI_DrawHandlePic( 101, 345, lengthhull, 23, uis.whiteShader); //Health Bar
else if (s_msd.shieldstate == 0){
UI_DrawProportionalString(103, 323, "Shields are on standby", UI_TINYFONT, colorTable[CT_MDGREY]);
}
else if (s_msd.shieldstate == -2){
UI_DrawProportionalString(103, 323, "Shields are offline", UI_TINYFONT, colorTable[CT_MDGREY]);
}
else if (s_msd.shieldstate == -1){
UI_DrawProportionalString(103, 323, "Shields are inoperable", UI_TINYFONT, colorTable[CT_MDGREY]);
}
trap_R_SetColor(colorTable[CT_DKRED1]);
UI_DrawHandlePic(101, 345, lengthhull, 23, uis.whiteShader); //Health Bar
UI_DrawProportionalString(103, 347, va("Structural Integity at %.1f Percent", (lengthhull / 4.98)), UI_TINYFONT, colorTable[CT_MDGREY]);
//Sub System indicators
//Shields
trap_R_SetColor( colorTable[CT_WHITE] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 100, 380, 90, 45, uis.whiteShader);
if(s_msd.shieldstate == 1){
trap_R_SetColor( colorTable[CT_GREEN] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 101, 381, 88, 43, uis.whiteShader);
trap_R_SetColor(colorTable[CT_WHITE]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(100, 380, 90, 45, uis.whiteShader);
if (s_msd.shieldstate == 1){
trap_R_SetColor(colorTable[CT_GREEN]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(101, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(101, 382, "Shields are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(101, 397, "online", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == 0){
trap_R_SetColor( colorTable[CT_YELLOW] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 101, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.shieldstate == 0){
trap_R_SetColor(colorTable[CT_YELLOW]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(101, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(101, 382, "Shields are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(101, 397, "on standby", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == -2){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 101, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.shieldstate == -2){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(101, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(101, 382, "Shields are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(101, 397, "offline", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.shieldstate == -1){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 101, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.shieldstate == -1){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(101, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(101, 382, "Shields are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(101, 397, "inoperable", UI_TINYFONT, colorTable[CT_MDGREY]);
}
}
//Warp Drive
trap_R_SetColor( colorTable[CT_WHITE] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 195, 380, 90, 45, uis.whiteShader);
if(s_msd.warpstate == 1){
trap_R_SetColor( colorTable[CT_GREEN] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 196, 381, 88, 43, uis.whiteShader);
trap_R_SetColor(colorTable[CT_WHITE]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(195, 380, 90, 45, uis.whiteShader);
if (s_msd.warpstate == 1){
trap_R_SetColor(colorTable[CT_GREEN]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(196, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(197, 382, "Warp Drive is", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(197, 397, "online", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.warpstate == 0){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 196, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.warpstate == 0){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(196, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(197, 382, "Warp Drive is", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(197, 397, "offline", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.warpstate == 2){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 196, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.warpstate == 2){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(196, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(197, 382, "Warp Core is", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(197, 397, "ejected", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.warpstate == -2){//-2, no info available
trap_R_SetColor( colorTable[CT_YELLOW] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 196, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.warpstate == -2){//-2, no info available
trap_R_SetColor(colorTable[CT_YELLOW]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(196, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(197, 382, "Warp-Core-ODN-", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(197, 397, "Update required", UI_TINYFONT, colorTable[CT_MDGREY]);
}
}
//Turbolift
trap_R_SetColor( colorTable[CT_WHITE] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 290, 380, 90, 45, uis.whiteShader);
if(s_msd.turbostate == 1){
trap_R_SetColor( colorTable[CT_GREEN] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 291, 381, 88, 43, uis.whiteShader);
trap_R_SetColor(colorTable[CT_WHITE]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(290, 380, 90, 45, uis.whiteShader);
if (s_msd.turbostate == 1){
trap_R_SetColor(colorTable[CT_GREEN]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(291, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(292, 382, "Turbolifts are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(292, 397, "online", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.turbostate == 0){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 291, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.turbostate == 0){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(291, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(292, 382, "Turbolifts are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(292, 397, "offline", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.turbostate == -2){//-2, no info available
trap_R_SetColor( colorTable[CT_YELLOW] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 291, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.turbostate == -2){//-2, no info available
trap_R_SetColor(colorTable[CT_YELLOW]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(291, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(292, 382, "Turbolift-ODN-", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(292, 397, "Update required", UI_TINYFONT, colorTable[CT_MDGREY]);
}
//Transporter
trap_R_SetColor( colorTable[CT_WHITE] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 385, 380, 90, 45, uis.whiteShader);
if(s_msd.transstate == 1){
trap_R_SetColor( colorTable[CT_GREEN] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 386, 381, 88, 43, uis.whiteShader);
trap_R_SetColor(colorTable[CT_WHITE]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(385, 380, 90, 45, uis.whiteShader);
if (s_msd.transstate == 1){
trap_R_SetColor(colorTable[CT_GREEN]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(386, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(387, 382, "Transporters are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(387, 397, "online", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.transstate == 0){
trap_R_SetColor( colorTable[CT_RED] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 386, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.transstate == 0){
trap_R_SetColor(colorTable[CT_RED]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(386, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(387, 382, "Transporters are", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(387, 397, "offline", UI_TINYFONT, colorTable[CT_MDGREY]);
} else if(s_msd.transstate == -2){//-2, no info available
trap_R_SetColor( colorTable[CT_YELLOW] ); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic( 386, 381, 88, 43, uis.whiteShader);
}
else if (s_msd.transstate == -2){//-2, no info available
trap_R_SetColor(colorTable[CT_YELLOW]); //colorTable[CT_VDKPURPLE2]
UI_DrawHandlePic(386, 381, 88, 43, uis.whiteShader);
UI_DrawProportionalString(386, 382, "Transporter-ODN-", UI_TINYFONT, colorTable[CT_MDGREY]);
UI_DrawProportionalString(387, 397, "Update required", UI_TINYFONT, colorTable[CT_MDGREY]);
}
}
UI_LogFuncEnd();
}
@ -296,8 +314,8 @@ static void msdMenu_Draw(void)
// Draw graphics particular to Main Menu
UI_LogFuncBegin();
M_msdMenu_Graphics();
Menu_Draw( &s_msd.menu );
Menu_Draw(&s_msd.menu);
UI_LogFuncEnd();
}
@ -306,8 +324,8 @@ static void msdMenu_Draw(void)
UI_msdMenu_Cache
===============
*/
void UI_msdMenu_Cache (void)
{
void UI_msdMenu_Cache(void)
{
UI_LogFuncBegin();
leftRound = trap_R_RegisterShaderNoMip("menu/common/halfroundl_24.tga");
corner_ul_24_60 = trap_R_RegisterShaderNoMip("menu/common/corner_ul_24_60.tga");
@ -332,34 +350,34 @@ msdMenu_Init
void msdMenu_Init(void)
{
UI_LogFuncBegin();
s_msd.menu.nitems = 0;
s_msd.menu.draw = msdMenu_Draw;
s_msd.menu.key = msdMenu_Key;
s_msd.menu.wrapAround = qtrue;
s_msd.menu.descX = MENU_DESC_X;
s_msd.menu.descY = MENU_DESC_Y;
s_msd.menu.titleX = MENU_TITLE_X;
s_msd.menu.titleY = MENU_TITLE_Y;
s_msd.menu.nitems = 0;
s_msd.menu.draw = msdMenu_Draw;
s_msd.menu.key = msdMenu_Key;
s_msd.menu.wrapAround = qtrue;
s_msd.menu.descX = MENU_DESC_X;
s_msd.menu.descY = MENU_DESC_Y;
s_msd.menu.titleX = MENU_TITLE_X;
s_msd.menu.titleY = MENU_TITLE_Y;
s_msd.quitmenu.generic.type = MTYPE_BITMAP;
s_msd.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_msd.quitmenu.generic.x = 490;
s_msd.quitmenu.generic.y = 380;
s_msd.quitmenu.generic.name = GRAPHIC_BUTTONLEFT;
s_msd.quitmenu.generic.id = ID_QUIT;
s_msd.quitmenu.generic.callback = M_msd_Event;
s_msd.quitmenu.width = MENU_BUTTON_MED_WIDTH-20;
s_msd.quitmenu.height = PROP_BIG_HEIGHT;
s_msd.quitmenu.color = CT_DKPURPLE1;
s_msd.quitmenu.color2 = CT_LTPURPLE1;
s_msd.quitmenu.textX = MENU_BUTTON_TEXT_X;
s_msd.quitmenu.textY = 12;
s_msd.quitmenu.textEnum = MBT_RETURNMENU;
s_msd.quitmenu.textcolor = CT_BLACK;
s_msd.quitmenu.textcolor2 = CT_WHITE;
s_msd.quitmenu.textStyle = UI_TINYFONT;
s_msd.quitmenu.generic.type = MTYPE_BITMAP;
s_msd.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_msd.quitmenu.generic.x = 490;
s_msd.quitmenu.generic.y = 380;
s_msd.quitmenu.generic.name = GRAPHIC_BUTTONLEFT;
s_msd.quitmenu.generic.id = ID_QUIT;
s_msd.quitmenu.generic.callback = M_msd_Event;
s_msd.quitmenu.width = MENU_BUTTON_MED_WIDTH - 20;
s_msd.quitmenu.height = PROP_BIG_HEIGHT;
s_msd.quitmenu.color = CT_DKPURPLE1;
s_msd.quitmenu.color2 = CT_LTPURPLE1;
s_msd.quitmenu.textX = MENU_BUTTON_TEXT_X;
s_msd.quitmenu.textY = 12;
s_msd.quitmenu.textEnum = MBT_RETURNMENU;
s_msd.quitmenu.textcolor = CT_BLACK;
s_msd.quitmenu.textcolor2 = CT_WHITE;
s_msd.quitmenu.textStyle = UI_TINYFONT;
Menu_AddItem( &s_msd.menu, &s_msd.quitmenu );
Menu_AddItem(&s_msd.menu, &s_msd.quitmenu);
UI_LogFuncEnd();
}
@ -371,7 +389,7 @@ UI_msdMenu
void UI_msdMenu(int32_t maxhull, int32_t currhull, int32_t maxshield, int32_t currshield, int32_t shieldstate, int32_t warpstate, int32_t turbostate, int32_t transstate, int32_t alertstate, char *model)
{
UI_LogFuncBegin();
memset( &s_msd, 0, sizeof( s_msd ) );
memset(&s_msd, 0, sizeof(s_msd));
s_msd.maxhull = maxhull;
s_msd.currhull = currhull;
@ -392,10 +410,10 @@ void UI_msdMenu(int32_t maxhull, int32_t currhull, int32_t maxshield, int32_t cu
UI_msdMenu_Cache();
msdMenu_Init();
msdMenu_Init();
UI_PushMenu( &s_msd.menu );
UI_PushMenu(&s_msd.menu);
Menu_AdjustCursor( &s_msd.menu, 1 );
Menu_AdjustCursor(&s_msd.menu, 1);
UI_LogFuncEnd();
}

View file

@ -11,23 +11,25 @@ NETWORK OPTIONS MENU
#include "ui_local.h"
#include "ui_logger.h"
#define ID_GRAPHICS 10
#define ID_DISPLAY 11
#define ID_SOUND 12
#define ID_NETWORK 13
#define ID_RATE 14
#define ID_BACK 15
enum ui_networkIDs_e {
ID_GRAPHICS = 10,
ID_DISPLAY,
ID_SOUND,
ID_NETWORK,
ID_RATE,
ID_BACK
};
/*
static const char *rate_items[] = {
"<= 28.8K",
"33.6K",
"56K",
"ISDN",
"LAN/Cable/xDSL",
0
"<= 28.8K",
"33.6K",
"56K",
"ISDN",
"LAN/Cable/xDSL",
0
};
*/
int32_t rate_items[] =
{
@ -40,7 +42,7 @@ int32_t rate_items[] =
};
typedef struct
typedef struct
{
menuframework_s menu;
@ -58,16 +60,16 @@ static networkOptionsInfo_t networkOptionsInfo;
UI_NetworkOptionsMenu_Event
=================
*/
static void UI_NetworkOptionsMenu_Event( void* ptr, int32_t event )
static void UI_NetworkOptionsMenu_Event(void* ptr, int32_t event)
{
UI_LogFuncBegin();
if( event != QM_ACTIVATED )
if (event != QM_ACTIVATED)
{
UI_LogFuncEnd();
return;
}
switch( ((menucommon_s*)ptr)->id )
switch (((menucommon_s*)ptr)->id)
{
case ID_GRAPHICS:
UI_PopMenu();
@ -81,32 +83,32 @@ static void UI_NetworkOptionsMenu_Event( void* ptr, int32_t event )
case ID_SOUND:
UI_PopMenu();
// UI_SoundOptionsMenu();
// UI_SoundOptionsMenu();
break;
case ID_NETWORK:
break;
case ID_RATE:
if( networkOptionsInfo.rate.curvalue == 0 )
if (networkOptionsInfo.rate.curvalue == 0)
{
trap_Cvar_SetValue( "rate", 2500 );
trap_Cvar_SetValue("rate", 2500);
}
else if( networkOptionsInfo.rate.curvalue == 1 )
else if (networkOptionsInfo.rate.curvalue == 1)
{
trap_Cvar_SetValue( "rate", 3000 );
trap_Cvar_SetValue("rate", 3000);
}
else if( networkOptionsInfo.rate.curvalue == 2 )
else if (networkOptionsInfo.rate.curvalue == 2)
{
trap_Cvar_SetValue( "rate", 4000 );
trap_Cvar_SetValue("rate", 4000);
}
else if( networkOptionsInfo.rate.curvalue == 3 )
else if (networkOptionsInfo.rate.curvalue == 3)
{
trap_Cvar_SetValue( "rate", 5000 );
trap_Cvar_SetValue("rate", 5000);
}
else if( networkOptionsInfo.rate.curvalue == 4 )
else if (networkOptionsInfo.rate.curvalue == 4)
{
trap_Cvar_SetValue( "rate", 25000 );
trap_Cvar_SetValue("rate", 25000);
}
break;
@ -120,43 +122,43 @@ static void UI_NetworkOptionsMenu_Event( void* ptr, int32_t event )
M_NetworkMenu_Graphics
=================
*/
void M_NetworkMenu_Graphics (void)
void M_NetworkMenu_Graphics(void)
{
UI_LogFuncBegin();
UI_MenuFrame(&networkOptionsInfo.menu);
UI_Setup_MenuButtons();
UI_DrawProportionalString( 74, 66, "925",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 84, "88PK",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 188, "8125",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 206, "358677",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString( 74, 395, "3-679",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 66, "925", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 84, "88PK", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 188, "8125", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 206, "358677", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
UI_DrawProportionalString(74, 395, "3-679", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
// Rest of Bottom1_Graphics
trap_R_SetColor( colorTable[CT_LTBROWN1]);
UI_DrawHandlePic( 30, 203, 47, 69, uis.whiteShader); // Top Left column above
UI_DrawHandlePic( 30, 275, 47, 66, uis.whiteShader); // Top Left column middle
UI_DrawHandlePic( 30, 344, 47, 45, uis.whiteShader); // Top Left column below
trap_R_SetColor(colorTable[CT_LTBROWN1]);
UI_DrawHandlePic(30, 203, 47, 69, uis.whiteShader); // Top Left column above
UI_DrawHandlePic(30, 275, 47, 66, uis.whiteShader); // Top Left column middle
UI_DrawHandlePic(30, 344, 47, 45, uis.whiteShader); // Top Left column below
// Brackets around Video Data
trap_R_SetColor( colorTable[CT_LTPURPLE1]);
UI_DrawHandlePic(158,163, 16, 16, uis.graphicBracket1CornerLU);
UI_DrawHandlePic(158,179, 8, 233, uis.whiteShader);
UI_DrawHandlePic(158,412, 16, -16, uis.graphicBracket1CornerLU); //LD
trap_R_SetColor(colorTable[CT_LTPURPLE1]);
UI_DrawHandlePic(158, 163, 16, 16, uis.graphicBracket1CornerLU);
UI_DrawHandlePic(158, 179, 8, 233, uis.whiteShader);
UI_DrawHandlePic(158, 412, 16, -16, uis.graphicBracket1CornerLU); //LD
UI_DrawHandlePic(174,163, 320, 8, uis.whiteShader); // Top line
UI_DrawHandlePic(174, 163, 320, 8, uis.whiteShader); // Top line
UI_DrawHandlePic(494,163, 128, 128, networkOptionsInfo.swooshTop); // Top swoosh
UI_DrawHandlePic(494, 163, 128, 128, networkOptionsInfo.swooshTop); // Top swoosh
UI_DrawHandlePic(501,188, 110, 54, uis.whiteShader); // Top right column
UI_DrawHandlePic(501,245, 110, 100, uis.whiteShader); // Middle right column
UI_DrawHandlePic(501,348, 110, 55, uis.whiteShader); // Bottom right column
UI_DrawHandlePic(501, 188, 110, 54, uis.whiteShader); // Top right column
UI_DrawHandlePic(501, 245, 110, 100, uis.whiteShader); // Middle right column
UI_DrawHandlePic(501, 348, 110, 55, uis.whiteShader); // Bottom right column
UI_DrawHandlePic(494,406, 128, 128, networkOptionsInfo.swooshBottom); // Bottom swoosh
UI_DrawHandlePic(494, 406, 128, 128, networkOptionsInfo.swooshBottom); // Bottom swoosh
UI_DrawHandlePic(174,420, 320, 8, uis.whiteShader); // Bottom line
UI_DrawHandlePic(174, 420, 320, 8, uis.whiteShader); // Bottom line
UI_LogFuncEnd();
}
@ -166,12 +168,12 @@ void M_NetworkMenu_Graphics (void)
Network_MenuDraw
=================
*/
static void Network_MenuDraw (void)
static void Network_MenuDraw(void)
{
UI_LogFuncBegin();
M_NetworkMenu_Graphics();
Menu_Draw( &networkOptionsInfo.menu );
Menu_Draw(&networkOptionsInfo.menu);
UI_LogFuncEnd();
}
@ -180,68 +182,68 @@ static void Network_MenuDraw (void)
UI_NetworkOptionsMenu_Init
===============
*/
static void UI_NetworkOptionsMenu_Init( void )
static void UI_NetworkOptionsMenu_Init(void)
{
UI_LogFuncBegin();
int32_t rate;
memset( &networkOptionsInfo, 0, sizeof(networkOptionsInfo) );
memset(&networkOptionsInfo, 0, sizeof(networkOptionsInfo));
UI_NetworkOptionsMenu_Cache();
networkOptionsInfo.menu.nitems = 0;
networkOptionsInfo.menu.wrapAround = qtrue;
networkOptionsInfo.menu.draw = Network_MenuDraw;
networkOptionsInfo.menu.fullscreen = qtrue;
networkOptionsInfo.menu.descX = MENU_DESC_X;
networkOptionsInfo.menu.descY = MENU_DESC_Y;
networkOptionsInfo.menu.listX = 230;
networkOptionsInfo.menu.listY = 188;
networkOptionsInfo.menu.titleX = MENU_TITLE_X;
networkOptionsInfo.menu.titleY = MENU_TITLE_Y;
networkOptionsInfo.menu.titleI = MNT_CONTROLSMENU_TITLE;
networkOptionsInfo.menu.footNoteEnum = MNT_NETWORKSETUP;
networkOptionsInfo.menu.nitems = 0;
networkOptionsInfo.menu.wrapAround = qtrue;
networkOptionsInfo.menu.draw = Network_MenuDraw;
networkOptionsInfo.menu.fullscreen = qtrue;
networkOptionsInfo.menu.descX = MENU_DESC_X;
networkOptionsInfo.menu.descY = MENU_DESC_Y;
networkOptionsInfo.menu.listX = 230;
networkOptionsInfo.menu.listY = 188;
networkOptionsInfo.menu.titleX = MENU_TITLE_X;
networkOptionsInfo.menu.titleY = MENU_TITLE_Y;
networkOptionsInfo.menu.titleI = MNT_CONTROLSMENU_TITLE;
networkOptionsInfo.menu.footNoteEnum = MNT_NETWORKSETUP;
SetupMenu_TopButtons(&networkOptionsInfo.menu,MENU_NETWORK,NULL);
SetupMenu_TopButtons(&networkOptionsInfo.menu, MENU_NETWORK, NULL);
networkOptionsInfo.rate.generic.type = MTYPE_SPINCONTROL;
networkOptionsInfo.rate.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rate.generic.x = 212;
networkOptionsInfo.rate.generic.y = 262;
networkOptionsInfo.rate.textEnum = MBT_DATARATE;
networkOptionsInfo.rate.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rate.generic.id = ID_RATE;
networkOptionsInfo.rate.textcolor = CT_BLACK;
networkOptionsInfo.rate.textcolor2 = CT_WHITE;
networkOptionsInfo.rate.color = CT_DKPURPLE1;
networkOptionsInfo.rate.color2 = CT_LTPURPLE1;
networkOptionsInfo.rate.textX = 5;
networkOptionsInfo.rate.textY = 2;
networkOptionsInfo.rate.listnames = rate_items;
networkOptionsInfo.rate.generic.type = MTYPE_SPINCONTROL;
networkOptionsInfo.rate.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
networkOptionsInfo.rate.generic.x = 212;
networkOptionsInfo.rate.generic.y = 262;
networkOptionsInfo.rate.textEnum = MBT_DATARATE;
networkOptionsInfo.rate.generic.callback = UI_NetworkOptionsMenu_Event;
networkOptionsInfo.rate.generic.id = ID_RATE;
networkOptionsInfo.rate.textcolor = CT_BLACK;
networkOptionsInfo.rate.textcolor2 = CT_WHITE;
networkOptionsInfo.rate.color = CT_DKPURPLE1;
networkOptionsInfo.rate.color2 = CT_LTPURPLE1;
networkOptionsInfo.rate.textX = 5;
networkOptionsInfo.rate.textY = 2;
networkOptionsInfo.rate.listnames = rate_items;
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate );
Menu_AddItem(&networkOptionsInfo.menu, (void *)&networkOptionsInfo.rate);
rate = trap_Cvar_VariableValue( "rate" );
if( rate <= 2500 )
rate = trap_Cvar_VariableValue("rate");
if (rate <= 2500)
{
networkOptionsInfo.rate.curvalue = 0;
}
else if( rate <= 3000 )
else if (rate <= 3000)
{
networkOptionsInfo.rate.curvalue = 1;
}
else if( rate <= 4000 )
else if (rate <= 4000)
{
networkOptionsInfo.rate.curvalue = 2;
}
else if( rate <= 5000 )
else if (rate <= 5000)
{
networkOptionsInfo.rate.curvalue = 3;
}
else
else
{
networkOptionsInfo.rate.curvalue = 4;
}
@ -254,11 +256,11 @@ static void UI_NetworkOptionsMenu_Init( void )
UI_NetworkOptionsMenu_Cache
===============
*/
void UI_NetworkOptionsMenu_Cache( void )
void UI_NetworkOptionsMenu_Cache(void)
{
UI_LogFuncBegin();
networkOptionsInfo.swooshTop = trap_R_RegisterShaderNoMip("menu/common/swoosh_top.tga");
networkOptionsInfo.swooshBottom= trap_R_RegisterShaderNoMip("menu/common/swoosh_bottom.tga");
networkOptionsInfo.swooshBottom = trap_R_RegisterShaderNoMip("menu/common/swoosh_bottom.tga");
UI_LogFuncEnd();
}
@ -268,12 +270,12 @@ void UI_NetworkOptionsMenu_Cache( void )
UI_NetworkOptionsMenu
===============
*/
void UI_NetworkOptionsMenu( void )
void UI_NetworkOptionsMenu(void)
{
UI_LogFuncBegin();
UI_NetworkOptionsMenu_Init();
UI_PushMenu( &networkOptionsInfo.menu );
UI_PushMenu(&networkOptionsInfo.menu);
UI_LogFuncEnd();
}

File diff suppressed because it is too large Load diff