mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-04-19 07:21:12 +00:00
update to various ui_*.c files
This commit is contained in:
parent
c3dd592c86
commit
2341196c1b
7 changed files with 5044 additions and 5033 deletions
|
@ -10,118 +10,121 @@
|
|||
#include "ui_local.h"
|
||||
#include "ui_logger.h"
|
||||
|
||||
#define MAX_DEVS 15 //Max number of developers per menu
|
||||
#define MAX_MENUS 9 //Max number of menus
|
||||
enum ui_creditsLimits_e {
|
||||
MAX_MENUS = 9, //Max number of menus
|
||||
MAX_DEVS = 15 //Max number of developers per menu
|
||||
};
|
||||
|
||||
//Just to be on the safe side, I made these increment from 1 rather than 0
|
||||
//and then compensated in the code. :)
|
||||
#define ID_LEADS 1
|
||||
#define ID_CODERS 2
|
||||
#define ID_2D 3
|
||||
#define ID_3D 4
|
||||
#define ID_MAPPING 5
|
||||
#define ID_SOUNDS 6
|
||||
#define ID_EXTRAS 7
|
||||
#define ID_BETAS 8
|
||||
#define ID_THANKS 9
|
||||
#define ID_MAINMENU 100
|
||||
enum ui_creditsIDs_e {
|
||||
ID_LEADS = 1,
|
||||
ID_CODERS,
|
||||
ID_2D,
|
||||
ID_3D,
|
||||
ID_MAPPING,
|
||||
ID_SOUNDS,
|
||||
ID_EXTRAS,
|
||||
ID_BETAS,
|
||||
ID_THANKS,
|
||||
ID_MAINMENU = 100
|
||||
};
|
||||
|
||||
#define MAIN_LOGO_MODEL "models/mapobjects/rpg-x/logo.md3"
|
||||
#define LCARS_CORNER_U "menu/common/corner_lr_7_12.tga"
|
||||
#define LCARS_LOGO_BACKDROP "menu/rpgx_credits/logo_backdrop"
|
||||
#define LCARS_BLIP "sound/interface/button7.wav"
|
||||
static const char MAIN_LOGO_MODEL[] = "models/mapobjects/rpg-x/logo.md3";
|
||||
static const char LCARS_CORNER_U[] = "menu/common/corner_lr_7_12.tga";
|
||||
static const char LCARS_LOGO_BACKDROP[] = "menu/rpgx_credits/logo_backdrop";
|
||||
static const char LCARS_BLIP[] = "sound/interface/button7.wav";
|
||||
|
||||
//----------------------------------------------------------------
|
||||
//TiM : In order to lower memory by recycling any repeated names
|
||||
|
||||
//Developer Names
|
||||
#define NAME_PHENIX "Dominic 'Phenix' Black"
|
||||
#define NAME_JAY "Jason 'J2J' Griffith"
|
||||
#define NAME_SHARKY "Nazar 'Sharky' Surmai"
|
||||
#define NAME_RED "Stephen 'RedTechie' Shamakian"
|
||||
#define NAME_TIM "Timothy 'TiM' Oliver"
|
||||
#define NAME_SCOOTER "Scooter"
|
||||
#define NAME_MARCIN "Marcin 'turbomarcin' Koziuk"
|
||||
#define NAME_WILL "William Riker"
|
||||
#define NAME_ANT "Anthony"
|
||||
#define NAME_TDP "The Dark Project"
|
||||
static const char NAME_PHENIX[] = "Dominic 'Phenix' Black";
|
||||
static const char NAME_JAY[] = "Jason 'J2J' Griffith";
|
||||
static const char NAME_SHARKY[] = "Nazar 'Sharky' Surmai";
|
||||
static const char NAME_RED[] = "Stephen 'RedTechie' Shamakian";
|
||||
static const char NAME_TIM[] = "Timothy 'TiM' Oliver";
|
||||
static const char NAME_SCOOTER[] = "Scooter";
|
||||
static const char NAME_MARCIN[] = "Marcin 'turbomarcin' Koziuk";
|
||||
static const char NAME_GSIO01[] = "Walter 'GSIO01' Hennecke";
|
||||
static const char NAME_YOUNG[] = "Hendrik 'Harry Young' Gerritzen";
|
||||
static const char NAME_WILL[] = "William Riker";
|
||||
static const char NAME_ANT[] = "Anthony";
|
||||
static const char NAME_TDP[] = "The Dark Project";
|
||||
|
||||
//#define NAME_DI "Digital Intervention" //TiM: DI is the brand I put all of my high-end 3D artwork under now as standardiazation for client work. :)
|
||||
|
||||
#define NAME_SIMMO "Tom 'Simmo666' Simpson"
|
||||
#define NAME_KURO "Kuro-chan" //Kare to kare no nihongo no na dazo lol. :P
|
||||
static const char NAME_SIMMO[] = "Tom 'Simmo666' Simpson";
|
||||
static const char NAME_KURO[] = "Kuro-chan"; //Kare to kare no nihongo no na dazo lol. :P
|
||||
|
||||
#define NAME_JAREN "Jaren"
|
||||
static const char NAME_JAREN[] = "Jaren";
|
||||
|
||||
#define NAME_MONROE "James 'Emorog' Monroe"
|
||||
#define NAME_GENE "Gene Roddenberry"
|
||||
#define NAME_RAVEN "Raven Software"
|
||||
#define NAME_EFPEEPS "The EF RPG Community"
|
||||
#define NAME_STEVE "Steve" //Never even met this d00d lol
|
||||
#define NAME_GSIO01 "Walter 'GSIO01' Hennecke"
|
||||
static const char NAME_MONROE[] = "James 'Emorog' Monroe";
|
||||
static const char NAME_GENE[] = "Gene Roddenberry";
|
||||
static const char NAME_RAVEN[] = "Raven Software";
|
||||
static const char NAME_EFPEEPS[] = "The EF RPG Community";
|
||||
static const char NAME_STEVE[] = "Steve"; //Never even met this d00d lol
|
||||
|
||||
#define NAME_JEROEN "Jeroen"
|
||||
|
||||
#define NAME_LAZ "Laz Rojas"
|
||||
static const char NAME_JEROEN[] = "Jeroen";
|
||||
|
||||
#define NAME_PARKER "Chris 'Parker' Vad"
|
||||
#define NAME_HOCKING "AdmiralHocking"
|
||||
static const char NAME_LAZ[] = "Laz Rojas";
|
||||
|
||||
#define NAME_YOUNG "Hendrik 'Harry Young' Gerritzen"
|
||||
static const char NAME_PARKER[] = "Chris 'Parker' Vad";
|
||||
static const char NAME_HOCKING[] = "AdmiralHocking";
|
||||
|
||||
//Developer Uber professional sounding titles
|
||||
#define TITLE_LEADER "Project Lead"
|
||||
#define TITLE_LPROG "Lead Coding"
|
||||
#define TITLE_L2DAS "Lead 2-D & Audio Art"
|
||||
#define TITLE_L3D "Lead 3-D Art"
|
||||
#define TITLE_LMAPPER "Lead Level Design"
|
||||
#define TITLE_LLUA "Lead Lua Coding"
|
||||
static const char TITLE_LEADER[] = "Project Lead";
|
||||
static const char TITLE_LPROG[] = "Lead Coding";
|
||||
static const char TITLE_L2DAS[] = "Lead 2-D & Audio Art";
|
||||
static const char TITLE_L3D[] = "Lead 3-D Art";
|
||||
static const char TITLE_LMAPPER[] = "Lead Level Design";
|
||||
static const char TITLE_LLUA[] = "Lead Lua Coding";
|
||||
|
||||
//Programming titles
|
||||
#define TITLE_PROG "Primary Coding"
|
||||
#define TITLE_GPROG "Graphics Coding"
|
||||
#define TITLE_ADPROG "Additional Coding"
|
||||
//#define TITLE_SCRIPTING "Player Scripting"
|
||||
static const char TITLE_PROG[] = "Primary Coding";
|
||||
static const char TITLE_GPROG[] = "Graphics Coding";
|
||||
static const char TITLE_ADPROG[] = "Additional Coding";
|
||||
|
||||
//2-D Titles
|
||||
#define TITLE_L2D "Lead 2-D Art"
|
||||
#define TITLE_LCARS "Secondary 2-D Art / LCARS Design" //Simmo special lol
|
||||
#define TITLE_AD2D "Additional 2-D Art"
|
||||
#define TITLE_RANKS "Menu Rank Icons Creation" // Kuro special
|
||||
#define TITLE_ACAI "Additional Coding / Many ideas"
|
||||
static const char TITLE_L2D[] = "Lead 2-D Art";
|
||||
static const char TITLE_LCARS[] = "Secondary 2-D Art / LCARS Design"; //Simmo special lol
|
||||
static const char TITLE_AD2D[] = "Additional 2-D Art";
|
||||
static const char TITLE_RANKS[] = "Menu Rank Icons Creation"; // Kuro special
|
||||
static const char TITLE_ACAI[] = "Additional Coding / Many ideas";
|
||||
|
||||
//3-D Titles... none O_O
|
||||
|
||||
//Mapping titles
|
||||
#define TITLE_LEVELART "Level Design"
|
||||
#define TITLE_LUAENH "Lua Level Enhancement"
|
||||
static const char TITLE_LEVELART[] = "Level Design";
|
||||
static const char TITLE_LUAENH[] = "Lua Level Enhancement";
|
||||
|
||||
//Audio Titles
|
||||
#define TITLE_LAUDIO "Audio Lead"
|
||||
#define TITLE_ADAUDIO "Additional Audio"
|
||||
static const char TITLE_LAUDIO[] = "Audio Lead";
|
||||
static const char TITLE_ADAUDIO[] = "Additional Audio";
|
||||
|
||||
//Additional Titles
|
||||
#define TITLE_CANON "Canon Inspector" //Scooter... and only Scooter hehe
|
||||
#define TITLE_DOCU "Documentation"
|
||||
#define TITLE_DEUTSCH "German Translation"
|
||||
#define TITLE_NEDERLANDS "Dutch Translation"
|
||||
static const char TITLE_CANON[] = "Canon Inspector";//Scooter... and only Scooter hehe
|
||||
static const char TITLE_DOCU[] = "Documentation";
|
||||
static const char TITLE_DEUTSCH[] = "German Translation";
|
||||
static const char TITLE_NEDERLANDS[] = "Dutch Translation";
|
||||
|
||||
//#define TITLE_CIN "Opening Cinematic"
|
||||
#define TITLE_SKINSMODELS "Providing Additional Skins and Models"
|
||||
static const char TITLE_SKINSMODELS[] = "Providing Additional Skins and Models";
|
||||
|
||||
//Thank you Titles
|
||||
#define TITLE_TREK "Creator of Star Trek"
|
||||
#define TITLE_EF "Creators of Elite Force"
|
||||
#define TITLE_TEST "For Suggestions and Additional Testing"
|
||||
#define TITLE_PLAGIA "Creator of the original EF RPG Mod"
|
||||
#define TITLE_RAVENCODER "EF Engine Consulting and Assistance"
|
||||
static const char TITLE_TREK[] = "Creator of Star Trek";
|
||||
static const char TITLE_EF[] = "Creators of Elite Force";
|
||||
static const char TITLE_TEST[] = "For Suggestions and Additional Testing";
|
||||
static const char TITLE_PLAGIA[] = "Creator of the original EF RPG Mod";
|
||||
static const char TITLE_RAVENCODER[] = "EF Engine Consulting and Assistance";
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
static qhandle_t cornerUpper;
|
||||
static qhandle_t spaceBackdrop;
|
||||
|
||||
int32_t i;
|
||||
static int32_t i;
|
||||
|
||||
static float cm_buttons[9][2] =
|
||||
{
|
||||
|
@ -166,8 +169,8 @@ static credits_t s_credits;
|
|||
|
||||
typedef struct
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
char position[MAX_QPATH];
|
||||
const char* name;
|
||||
const char* position;
|
||||
} devInfo_t;
|
||||
|
||||
typedef struct
|
||||
|
@ -185,6 +188,7 @@ static creditsInfo_t creditsInfo[MAX_MENUS] =
|
|||
"PROJECT LEADS",
|
||||
{
|
||||
{ NAME_PHENIX, TITLE_LEADER },
|
||||
{ NAME_GSIO01, TITLE_LEADER },
|
||||
{ NAME_JAY, TITLE_LPROG },
|
||||
{ NAME_SHARKY, TITLE_L2DAS },
|
||||
{ NAME_TIM, TITLE_L3D },
|
||||
|
@ -197,12 +201,12 @@ static creditsInfo_t creditsInfo[MAX_MENUS] =
|
|||
"PROGRAMMING",
|
||||
{
|
||||
{ NAME_JAY, TITLE_LPROG },
|
||||
{ NAME_GSIO01, TITLE_LPROG },
|
||||
{ NAME_TIM, TITLE_PROG },
|
||||
{ NAME_PHENIX, TITLE_PROG },
|
||||
{ NAME_RED, TITLE_ADPROG },
|
||||
{ NAME_MARCIN, TITLE_PROG }, // Scooter was originally here...sorry... not enough space!
|
||||
{ NAME_RED, TITLE_ADPROG },
|
||||
//{ NAME_SCOOTER, TITLE_ADPROG }, //one had to go.
|
||||
{ NAME_GSIO01, TITLE_PROG },
|
||||
{ NAME_YOUNG, TITLE_LLUA }
|
||||
}
|
||||
},
|
||||
|
@ -317,10 +321,10 @@ static creditsInfo_t creditsInfo[MAX_MENUS] =
|
|||
{
|
||||
"SPECIAL THANKS",
|
||||
{
|
||||
{ NAME_GENE, TITLE_TREK },
|
||||
{ NAME_RAVEN, TITLE_EF },
|
||||
{ NAME_GENE, TITLE_TREK },
|
||||
{ NAME_RAVEN, TITLE_EF },
|
||||
{ NAME_EFPEEPS, TITLE_TEST },
|
||||
{ NAME_STEVE, TITLE_PLAGIA },
|
||||
{ NAME_STEVE, TITLE_PLAGIA },
|
||||
{ NAME_MONROE, TITLE_RAVENCODER }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,32 +12,36 @@ DEMOS MENU
|
|||
#include "ui_local.h"
|
||||
#include "ui_logger.h"
|
||||
|
||||
enum ui_Demo2Limits_e {
|
||||
MAX_DEMODISP = 12,
|
||||
MAX_DEMOS = 128,
|
||||
NAMEBUFSIZE = (MAX_DEMOS * 16)
|
||||
};
|
||||
|
||||
#define MAX_DEMOS 128
|
||||
#define NAMEBUFSIZE ( MAX_DEMOS * 16 )
|
||||
enum ui_Demo2IDs_e {
|
||||
ID_MAINMENU = 10,
|
||||
ID_ENGAGE,
|
||||
ID_LIST,
|
||||
ID_UP,
|
||||
ID_DOWN,
|
||||
|
||||
#define ID_MAINMENU 10
|
||||
#define ID_ENGAGE 11
|
||||
#define ID_LIST 12
|
||||
#define ID_UP 13
|
||||
#define ID_DOWN 14
|
||||
ID_DEMOCOMMENT1 = 110,
|
||||
ID_DEMOCOMMENT2,
|
||||
ID_DEMOCOMMENT3,
|
||||
ID_DEMOCOMMENT4,
|
||||
ID_DEMOCOMMENT5,
|
||||
ID_DEMOCOMMENT6,
|
||||
ID_DEMOCOMMENT7,
|
||||
ID_DEMOCOMMENT8,
|
||||
ID_DEMOCOMMENT9,
|
||||
ID_DEMOCOMMENT10,
|
||||
ID_DEMOCOMMENT11,
|
||||
ID_DEMOCOMMENT12
|
||||
};
|
||||
|
||||
#define ID_DEMOCOMMENT1 110
|
||||
#define ID_DEMOCOMMENT2 111
|
||||
#define ID_DEMOCOMMENT3 112
|
||||
#define ID_DEMOCOMMENT4 113
|
||||
#define ID_DEMOCOMMENT5 114
|
||||
#define ID_DEMOCOMMENT6 115
|
||||
#define ID_DEMOCOMMENT7 116
|
||||
#define ID_DEMOCOMMENT8 117
|
||||
#define ID_DEMOCOMMENT9 118
|
||||
#define ID_DEMOCOMMENT10 119
|
||||
#define ID_DEMOCOMMENT11 120
|
||||
#define ID_DEMOCOMMENT12 121
|
||||
static const char PIC_UNDERLINE[] = "menu/common/underline.tga";
|
||||
|
||||
#define PIC_UNDERLINE "menu/common/underline.tga"
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
|
||||
|
@ -80,22 +84,20 @@ menufield_s s_demoline10;
|
|||
menufield_s s_demoline11;
|
||||
menufield_s s_demoline12;
|
||||
|
||||
#define MAX_DEMODISP 12
|
||||
|
||||
static void* g_demoline[] =
|
||||
{
|
||||
&s_demoline1,
|
||||
&s_demoline2,
|
||||
&s_demoline3,
|
||||
&s_demoline4,
|
||||
&s_demoline5,
|
||||
&s_demoline6,
|
||||
&s_demoline7,
|
||||
&s_demoline8,
|
||||
&s_demoline9,
|
||||
&s_demoline10,
|
||||
&s_demoline11,
|
||||
&s_demoline12,
|
||||
&s_demoline1,
|
||||
&s_demoline2,
|
||||
&s_demoline3,
|
||||
&s_demoline4,
|
||||
&s_demoline5,
|
||||
&s_demoline6,
|
||||
&s_demoline7,
|
||||
&s_demoline8,
|
||||
&s_demoline9,
|
||||
&s_demoline10,
|
||||
&s_demoline11,
|
||||
&s_demoline12,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
@ -107,11 +109,11 @@ array with the current list
|
|||
of demos we have
|
||||
=================
|
||||
*/
|
||||
void DemoMenu_PopulateList ( int32_t startingIndex ) {
|
||||
void DemoMenu_PopulateList(int32_t startingIndex) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t i=0, len;
|
||||
int32_t i = 0, len;
|
||||
char* demoName;
|
||||
|
||||
|
||||
while (g_demoline[i])
|
||||
{
|
||||
if (i >= s_demos.list.numitems)
|
||||
|
@ -119,34 +121,34 @@ void DemoMenu_PopulateList ( int32_t startingIndex ) {
|
|||
break;
|
||||
}
|
||||
|
||||
demoName = s_demos.demolist[startingIndex+i];
|
||||
demoName = s_demos.demolist[startingIndex + i];
|
||||
|
||||
//TiM - Error trapping. Altho this should never happen
|
||||
if ( !demoName ) {
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE|QMF_HIDDEN;
|
||||
if (!demoName) {
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE | QMF_HIDDEN;
|
||||
continue;
|
||||
}
|
||||
|
||||
// No demos???
|
||||
if (s_demos.list.numitems == 1)
|
||||
{
|
||||
if (!strcmp( demoName, menu_normal_text[MNT_NO_DEMOS_FOUND]))
|
||||
if (!strcmp(demoName, menu_normal_text[MNT_NO_DEMOS_FOUND]))
|
||||
{
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE;
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
// strip extension
|
||||
len = strlen( demoName );
|
||||
if ( len>7 && !Q_stricmp(demoName + len - 7,".efdemo"))
|
||||
len = strlen(demoName);
|
||||
if (len > 7 && !Q_stricmp(demoName + len - 7, ".efdemo"))
|
||||
{
|
||||
demoName[len-7] = '\0';
|
||||
demoName[len - 7] = '\0';
|
||||
}
|
||||
|
||||
Q_strupr(demoName);
|
||||
|
||||
((menubitmap_s *)g_demoline[i])->textPtr = demoName;
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
((menubitmap_s *)g_demoline[i])->textPtr = demoName;
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
@ -158,65 +160,65 @@ void DemoMenu_PopulateList ( int32_t startingIndex ) {
|
|||
DemoMenu_Graphics
|
||||
=================
|
||||
*/
|
||||
static void DemoMenu_Graphics (void)
|
||||
static void DemoMenu_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
// Draw the basic screen layout
|
||||
UI_MenuFrame(&s_demos.menu);
|
||||
|
||||
UI_DrawProportionalString( 74, 66, "88134-7",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 84, "56-0990",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 188, "3456",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 206, "7618",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 395, "692",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 66, "88134-7", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 84, "56-0990", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 188, "3456", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 206, "7618", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 395, "692", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
|
||||
trap_R_SetColor( colorTable[CT_DKBLUE2]);
|
||||
UI_DrawHandlePic(30,203, 47, 130, uis.whiteShader); // Top left column square on bottom 2 3rds
|
||||
UI_DrawHandlePic(30,336, 47, 16, uis.whiteShader); // Middle left column square on bottom 2 3rds
|
||||
UI_DrawHandlePic(30,355, 47, 34, uis.whiteShader); // Bottom left column square on bottom 2 3rds
|
||||
trap_R_SetColor(colorTable[CT_DKBLUE2]);
|
||||
UI_DrawHandlePic(30, 203, 47, 130, uis.whiteShader); // Top left column square on bottom 2 3rds
|
||||
UI_DrawHandlePic(30, 336, 47, 16, uis.whiteShader); // Middle left column square on bottom 2 3rds
|
||||
UI_DrawHandlePic(30, 355, 47, 34, uis.whiteShader); // Bottom left column square on bottom 2 3rds
|
||||
|
||||
// Numbers for left hand side
|
||||
UI_DrawProportionalString( 74, 206, "52662",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 339, "662",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString( 74, 358, "101235",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 206, "52662", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 339, "662", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(74, 358, "101235", UI_RIGHT | UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
|
||||
// Current game box
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE2]);
|
||||
UI_DrawHandlePic(130,64, 88, 24, uis.whiteShader); // Left Side of current game line box 3
|
||||
UI_DrawHandlePic(218,64, 320, 3, uis.whiteShader); // Top of current game line
|
||||
UI_DrawHandlePic(218,85, 320, 3, uis.whiteShader); // Bottom of current game line
|
||||
UI_DrawHandlePic(516,64, 44, 24, uis.whiteShader); // Right side of current game line
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE2]);
|
||||
UI_DrawHandlePic(130, 64, 88, 24, uis.whiteShader); // Left Side of current game line box 3
|
||||
UI_DrawHandlePic(218, 64, 320, 3, uis.whiteShader); // Top of current game line
|
||||
UI_DrawHandlePic(218, 85, 320, 3, uis.whiteShader); // Bottom of current game line
|
||||
UI_DrawHandlePic(516, 64, 44, 24, uis.whiteShader); // Right side of current game line
|
||||
|
||||
UI_DrawHandlePic(113, 64, 32, 32, s_demos.currentGameTopLeft); // Upper left corner of current game box
|
||||
UI_DrawHandlePic(113, 97, 32, 32, s_demos.currentGameBotLeft); // Bottom left corner of current game box
|
||||
UI_DrawHandlePic(559, 64, 32, 32, s_demos.currentGameTopRight); // Upper right corner of current game box
|
||||
UI_DrawHandlePic(552, 97, -32, 32, s_demos.currentGameBotLeft); // Bottom right corner of current game box
|
||||
UI_DrawHandlePic(113, 64, 32, 32, s_demos.currentGameTopLeft); // Upper left corner of current game box
|
||||
UI_DrawHandlePic(113, 97, 32, 32, s_demos.currentGameBotLeft); // Bottom left corner of current game box
|
||||
UI_DrawHandlePic(559, 64, 32, 32, s_demos.currentGameTopRight); // Upper right corner of current game box
|
||||
UI_DrawHandlePic(552, 97, -32, 32, s_demos.currentGameBotLeft); // Bottom right corner of current game box
|
||||
|
||||
UI_DrawHandlePic(113,91, 18, 6, uis.whiteShader); // Left side of current game line
|
||||
UI_DrawHandlePic(566,91, 18, 6, uis.whiteShader); // Right side of current game line
|
||||
UI_DrawHandlePic(113, 91, 18, 6, uis.whiteShader); // Left side of current game line
|
||||
UI_DrawHandlePic(566, 91, 18, 6, uis.whiteShader); // Right side of current game line
|
||||
|
||||
UI_DrawHandlePic(138,101, 142, 18, uis.whiteShader); // Lower bar to left side of 'engage'
|
||||
UI_DrawHandlePic(416,101, 143, 18, uis.whiteShader); // Lower bar to right side of 'engage'
|
||||
UI_DrawHandlePic(138, 101, 142, 18, uis.whiteShader); // Lower bar to left side of 'engage'
|
||||
UI_DrawHandlePic(416, 101, 143, 18, uis.whiteShader); // Lower bar to right side of 'engage'
|
||||
|
||||
// Available Demos
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE2]);
|
||||
UI_DrawHandlePic(189, 168, 32, 32, s_demos.directoryUpperCorner1); // Left Upper corner of directory box
|
||||
UI_DrawHandlePic(189, 421, 32, 32, s_demos.directoryLowerCorner1); // Left Lower corner of directory box
|
||||
UI_DrawHandlePic(481, 168, 32, 32, s_demos.directoryUpperCorner2); // Right Upper corner of directory box
|
||||
UI_DrawHandlePic(470, 421, -32, 32, s_demos.directoryLowerCorner1); // Right Lower corner of directory box
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE2]);
|
||||
UI_DrawHandlePic(189, 168, 32, 32, s_demos.directoryUpperCorner1); // Left Upper corner of directory box
|
||||
UI_DrawHandlePic(189, 421, 32, 32, s_demos.directoryLowerCorner1); // Left Lower corner of directory box
|
||||
UI_DrawHandlePic(481, 168, 32, 32, s_demos.directoryUpperCorner2); // Right Upper corner of directory box
|
||||
UI_DrawHandlePic(470, 421, -32, 32, s_demos.directoryLowerCorner1); // Right Lower corner of directory box
|
||||
|
||||
UI_DrawHandlePic(205, 168, 277, 18, uis.whiteShader); // Top bar
|
||||
UI_DrawHandlePic(189, 193, 16, 224, uis.whiteShader); // Left column
|
||||
UI_DrawHandlePic(205, 168, 277, 18, uis.whiteShader); // Top bar
|
||||
UI_DrawHandlePic(189, 193, 16, 224, uis.whiteShader); // Left column
|
||||
{//TiM - Arrow Boxes
|
||||
UI_DrawHandlePic(485, 193, 16, 16, uis.whiteShader); // Up Arrow
|
||||
UI_DrawHandlePic(485, 212, 16, 187, uis.whiteShader); // Right column
|
||||
UI_DrawHandlePic(485, 402, 16, 16, uis.whiteShader); // Down Arrow
|
||||
UI_DrawHandlePic(485, 193, 16, 16, uis.whiteShader); // Up Arrow
|
||||
UI_DrawHandlePic(485, 212, 16, 187, uis.whiteShader); // Right column
|
||||
UI_DrawHandlePic(485, 402, 16, 16, uis.whiteShader); // Down Arrow
|
||||
}
|
||||
UI_DrawHandlePic(205, 424, 277, 8, uis.whiteShader); // Bottom bar
|
||||
UI_DrawHandlePic(205, 424, 277, 8, uis.whiteShader); // Bottom bar
|
||||
|
||||
UI_DrawProportionalString( 124, 67, "67B",UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(124, 67, "67B", UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
|
||||
UI_DrawProportionalString( 220, 169, menu_normal_text[MNT_CURRENTDEMOSAVAILABLE], UI_SMALLFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(220, 169, menu_normal_text[MNT_CURRENTDEMOSAVAILABLE], UI_SMALLFONT, colorTable[CT_BLACK]);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -225,13 +227,13 @@ static void DemoMenu_Graphics (void)
|
|||
Demos_MenuDraw
|
||||
=================
|
||||
*/
|
||||
static void Demos_MenuDraw (void)
|
||||
static void Demos_MenuDraw(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
// Draw graphics particular to Demo Menu
|
||||
DemoMenu_Graphics();
|
||||
|
||||
Menu_Draw( &s_demos.menu );
|
||||
Menu_Draw(&s_demos.menu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -241,70 +243,70 @@ static void Demos_MenuDraw (void)
|
|||
Demos_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void Demos_MenuEvent( void *ptr, int32_t event )
|
||||
static void Demos_MenuEvent(void *ptr, int32_t event)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t index;
|
||||
|
||||
if( event != QM_ACTIVATED )
|
||||
if (event != QM_ACTIVATED)
|
||||
{
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id )
|
||||
switch (((menucommon_s*)ptr)->id)
|
||||
{
|
||||
case ID_UP:
|
||||
s_demos.currentDemoIndex--;
|
||||
case ID_UP:
|
||||
s_demos.currentDemoIndex--;
|
||||
|
||||
if ( s_demos.currentDemoIndex < 0 )
|
||||
s_demos.currentDemoIndex = 0;
|
||||
if (s_demos.currentDemoIndex < 0)
|
||||
s_demos.currentDemoIndex = 0;
|
||||
|
||||
DemoMenu_PopulateList( s_demos.currentDemoIndex );
|
||||
break;
|
||||
DemoMenu_PopulateList(s_demos.currentDemoIndex);
|
||||
break;
|
||||
|
||||
case ID_DOWN:
|
||||
s_demos.currentDemoIndex++;
|
||||
case ID_DOWN:
|
||||
s_demos.currentDemoIndex++;
|
||||
|
||||
//TiM - cap it when the final entry is in view
|
||||
if ( s_demos.list.numitems > MAX_DEMODISP
|
||||
&& ( s_demos.currentDemoIndex + MAX_DEMODISP ) > s_demos.list.numitems )
|
||||
s_demos.currentDemoIndex = s_demos.list.numitems-MAX_DEMODISP;
|
||||
//TiM - cap it when the final entry is in view
|
||||
if (s_demos.list.numitems > MAX_DEMODISP
|
||||
&& (s_demos.currentDemoIndex + MAX_DEMODISP) > s_demos.list.numitems)
|
||||
s_demos.currentDemoIndex = s_demos.list.numitems - MAX_DEMODISP;
|
||||
|
||||
DemoMenu_PopulateList( s_demos.currentDemoIndex );
|
||||
break;
|
||||
DemoMenu_PopulateList(s_demos.currentDemoIndex);
|
||||
break;
|
||||
|
||||
case ID_DEMOCOMMENT1:
|
||||
case ID_DEMOCOMMENT2:
|
||||
case ID_DEMOCOMMENT3:
|
||||
case ID_DEMOCOMMENT4:
|
||||
case ID_DEMOCOMMENT5:
|
||||
case ID_DEMOCOMMENT6:
|
||||
case ID_DEMOCOMMENT7:
|
||||
case ID_DEMOCOMMENT8:
|
||||
case ID_DEMOCOMMENT9:
|
||||
case ID_DEMOCOMMENT10:
|
||||
case ID_DEMOCOMMENT11:
|
||||
case ID_DEMOCOMMENT12:
|
||||
index = ((menucommon_s*)ptr)->id - ID_DEMOCOMMENT1;
|
||||
if (((menubitmap_s *)g_demoline[index])->textPtr)
|
||||
{
|
||||
//s_demos.currentDemoIndex = index;
|
||||
s_demos.currentFile.textPtr = (((menubitmap_s *)g_demoline[index])->textPtr);
|
||||
//make it so
|
||||
s_demos.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
}
|
||||
break;
|
||||
case ID_DEMOCOMMENT1:
|
||||
case ID_DEMOCOMMENT2:
|
||||
case ID_DEMOCOMMENT3:
|
||||
case ID_DEMOCOMMENT4:
|
||||
case ID_DEMOCOMMENT5:
|
||||
case ID_DEMOCOMMENT6:
|
||||
case ID_DEMOCOMMENT7:
|
||||
case ID_DEMOCOMMENT8:
|
||||
case ID_DEMOCOMMENT9:
|
||||
case ID_DEMOCOMMENT10:
|
||||
case ID_DEMOCOMMENT11:
|
||||
case ID_DEMOCOMMENT12:
|
||||
index = ((menucommon_s*)ptr)->id - ID_DEMOCOMMENT1;
|
||||
if (((menubitmap_s *)g_demoline[index])->textPtr)
|
||||
{
|
||||
//s_demos.currentDemoIndex = index;
|
||||
s_demos.currentFile.textPtr = (((menubitmap_s *)g_demoline[index])->textPtr);
|
||||
//make it so
|
||||
s_demos.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ID_ENGAGE:
|
||||
UI_ForceMenuOff ();
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "demo %s.efdemo\n", s_demos.currentFile.textPtr) );
|
||||
break;
|
||||
case ID_ENGAGE:
|
||||
UI_ForceMenuOff();
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("demo %s.efdemo\n", s_demos.currentFile.textPtr));
|
||||
break;
|
||||
|
||||
case ID_MAINMENU:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_MAINMENU:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -315,11 +317,11 @@ static void Demos_MenuEvent( void *ptr, int32_t event )
|
|||
UI_DemosMenu_Key
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t UI_DemosMenu_Key( int32_t key )
|
||||
static sfxHandle_t UI_DemosMenu_Key(int32_t key)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
return Menu_DefaultKey( &s_demos.menu, key );
|
||||
return Menu_DefaultKey(&s_demos.menu, key);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -327,7 +329,7 @@ static sfxHandle_t UI_DemosMenu_Key( int32_t key )
|
|||
UI_DemosMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_DemosMenu_Cache( void )
|
||||
void UI_DemosMenu_Cache(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
s_demos.currentGameTopLeft = trap_R_RegisterShaderNoMip("menu/common/corner_ul_18_24.tga");
|
||||
|
@ -337,9 +339,9 @@ void UI_DemosMenu_Cache( void )
|
|||
s_demos.directoryLowerCorner1 = trap_R_RegisterShaderNoMip("menu/common/corner_ll_8_16.tga");
|
||||
s_demos.directoryUpperCorner2 = trap_R_RegisterShaderNoMip("menu/common/corner_ur_16_18.tga");
|
||||
|
||||
trap_R_RegisterShaderNoMip( "menu/common/arrow_up_16.tga" );
|
||||
trap_R_RegisterShaderNoMip( "menu/common/arrow_dn_16.tga" );
|
||||
trap_R_RegisterShaderNoMip( PIC_UNDERLINE );
|
||||
trap_R_RegisterShaderNoMip("menu/common/arrow_up_16.tga");
|
||||
trap_R_RegisterShaderNoMip("menu/common/arrow_dn_16.tga");
|
||||
trap_R_RegisterShaderNoMip(PIC_UNDERLINE);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -349,152 +351,152 @@ void UI_DemosMenu_Cache( void )
|
|||
Demos_MenuInit
|
||||
===============
|
||||
*/
|
||||
static void Demos_MenuInit( void )
|
||||
static void Demos_MenuInit(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t i,x,y;
|
||||
int32_t i, x, y;
|
||||
int32_t len;
|
||||
char *demoname;
|
||||
|
||||
memset( &s_demos, 0 ,sizeof(demos_t) );
|
||||
memset(&s_demos, 0, sizeof(demos_t));
|
||||
s_demos.menu.key = UI_DemosMenu_Key;
|
||||
|
||||
UI_DemosMenu_Cache();
|
||||
|
||||
s_demos.menu.fullscreen = qtrue;
|
||||
s_demos.menu.wrapAround = qtrue;
|
||||
s_demos.menu.draw = Demos_MenuDraw;
|
||||
s_demos.menu.descX = MENU_DESC_X;
|
||||
s_demos.menu.descY = MENU_DESC_Y;
|
||||
s_demos.menu.titleX = MENU_TITLE_X;
|
||||
s_demos.menu.titleY = MENU_TITLE_Y;
|
||||
s_demos.menu.titleI = MNT_DEMOS_TITLE;
|
||||
s_demos.menu.footNoteEnum = MNT_DEMOS;
|
||||
s_demos.menu.fullscreen = qtrue;
|
||||
s_demos.menu.wrapAround = qtrue;
|
||||
s_demos.menu.draw = Demos_MenuDraw;
|
||||
s_demos.menu.descX = MENU_DESC_X;
|
||||
s_demos.menu.descY = MENU_DESC_Y;
|
||||
s_demos.menu.titleX = MENU_TITLE_X;
|
||||
s_demos.menu.titleY = MENU_TITLE_Y;
|
||||
s_demos.menu.titleI = MNT_DEMOS_TITLE;
|
||||
s_demos.menu.footNoteEnum = MNT_DEMOS;
|
||||
|
||||
s_demos.main.generic.type = MTYPE_BITMAP;
|
||||
s_demos.main.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_demos.main.generic.x = 482;
|
||||
s_demos.main.generic.y = 136;
|
||||
s_demos.main.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
|
||||
s_demos.main.generic.id = ID_MAINMENU;
|
||||
s_demos.main.generic.callback = Demos_MenuEvent;
|
||||
s_demos.main.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.main.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.main.color = CT_DKPURPLE1;
|
||||
s_demos.main.color2 = CT_LTPURPLE1;
|
||||
s_demos.main.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.main.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.main.textEnum = MBT_MAINMENU;
|
||||
s_demos.main.textcolor = CT_BLACK;
|
||||
s_demos.main.textcolor2 = CT_WHITE;
|
||||
s_demos.main.generic.type = MTYPE_BITMAP;
|
||||
s_demos.main.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_demos.main.generic.x = 482;
|
||||
s_demos.main.generic.y = 136;
|
||||
s_demos.main.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
|
||||
s_demos.main.generic.id = ID_MAINMENU;
|
||||
s_demos.main.generic.callback = Demos_MenuEvent;
|
||||
s_demos.main.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.main.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.main.color = CT_DKPURPLE1;
|
||||
s_demos.main.color2 = CT_LTPURPLE1;
|
||||
s_demos.main.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.main.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.main.textEnum = MBT_MAINMENU;
|
||||
s_demos.main.textcolor = CT_BLACK;
|
||||
s_demos.main.textcolor2 = CT_WHITE;
|
||||
|
||||
s_demos.engage.generic.type = MTYPE_BITMAP;
|
||||
s_demos.engage.generic.flags = (QMF_INACTIVE|QMF_GRAYED);
|
||||
s_demos.engage.generic.x = 283;
|
||||
s_demos.engage.generic.y = 101;
|
||||
s_demos.engage.generic.name = GRAPHIC_SQUARE;
|
||||
s_demos.engage.generic.id = ID_ENGAGE;
|
||||
s_demos.engage.generic.callback = Demos_MenuEvent;
|
||||
s_demos.engage.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.engage.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.engage.color = CT_DKPURPLE1;
|
||||
s_demos.engage.color2 = CT_LTPURPLE1;
|
||||
s_demos.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.engage.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.engage.textEnum = MBT_ENGAGEDEMO;
|
||||
s_demos.engage.textcolor = CT_BLACK;
|
||||
s_demos.engage.textcolor2 = CT_WHITE;
|
||||
s_demos.engage.generic.type = MTYPE_BITMAP;
|
||||
s_demos.engage.generic.flags = (QMF_INACTIVE | QMF_GRAYED);
|
||||
s_demos.engage.generic.x = 283;
|
||||
s_demos.engage.generic.y = 101;
|
||||
s_demos.engage.generic.name = GRAPHIC_SQUARE;
|
||||
s_demos.engage.generic.id = ID_ENGAGE;
|
||||
s_demos.engage.generic.callback = Demos_MenuEvent;
|
||||
s_demos.engage.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.engage.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.engage.color = CT_DKPURPLE1;
|
||||
s_demos.engage.color2 = CT_LTPURPLE1;
|
||||
s_demos.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.engage.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.engage.textEnum = MBT_ENGAGEDEMO;
|
||||
s_demos.engage.textcolor = CT_BLACK;
|
||||
s_demos.engage.textcolor2 = CT_WHITE;
|
||||
|
||||
s_demos.upArrow.generic.type = MTYPE_BITMAP;
|
||||
s_demos.upArrow.generic.flags = (QMF_INACTIVE|QMF_GRAYED);
|
||||
s_demos.upArrow.generic.x = 486;
|
||||
s_demos.upArrow.generic.y = 195;
|
||||
s_demos.upArrow.generic.name = "menu/common/arrow_up_16.tga";
|
||||
s_demos.upArrow.generic.id = ID_UP;
|
||||
s_demos.upArrow.generic.callback = Demos_MenuEvent;
|
||||
s_demos.upArrow.width = 14;
|
||||
s_demos.upArrow.height = 14;
|
||||
s_demos.upArrow.color = CT_DKGOLD1;;
|
||||
s_demos.upArrow.color2 = CT_LTGOLD1;;
|
||||
s_demos.upArrow.textcolor = CT_BLACK;
|
||||
s_demos.upArrow.textcolor2 = CT_WHITE;
|
||||
s_demos.upArrow.generic.type = MTYPE_BITMAP;
|
||||
s_demos.upArrow.generic.flags = (QMF_INACTIVE | QMF_GRAYED);
|
||||
s_demos.upArrow.generic.x = 486;
|
||||
s_demos.upArrow.generic.y = 195;
|
||||
s_demos.upArrow.generic.name = "menu/common/arrow_up_16.tga";
|
||||
s_demos.upArrow.generic.id = ID_UP;
|
||||
s_demos.upArrow.generic.callback = Demos_MenuEvent;
|
||||
s_demos.upArrow.width = 14;
|
||||
s_demos.upArrow.height = 14;
|
||||
s_demos.upArrow.color = CT_DKGOLD1;;
|
||||
s_demos.upArrow.color2 = CT_LTGOLD1;;
|
||||
s_demos.upArrow.textcolor = CT_BLACK;
|
||||
s_demos.upArrow.textcolor2 = CT_WHITE;
|
||||
|
||||
s_demos.downArrow.generic.type = MTYPE_BITMAP;
|
||||
s_demos.downArrow.generic.flags = (QMF_INACTIVE|QMF_GRAYED);
|
||||
s_demos.downArrow.generic.x = 486;
|
||||
s_demos.downArrow.generic.y = 404;
|
||||
s_demos.downArrow.generic.name = "menu/common/arrow_dn_16.tga";
|
||||
s_demos.downArrow.generic.id = ID_DOWN;
|
||||
s_demos.downArrow.generic.callback = Demos_MenuEvent;
|
||||
s_demos.downArrow.width = 14;
|
||||
s_demos.downArrow.height = 14;
|
||||
s_demos.downArrow.color = CT_DKGOLD1;
|
||||
s_demos.downArrow.color2 = CT_LTGOLD1;
|
||||
s_demos.downArrow.textcolor = CT_BLACK;
|
||||
s_demos.downArrow.textcolor2 = CT_WHITE;
|
||||
s_demos.downArrow.generic.type = MTYPE_BITMAP;
|
||||
s_demos.downArrow.generic.flags = (QMF_INACTIVE | QMF_GRAYED);
|
||||
s_demos.downArrow.generic.x = 486;
|
||||
s_demos.downArrow.generic.y = 404;
|
||||
s_demos.downArrow.generic.name = "menu/common/arrow_dn_16.tga";
|
||||
s_demos.downArrow.generic.id = ID_DOWN;
|
||||
s_demos.downArrow.generic.callback = Demos_MenuEvent;
|
||||
s_demos.downArrow.width = 14;
|
||||
s_demos.downArrow.height = 14;
|
||||
s_demos.downArrow.color = CT_DKGOLD1;
|
||||
s_demos.downArrow.color2 = CT_LTGOLD1;
|
||||
s_demos.downArrow.textcolor = CT_BLACK;
|
||||
s_demos.downArrow.textcolor2 = CT_WHITE;
|
||||
|
||||
s_demos.currentFile.generic.type = MTYPE_BITMAP;
|
||||
s_demos.currentFile.generic.flags = QMF_INACTIVE;
|
||||
s_demos.currentFile.generic.x = 218;
|
||||
s_demos.currentFile.generic.y = 68;
|
||||
s_demos.currentFile.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
|
||||
s_demos.currentFile.generic.id = ID_MAINMENU;
|
||||
s_demos.currentFile.generic.callback = Demos_MenuEvent;
|
||||
s_demos.currentFile.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.currentFile.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.currentFile.color = CT_BLACK;
|
||||
s_demos.currentFile.color2 = CT_BLACK;
|
||||
s_demos.currentFile.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.currentFile.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.currentFile.textEnum = MNT_NONE;
|
||||
s_demos.currentFile.textPtr = NULL;
|
||||
s_demos.currentFile.textcolor = CT_YELLOW;
|
||||
s_demos.currentFile.generic.type = MTYPE_BITMAP;
|
||||
s_demos.currentFile.generic.flags = QMF_INACTIVE;
|
||||
s_demos.currentFile.generic.x = 218;
|
||||
s_demos.currentFile.generic.y = 68;
|
||||
s_demos.currentFile.generic.name = BUTTON_GRAPHIC_LONGRIGHT;
|
||||
s_demos.currentFile.generic.id = ID_MAINMENU;
|
||||
s_demos.currentFile.generic.callback = Demos_MenuEvent;
|
||||
s_demos.currentFile.width = MENU_BUTTON_MED_WIDTH;
|
||||
s_demos.currentFile.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_demos.currentFile.color = CT_BLACK;
|
||||
s_demos.currentFile.color2 = CT_BLACK;
|
||||
s_demos.currentFile.textX = MENU_BUTTON_TEXT_X;
|
||||
s_demos.currentFile.textY = MENU_BUTTON_TEXT_Y;
|
||||
s_demos.currentFile.textEnum = MNT_NONE;
|
||||
s_demos.currentFile.textPtr = NULL;
|
||||
s_demos.currentFile.textcolor = CT_YELLOW;
|
||||
|
||||
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 = 170;
|
||||
s_demos.list.width = 16;
|
||||
s_demos.list.height = 14;
|
||||
s_demos.list.numitems = trap_FS_GetFileList( "demos", ".efdemo", s_demos.names, NAMEBUFSIZE );
|
||||
s_demos.list.itemnames = (const char **)s_demos.demolist;
|
||||
s_demos.list.columns = 3;
|
||||
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 = 170;
|
||||
s_demos.list.width = 16;
|
||||
s_demos.list.height = 14;
|
||||
s_demos.list.numitems = trap_FS_GetFileList("demos", ".efdemo", s_demos.names, NAMEBUFSIZE);
|
||||
s_demos.list.itemnames = (const char **)s_demos.demolist;
|
||||
s_demos.list.columns = 3;
|
||||
|
||||
x = 225;
|
||||
y = 200;
|
||||
i=0;
|
||||
i = 0;
|
||||
while (g_demoline[i])
|
||||
{
|
||||
((menubitmap_s *)g_demoline[i])->generic.type = MTYPE_BITMAP;
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE | QMF_HIDDEN;
|
||||
((menubitmap_s *)g_demoline[i])->generic.x = x;
|
||||
((menubitmap_s *)g_demoline[i])->generic.y = y;
|
||||
((menubitmap_s *)g_demoline[i])->generic.name = PIC_UNDERLINE;
|
||||
((menubitmap_s *)g_demoline[i])->generic.callback = Demos_MenuEvent;
|
||||
((menubitmap_s *)g_demoline[i])->generic.id = ID_DEMOCOMMENT1+i;
|
||||
((menubitmap_s *)g_demoline[i])->width = 240;
|
||||
((menubitmap_s *)g_demoline[i])->height = 16;
|
||||
((menubitmap_s *)g_demoline[i])->color = CT_DKPURPLE1;
|
||||
((menubitmap_s *)g_demoline[i])->color2 = CT_LTPURPLE1;
|
||||
((menubitmap_s *)g_demoline[i])->textPtr = NULL;
|
||||
((menubitmap_s *)g_demoline[i])->textX = 4;
|
||||
((menubitmap_s *)g_demoline[i])->textY = 1;
|
||||
((menubitmap_s *)g_demoline[i])->textcolor = CT_DKGOLD1;
|
||||
((menubitmap_s *)g_demoline[i])->textcolor2 = CT_LTGOLD1;
|
||||
((menubitmap_s *)g_demoline[i])->textStyle = UI_TINYFONT;
|
||||
// ((menubitmap_s *)g_demoline[i])->textEnum = MBT_DEMOLINE;
|
||||
((menubitmap_s *)g_demoline[i])->generic.type = MTYPE_BITMAP;
|
||||
((menubitmap_s *)g_demoline[i])->generic.flags = QMF_INACTIVE | QMF_HIDDEN;
|
||||
((menubitmap_s *)g_demoline[i])->generic.x = x;
|
||||
((menubitmap_s *)g_demoline[i])->generic.y = y;
|
||||
((menubitmap_s *)g_demoline[i])->generic.name = PIC_UNDERLINE;
|
||||
((menubitmap_s *)g_demoline[i])->generic.callback = Demos_MenuEvent;
|
||||
((menubitmap_s *)g_demoline[i])->generic.id = ID_DEMOCOMMENT1 + i;
|
||||
((menubitmap_s *)g_demoline[i])->width = 240;
|
||||
((menubitmap_s *)g_demoline[i])->height = 16;
|
||||
((menubitmap_s *)g_demoline[i])->color = CT_DKPURPLE1;
|
||||
((menubitmap_s *)g_demoline[i])->color2 = CT_LTPURPLE1;
|
||||
((menubitmap_s *)g_demoline[i])->textPtr = NULL;
|
||||
((menubitmap_s *)g_demoline[i])->textX = 4;
|
||||
((menubitmap_s *)g_demoline[i])->textY = 1;
|
||||
((menubitmap_s *)g_demoline[i])->textcolor = CT_DKGOLD1;
|
||||
((menubitmap_s *)g_demoline[i])->textcolor2 = CT_LTGOLD1;
|
||||
((menubitmap_s *)g_demoline[i])->textStyle = UI_TINYFONT;
|
||||
// ((menubitmap_s *)g_demoline[i])->textEnum = MBT_DEMOLINE;
|
||||
|
||||
Menu_AddItem( &s_demos.menu, ( void * )g_demoline[i]);
|
||||
Menu_AddItem(&s_demos.menu, (void *)g_demoline[i]);
|
||||
y += 18;
|
||||
++i;
|
||||
}
|
||||
|
||||
// No demos??
|
||||
if (!s_demos.list.numitems)
|
||||
if (!s_demos.list.numitems)
|
||||
{
|
||||
strcpy( s_demos.names, menu_normal_text[MNT_NO_DEMOS_FOUND] );
|
||||
strcpy(s_demos.names, menu_normal_text[MNT_NO_DEMOS_FOUND]);
|
||||
s_demos.list.numitems = 1;
|
||||
}
|
||||
else if (s_demos.list.numitems > MAX_DEMOS)
|
||||
|
@ -503,25 +505,25 @@ static void Demos_MenuInit( void )
|
|||
}
|
||||
|
||||
//TiM - If the list is longer than we can fit, enable the scroll buttons
|
||||
if ( s_demos.list.numitems > MAX_DEMODISP ) {
|
||||
s_demos.upArrow.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_demos.downArrow.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
if (s_demos.list.numitems > MAX_DEMODISP) {
|
||||
s_demos.upArrow.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_demos.downArrow.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
}
|
||||
|
||||
// Point fields to demo names
|
||||
i=0;
|
||||
i = 0;
|
||||
demoname = s_demos.names;
|
||||
//TiM - instead of sending the list names directly to the controls, we'll populate an array
|
||||
//with them and then selectively add the ones we want at the time to the controls. :)
|
||||
while ( i < s_demos.list.numitems ) {
|
||||
if ( !demoname )
|
||||
while (i < s_demos.list.numitems) {
|
||||
if (!demoname)
|
||||
break;
|
||||
|
||||
|
||||
// strip extension
|
||||
len = strlen( demoname );
|
||||
if ( len>7 && !Q_stricmp(demoname + len - 7,".efdemo"))
|
||||
len = strlen(demoname);
|
||||
if (len>7 && !Q_stricmp(demoname + len - 7, ".efdemo"))
|
||||
{
|
||||
demoname[len-7] = '\0';
|
||||
demoname[len - 7] = '\0';
|
||||
}
|
||||
//Q_strupr(demoname);
|
||||
|
||||
|
@ -534,14 +536,14 @@ static void Demos_MenuInit( void )
|
|||
}
|
||||
|
||||
//Populate the controls with the values from the array
|
||||
DemoMenu_PopulateList( s_demos.currentDemoIndex );
|
||||
DemoMenu_PopulateList(s_demos.currentDemoIndex);
|
||||
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.main );
|
||||
// Menu_AddItem( &s_demos.menu, &s_demos.list );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.engage );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.currentFile );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.upArrow );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.downArrow );
|
||||
Menu_AddItem(&s_demos.menu, &s_demos.main);
|
||||
// Menu_AddItem( &s_demos.menu, &s_demos.list );
|
||||
Menu_AddItem(&s_demos.menu, &s_demos.engage);
|
||||
Menu_AddItem(&s_demos.menu, &s_demos.currentFile);
|
||||
Menu_AddItem(&s_demos.menu, &s_demos.upArrow);
|
||||
Menu_AddItem(&s_demos.menu, &s_demos.downArrow);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -551,10 +553,10 @@ static void Demos_MenuInit( void )
|
|||
UI_DemosMenu
|
||||
===============
|
||||
*/
|
||||
void UI_DemosMenu( void )
|
||||
void UI_DemosMenu(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
Demos_MenuInit();
|
||||
UI_PushMenu( &s_demos.menu );
|
||||
UI_PushMenu(&s_demos.menu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
|
1570
code/ui/ui_emotes.c
1570
code/ui/ui_emotes.c
File diff suppressed because it is too large
Load diff
|
@ -10,16 +10,18 @@
|
|||
static int32_t currentFont;
|
||||
|
||||
// menu action identifiers
|
||||
#define ID_MAINMENU 100
|
||||
#define ID_CONTROLS 101
|
||||
#define ID_VIDEO 102
|
||||
#define ID_SOUND 103
|
||||
#define ID_CDKEY 104
|
||||
enum ui_fontsIDs {
|
||||
ID_MAINMENU = 100,
|
||||
ID_CONTROLS,
|
||||
ID_VIDEO,
|
||||
ID_SOUND,
|
||||
ID_CDKEY,
|
||||
|
||||
#define ID_FONT_SMALL 301
|
||||
#define ID_FONT_MEDIUM 302
|
||||
#define ID_FONT_LARGE 303
|
||||
#define ID_FONT_GRID 304
|
||||
ID_FONT_SMALL = 301,
|
||||
ID_FONT_MEDIUM,
|
||||
ID_FONT_LARGE,
|
||||
ID_FONT_GRID
|
||||
};
|
||||
|
||||
static menuframework_s s_fonts_menu;
|
||||
static menubitmap_s s_fonts_small;
|
||||
|
@ -32,31 +34,31 @@ static menubitmap_s s_fonts_grid;
|
|||
M_GridFont_Graphics
|
||||
=================
|
||||
*/
|
||||
void M_GridFont_Graphics (void)
|
||||
void M_GridFont_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t x,y;
|
||||
int32_t i,i2,xInc;
|
||||
int32_t x, y;
|
||||
int32_t i, i2, xInc;
|
||||
char character[2];
|
||||
|
||||
character[1] = 0;
|
||||
y = 190;
|
||||
for (i=32;i<256;)
|
||||
for (i = 32; i < 256;)
|
||||
{
|
||||
x = 100;
|
||||
for (i2=0;i2<30;++i2,++i)
|
||||
for (i2 = 0; i2<30; ++i2, ++i)
|
||||
{
|
||||
character[0] = i;
|
||||
UI_DrawString(x, y, character, UI_SMALLFONT, colorTable[CT_WHITE], qtrue);
|
||||
|
||||
xInc =SMALLCHAR_WIDTH + 1;
|
||||
xInc = SMALLCHAR_WIDTH + 1;
|
||||
|
||||
if (xInc > 0)
|
||||
{
|
||||
x += xInc;
|
||||
}
|
||||
|
||||
if (i>=256)
|
||||
if (i >= 256)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -71,31 +73,31 @@ void M_GridFont_Graphics (void)
|
|||
M_LargeFont_Graphics
|
||||
=================
|
||||
*/
|
||||
void M_LargeFont_Graphics (void)
|
||||
void M_LargeFont_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t x,y,color;
|
||||
int32_t i,i2,xInc;
|
||||
int32_t x, y, color;
|
||||
int32_t i, i2, xInc;
|
||||
char character[2];
|
||||
|
||||
character[1] = 0;
|
||||
y = 190;
|
||||
color = CT_LTORANGE;
|
||||
for (i=32;i<256;)
|
||||
for (i = 32; i < 256;)
|
||||
{
|
||||
x = 100;
|
||||
for (i2=0;i2<30;++i2,++i)
|
||||
for (i2 = 0; i2<30; ++i2, ++i)
|
||||
{
|
||||
character[0] = i;
|
||||
UI_DrawProportionalString( x, y, character, UI_BIGFONT, colorTable[color] );
|
||||
xInc = UI_ProportionalStringWidth( character,UI_BIGFONT) + 1;
|
||||
UI_DrawProportionalString(x, y, character, UI_BIGFONT, colorTable[color]);
|
||||
xInc = UI_ProportionalStringWidth(character, UI_BIGFONT) + 1;
|
||||
|
||||
if (xInc > 0)
|
||||
{
|
||||
x += xInc;
|
||||
}
|
||||
|
||||
if (i>=256)
|
||||
if (i >= 256)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -110,31 +112,31 @@ void M_LargeFont_Graphics (void)
|
|||
M_MediumFont_Graphics
|
||||
=================
|
||||
*/
|
||||
void M_MediumFont_Graphics (void)
|
||||
void M_MediumFont_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t x,y,color;
|
||||
int32_t i,i2,xInc;
|
||||
int32_t x, y, color;
|
||||
int32_t i, i2, xInc;
|
||||
char character[2];
|
||||
|
||||
character[1] = 0;
|
||||
y = 190;
|
||||
color = CT_LTORANGE;
|
||||
for (i=32;i<256;)
|
||||
for (i = 32; i < 256;)
|
||||
{
|
||||
x = 100;
|
||||
for (i2=0;i2<30;++i2,++i)
|
||||
for (i2 = 0; i2<30; ++i2, ++i)
|
||||
{
|
||||
character[0] = i;
|
||||
UI_DrawProportionalString( x, y, character, UI_SMALLFONT, colorTable[color] );
|
||||
xInc = UI_ProportionalStringWidth( character,UI_SMALLFONT) + 1;
|
||||
UI_DrawProportionalString(x, y, character, UI_SMALLFONT, colorTable[color]);
|
||||
xInc = UI_ProportionalStringWidth(character, UI_SMALLFONT) + 1;
|
||||
|
||||
if (xInc > 0)
|
||||
{
|
||||
x += xInc;
|
||||
}
|
||||
|
||||
if (i>=256)
|
||||
if (i >= 256)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -149,31 +151,31 @@ void M_MediumFont_Graphics (void)
|
|||
M_SmallFont_Graphics
|
||||
=================
|
||||
*/
|
||||
void M_SmallFont_Graphics (void)
|
||||
void M_SmallFont_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t x,y,color;
|
||||
int32_t i,i2,xInc;
|
||||
int32_t x, y, color;
|
||||
int32_t i, i2, xInc;
|
||||
char character[2];
|
||||
|
||||
character[1] = 0;
|
||||
y = 190;
|
||||
color = CT_LTORANGE;
|
||||
for (i=32;i<256;)
|
||||
for (i = 32; i < 256;)
|
||||
{
|
||||
x = 100;
|
||||
for (i2=0;i2<30;++i2,++i)
|
||||
for (i2 = 0; i2<30; ++i2, ++i)
|
||||
{
|
||||
character[0] = i;
|
||||
UI_DrawProportionalString( x, y, character, UI_TINYFONT, colorTable[color] );
|
||||
xInc = UI_ProportionalStringWidth( character,UI_TINYFONT) + 1;
|
||||
UI_DrawProportionalString(x, y, character, UI_TINYFONT, colorTable[color]);
|
||||
xInc = UI_ProportionalStringWidth(character, UI_TINYFONT) + 1;
|
||||
|
||||
if (xInc > 0)
|
||||
{
|
||||
x += xInc;
|
||||
}
|
||||
|
||||
if (i>=256)
|
||||
if (i >= 256)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -189,29 +191,29 @@ void M_SmallFont_Graphics (void)
|
|||
M_Fonts_Graphics
|
||||
=================
|
||||
*/
|
||||
void M_Fonts_Graphics (void)
|
||||
void M_Fonts_Graphics(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
UI_MenuFrame(&s_fonts_menu);
|
||||
|
||||
UI_Setup_MenuButtons();
|
||||
|
||||
trap_R_SetColor( colorTable[CT_LTBROWN1]);
|
||||
UI_DrawHandlePic(30,203, 47, 186, uis.whiteShader); // Long left column square on bottom 3rd
|
||||
trap_R_SetColor(colorTable[CT_LTBROWN1]);
|
||||
UI_DrawHandlePic(30, 203, 47, 186, uis.whiteShader); // Long left column square on bottom 3rd
|
||||
|
||||
switch (currentFont)
|
||||
{
|
||||
case ID_FONT_SMALL :
|
||||
case ID_FONT_SMALL:
|
||||
M_SmallFont_Graphics();
|
||||
break;
|
||||
case ID_FONT_MEDIUM :
|
||||
case ID_FONT_MEDIUM:
|
||||
M_MediumFont_Graphics();
|
||||
break;
|
||||
case ID_FONT_LARGE :
|
||||
case ID_FONT_LARGE:
|
||||
M_LargeFont_Graphics();
|
||||
break;
|
||||
|
||||
case ID_FONT_GRID :
|
||||
case ID_FONT_GRID:
|
||||
M_GridFont_Graphics();
|
||||
break;
|
||||
}
|
||||
|
@ -223,12 +225,12 @@ void M_Fonts_Graphics (void)
|
|||
M_Fonts_MenuDraw
|
||||
=================
|
||||
*/
|
||||
void M_Fonts_MenuDraw (void)
|
||||
void M_Fonts_MenuDraw(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
M_Fonts_Graphics();
|
||||
|
||||
Menu_Draw( &s_fonts_menu );
|
||||
Menu_Draw(&s_fonts_menu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -237,7 +239,7 @@ void M_Fonts_MenuDraw (void)
|
|||
Fonts_MenuEvent
|
||||
=================
|
||||
*/
|
||||
static void Fonts_MenuEvent( void* ptr, int32_t notification )
|
||||
static void Fonts_MenuEvent(void* ptr, int32_t notification)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
if (notification != QM_ACTIVATED){
|
||||
|
@ -247,37 +249,37 @@ static void Fonts_MenuEvent( void* ptr, int32_t notification )
|
|||
|
||||
switch (((menucommon_s*)ptr)->id)
|
||||
{
|
||||
case ID_FONT_SMALL:
|
||||
currentFont = ID_FONT_SMALL;
|
||||
break;
|
||||
case ID_FONT_MEDIUM:
|
||||
currentFont = ID_FONT_MEDIUM;
|
||||
break;
|
||||
case ID_FONT_LARGE:
|
||||
currentFont = ID_FONT_LARGE;
|
||||
break;
|
||||
case ID_FONT_GRID:
|
||||
currentFont = ID_FONT_GRID;
|
||||
break;
|
||||
case ID_VIDEO:
|
||||
UI_PopMenu();
|
||||
UI_VideoDataMenu();
|
||||
return;
|
||||
case ID_CONTROLS:
|
||||
UI_PopMenu();
|
||||
// UI_SetupWeaponsMenu();
|
||||
break;
|
||||
case ID_SOUND:
|
||||
UI_PopMenu();
|
||||
UI_SoundMenu();
|
||||
break;
|
||||
case ID_CDKEY:
|
||||
UI_PopMenu();
|
||||
UI_CDKeyMenu();
|
||||
break;
|
||||
case ID_MAINMENU:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_FONT_SMALL:
|
||||
currentFont = ID_FONT_SMALL;
|
||||
break;
|
||||
case ID_FONT_MEDIUM:
|
||||
currentFont = ID_FONT_MEDIUM;
|
||||
break;
|
||||
case ID_FONT_LARGE:
|
||||
currentFont = ID_FONT_LARGE;
|
||||
break;
|
||||
case ID_FONT_GRID:
|
||||
currentFont = ID_FONT_GRID;
|
||||
break;
|
||||
case ID_VIDEO:
|
||||
UI_PopMenu();
|
||||
UI_VideoDataMenu();
|
||||
return;
|
||||
case ID_CONTROLS:
|
||||
UI_PopMenu();
|
||||
// UI_SetupWeaponsMenu();
|
||||
break;
|
||||
case ID_SOUND:
|
||||
UI_PopMenu();
|
||||
UI_SoundMenu();
|
||||
break;
|
||||
case ID_CDKEY:
|
||||
UI_PopMenu();
|
||||
UI_CDKeyMenu();
|
||||
break;
|
||||
case ID_MAINMENU:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -287,11 +289,11 @@ static void Fonts_MenuEvent( void* ptr, int32_t notification )
|
|||
M_Fonts_MenuKey
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t M_Fonts_MenuKey( int32_t key )
|
||||
static sfxHandle_t M_Fonts_MenuKey(int32_t key)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
return Menu_DefaultKey( &s_fonts_menu, key );
|
||||
return Menu_DefaultKey(&s_fonts_menu, key);
|
||||
}
|
||||
|
||||
|
||||
|
@ -300,7 +302,7 @@ static sfxHandle_t M_Fonts_MenuKey( int32_t key )
|
|||
UI_FontsMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_FontsMenu_Cache( void )
|
||||
void UI_FontsMenu_Cache(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
|
@ -312,98 +314,98 @@ void UI_FontsMenu_Cache( void )
|
|||
FontsMenu_Init
|
||||
===============
|
||||
*/
|
||||
void FontsMenu_Init(void)
|
||||
void FontsMenu_Init(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
UI_FontsMenu_Cache();
|
||||
|
||||
s_fonts_menu.nitems = 0;
|
||||
s_fonts_menu.wrapAround = qtrue;
|
||||
s_fonts_menu.draw = M_Fonts_MenuDraw;
|
||||
s_fonts_menu.key = M_Fonts_MenuKey;
|
||||
s_fonts_menu.fullscreen = qtrue;
|
||||
s_fonts_menu.wrapAround = qfalse;
|
||||
s_fonts_menu.descX = MENU_DESC_X;
|
||||
s_fonts_menu.descY = MENU_DESC_Y;
|
||||
s_fonts_menu.titleX = MENU_TITLE_X;
|
||||
s_fonts_menu.titleY = MENU_TITLE_Y;
|
||||
s_fonts_menu.titleI = MNT_CONTROLSMENU_TITLE;
|
||||
s_fonts_menu.footNoteEnum = MNT_FONTS_DEVELOPER;
|
||||
s_fonts_menu.nitems = 0;
|
||||
s_fonts_menu.wrapAround = qtrue;
|
||||
s_fonts_menu.draw = M_Fonts_MenuDraw;
|
||||
s_fonts_menu.key = M_Fonts_MenuKey;
|
||||
s_fonts_menu.fullscreen = qtrue;
|
||||
s_fonts_menu.wrapAround = qfalse;
|
||||
s_fonts_menu.descX = MENU_DESC_X;
|
||||
s_fonts_menu.descY = MENU_DESC_Y;
|
||||
s_fonts_menu.titleX = MENU_TITLE_X;
|
||||
s_fonts_menu.titleY = MENU_TITLE_Y;
|
||||
s_fonts_menu.titleI = MNT_CONTROLSMENU_TITLE;
|
||||
s_fonts_menu.footNoteEnum = MNT_FONTS_DEVELOPER;
|
||||
|
||||
SetupMenu_TopButtons(&s_fonts_menu,MENU_FONTS,NULL);
|
||||
SetupMenu_TopButtons(&s_fonts_menu, MENU_FONTS, NULL);
|
||||
|
||||
s_fonts_small.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_small.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_small.generic.x = 100;
|
||||
s_fonts_small.generic.y = 170;
|
||||
s_fonts_small.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_small.generic.id = ID_FONT_SMALL;
|
||||
s_fonts_small.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_small.width = 100;
|
||||
s_fonts_small.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_small.color = CT_DKPURPLE1;
|
||||
s_fonts_small.color2 = CT_LTPURPLE1;
|
||||
s_fonts_small.textX = 5;
|
||||
s_fonts_small.textY = 2;
|
||||
s_fonts_small.textEnum = MBT_FONTSSMALL;
|
||||
s_fonts_small.textcolor = CT_BLACK;
|
||||
s_fonts_small.textcolor2 = CT_WHITE;
|
||||
s_fonts_small.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_small.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_small.generic.x = 100;
|
||||
s_fonts_small.generic.y = 170;
|
||||
s_fonts_small.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_small.generic.id = ID_FONT_SMALL;
|
||||
s_fonts_small.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_small.width = 100;
|
||||
s_fonts_small.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_small.color = CT_DKPURPLE1;
|
||||
s_fonts_small.color2 = CT_LTPURPLE1;
|
||||
s_fonts_small.textX = 5;
|
||||
s_fonts_small.textY = 2;
|
||||
s_fonts_small.textEnum = MBT_FONTSSMALL;
|
||||
s_fonts_small.textcolor = CT_BLACK;
|
||||
s_fonts_small.textcolor2 = CT_WHITE;
|
||||
|
||||
s_fonts_medium.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_medium.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_medium.generic.x = 250;
|
||||
s_fonts_medium.generic.y = 170;
|
||||
s_fonts_medium.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_medium.generic.id = ID_FONT_MEDIUM;
|
||||
s_fonts_medium.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_medium.width = 100;
|
||||
s_fonts_medium.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_medium.color = CT_DKPURPLE1;
|
||||
s_fonts_medium.color2 = CT_LTPURPLE1;
|
||||
s_fonts_medium.textX = 5;
|
||||
s_fonts_medium.textY = 2;
|
||||
s_fonts_medium.textEnum = MBT_FONTSMEDIUM;
|
||||
s_fonts_medium.textcolor = CT_BLACK;
|
||||
s_fonts_medium.textcolor2 = CT_WHITE;
|
||||
s_fonts_medium.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_medium.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_medium.generic.x = 250;
|
||||
s_fonts_medium.generic.y = 170;
|
||||
s_fonts_medium.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_medium.generic.id = ID_FONT_MEDIUM;
|
||||
s_fonts_medium.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_medium.width = 100;
|
||||
s_fonts_medium.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_medium.color = CT_DKPURPLE1;
|
||||
s_fonts_medium.color2 = CT_LTPURPLE1;
|
||||
s_fonts_medium.textX = 5;
|
||||
s_fonts_medium.textY = 2;
|
||||
s_fonts_medium.textEnum = MBT_FONTSMEDIUM;
|
||||
s_fonts_medium.textcolor = CT_BLACK;
|
||||
s_fonts_medium.textcolor2 = CT_WHITE;
|
||||
|
||||
s_fonts_large.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_large.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_large.generic.x = 400;
|
||||
s_fonts_large.generic.y = 170;
|
||||
s_fonts_large.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_large.generic.id = ID_FONT_LARGE;
|
||||
s_fonts_large.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_large.width = 100;
|
||||
s_fonts_large.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_large.color = CT_DKPURPLE1;
|
||||
s_fonts_large.color2 = CT_LTPURPLE1;
|
||||
s_fonts_large.textX = 5;
|
||||
s_fonts_large.textY = 2;
|
||||
s_fonts_large.textEnum = MBT_FONTSLARGE;
|
||||
s_fonts_large.textcolor = CT_BLACK;
|
||||
s_fonts_large.textcolor2 = CT_WHITE;
|
||||
s_fonts_large.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_large.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_large.generic.x = 400;
|
||||
s_fonts_large.generic.y = 170;
|
||||
s_fonts_large.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_large.generic.id = ID_FONT_LARGE;
|
||||
s_fonts_large.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_large.width = 100;
|
||||
s_fonts_large.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_large.color = CT_DKPURPLE1;
|
||||
s_fonts_large.color2 = CT_LTPURPLE1;
|
||||
s_fonts_large.textX = 5;
|
||||
s_fonts_large.textY = 2;
|
||||
s_fonts_large.textEnum = MBT_FONTSLARGE;
|
||||
s_fonts_large.textcolor = CT_BLACK;
|
||||
s_fonts_large.textcolor2 = CT_WHITE;
|
||||
|
||||
s_fonts_grid.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_grid.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_grid.generic.x = 550;
|
||||
s_fonts_grid.generic.y = 170;
|
||||
s_fonts_grid.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_grid.generic.id = ID_FONT_GRID;
|
||||
s_fonts_grid.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_grid.width = 100;
|
||||
s_fonts_grid.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_grid.color = CT_DKPURPLE1;
|
||||
s_fonts_grid.color2 = CT_LTPURPLE1;
|
||||
s_fonts_grid.textX = 5;
|
||||
s_fonts_grid.textY = 2;
|
||||
s_fonts_grid.textEnum = MBT_FONTSGRID;
|
||||
s_fonts_grid.textcolor = CT_BLACK;
|
||||
s_fonts_grid.textcolor2 = CT_WHITE;
|
||||
s_fonts_grid.generic.type = MTYPE_BITMAP;
|
||||
s_fonts_grid.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_fonts_grid.generic.x = 550;
|
||||
s_fonts_grid.generic.y = 170;
|
||||
s_fonts_grid.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_fonts_grid.generic.id = ID_FONT_GRID;
|
||||
s_fonts_grid.generic.callback = Fonts_MenuEvent;
|
||||
s_fonts_grid.width = 100;
|
||||
s_fonts_grid.height = MENU_BUTTON_MED_HEIGHT;
|
||||
s_fonts_grid.color = CT_DKPURPLE1;
|
||||
s_fonts_grid.color2 = CT_LTPURPLE1;
|
||||
s_fonts_grid.textX = 5;
|
||||
s_fonts_grid.textY = 2;
|
||||
s_fonts_grid.textEnum = MBT_FONTSGRID;
|
||||
s_fonts_grid.textcolor = CT_BLACK;
|
||||
s_fonts_grid.textcolor2 = CT_WHITE;
|
||||
|
||||
Menu_AddItem( &s_fonts_menu, ( void * )&s_fonts_small);
|
||||
Menu_AddItem( &s_fonts_menu, ( void * )&s_fonts_medium);
|
||||
Menu_AddItem( &s_fonts_menu, ( void * )&s_fonts_large);
|
||||
Menu_AddItem( &s_fonts_menu, ( void * )&s_fonts_grid);
|
||||
Menu_AddItem(&s_fonts_menu, (void *)&s_fonts_small);
|
||||
Menu_AddItem(&s_fonts_menu, (void *)&s_fonts_medium);
|
||||
Menu_AddItem(&s_fonts_menu, (void *)&s_fonts_large);
|
||||
Menu_AddItem(&s_fonts_menu, (void *)&s_fonts_grid);
|
||||
|
||||
currentFont = ID_FONT_SMALL;
|
||||
UI_LogFuncEnd();
|
||||
|
@ -414,12 +416,12 @@ void FontsMenu_Init(void)
|
|||
UI_FontsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_FontsMenu( void)
|
||||
void UI_FontsMenu(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
FontsMenu_Init();
|
||||
FontsMenu_Init();
|
||||
|
||||
UI_PushMenu( &s_fonts_menu);
|
||||
UI_PushMenu(&s_fonts_menu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,24 +12,26 @@
|
|||
// arena and bot info
|
||||
//
|
||||
|
||||
#define DIRLIST_SIZE 16384
|
||||
#define POOLSIZE 48 * DIRLIST_SIZE
|
||||
enum ui_gameinfoLimits_e {
|
||||
DIRLIST_SIZE = 16384,
|
||||
POOLSIZE = 48 * DIRLIST_SIZE
|
||||
};
|
||||
|
||||
//#define POOLSIZE 128 * 1024
|
||||
|
||||
int32_t ui_numBots;
|
||||
static char *ui_botInfos[MAX_BOTS];
|
||||
int32_t ui_numBots;
|
||||
static char* ui_botInfos[MAX_BOTS];
|
||||
|
||||
static int32_t ui_numArenas;
|
||||
static char *ui_arenaInfos[MAX_ARENAS];
|
||||
static int32_t ui_numArenas;
|
||||
static char* ui_arenaInfos[MAX_ARENAS];
|
||||
|
||||
static int32_t ui_numSinglePlayerArenas;
|
||||
static int32_t ui_numSpecialSinglePlayerArenas;
|
||||
static int32_t ui_numSinglePlayerArenas;
|
||||
static int32_t ui_numSpecialSinglePlayerArenas;
|
||||
|
||||
static char dirlist[DIRLIST_SIZE];
|
||||
static char dirlist[DIRLIST_SIZE];
|
||||
|
||||
static char memoryPool[POOLSIZE];
|
||||
static int32_t allocPoint, outOfMemory;
|
||||
static char memoryPool[POOLSIZE];
|
||||
static int32_t allocPoint, outOfMemory;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -37,11 +39,11 @@ static int32_t allocPoint, outOfMemory;
|
|||
UI_Alloc
|
||||
===============
|
||||
*/
|
||||
void *UI_Alloc( int32_t size ) {
|
||||
void *UI_Alloc(int32_t size) {
|
||||
UI_LogFuncBegin();
|
||||
char *p;
|
||||
|
||||
if ( allocPoint + size > POOLSIZE ) {
|
||||
if (allocPoint + size > POOLSIZE) {
|
||||
outOfMemory = qtrue;
|
||||
UI_LogFuncEnd();
|
||||
return NULL;
|
||||
|
@ -49,7 +51,7 @@ void *UI_Alloc( int32_t size ) {
|
|||
|
||||
p = &memoryPool[allocPoint];
|
||||
|
||||
allocPoint += ( size + 31 ) & ~31;
|
||||
allocPoint += (size + 31) & ~31;
|
||||
|
||||
UI_LogFuncEnd();
|
||||
return p;
|
||||
|
@ -60,7 +62,7 @@ void *UI_Alloc( int32_t size ) {
|
|||
UI_InitMemory
|
||||
===============
|
||||
*/
|
||||
void UI_InitMemory( void ) {
|
||||
void UI_InitMemory(void) {
|
||||
UI_LogFuncBegin();
|
||||
allocPoint = 0;
|
||||
outOfMemory = qfalse;
|
||||
|
@ -72,7 +74,7 @@ void UI_InitMemory( void ) {
|
|||
UI_ParseInfos
|
||||
===============
|
||||
*/
|
||||
int32_t UI_ParseInfos( char *buf, int32_t max, char *infos[] ) {
|
||||
int32_t UI_ParseInfos(char *buf, int32_t max, char *infos[]) {
|
||||
UI_LogFuncBegin();
|
||||
char *token;
|
||||
int32_t count;
|
||||
|
@ -81,38 +83,38 @@ int32_t UI_ParseInfos( char *buf, int32_t max, char *infos[] ) {
|
|||
|
||||
count = 0;
|
||||
|
||||
while ( 1 ) {
|
||||
token = COM_Parse( &buf );
|
||||
if ( !token[0] ) {
|
||||
while (1) {
|
||||
token = COM_Parse(&buf);
|
||||
if (!token[0]) {
|
||||
break;
|
||||
}
|
||||
if ( strcmp( token, "{" ) ) {
|
||||
UI_Logger( LL_ERROR, "Missing { in info file\n" );
|
||||
if (strcmp(token, "{")) {
|
||||
UI_Logger(LL_ERROR, "Missing { in info file\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if ( count == max ) {
|
||||
UI_Logger( LL_ERROR, "Max infos exceeded\n" );
|
||||
if (count == max) {
|
||||
UI_Logger(LL_ERROR, "Max infos exceeded\n");
|
||||
break;
|
||||
}
|
||||
|
||||
info[0] = '\0';
|
||||
while ( 1 ) {
|
||||
token = COM_ParseExt( &buf, qtrue );
|
||||
if ( !token[0] ) {
|
||||
UI_Logger( LL_ERROR, "Unexpected end of info file\n" );
|
||||
while (1) {
|
||||
token = COM_ParseExt(&buf, qtrue);
|
||||
if (!token[0]) {
|
||||
UI_Logger(LL_ERROR, "Unexpected end of info file\n");
|
||||
break;
|
||||
}
|
||||
if ( !strcmp( token, "}" ) ) {
|
||||
if (!strcmp(token, "}")) {
|
||||
break;
|
||||
}
|
||||
Q_strncpyz( key, token, sizeof( key ) );
|
||||
Q_strncpyz(key, token, sizeof(key));
|
||||
|
||||
token = COM_ParseExt( &buf, qfalse );
|
||||
if ( !token[0] ) {
|
||||
strcpy( token, "<NULL>" );
|
||||
token = COM_ParseExt(&buf, qfalse);
|
||||
if (!token[0]) {
|
||||
strcpy(token, "<NULL>");
|
||||
}
|
||||
Info_SetValueForKey( info, key, token );
|
||||
Info_SetValueForKey(info, key, token);
|
||||
}
|
||||
//NOTE: extra space for arena number
|
||||
infos[count] = UI_Alloc(strlen(info) + strlen("\\num\\") + strlen(va("%d", MAX_ARENAS)) + 1);
|
||||
|
@ -130,30 +132,30 @@ int32_t UI_ParseInfos( char *buf, int32_t max, char *infos[] ) {
|
|||
UI_LoadArenasFromFile
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadArenasFromFile( char *filename ) {
|
||||
static void UI_LoadArenasFromFile(char *filename) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t len;
|
||||
fileHandle_t f;
|
||||
char buf[MAX_ARENAS_TEXT];
|
||||
|
||||
len = trap_FS_FOpenFile( filename, &f, FS_READ );
|
||||
if ( !f ) {
|
||||
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
|
||||
len = trap_FS_FOpenFile(filename, &f, FS_READ);
|
||||
if (!f) {
|
||||
trap_Print(va(S_COLOR_RED "file not found: %s\n", filename));
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
if ( len >= MAX_ARENAS_TEXT ) {
|
||||
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_ARENAS_TEXT ) );
|
||||
trap_FS_FCloseFile( f );
|
||||
if (len >= MAX_ARENAS_TEXT) {
|
||||
trap_Print(va(S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_ARENAS_TEXT));
|
||||
trap_FS_FCloseFile(f);
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buf, len, f );
|
||||
trap_FS_Read(buf, len, f);
|
||||
buf[len] = 0;
|
||||
trap_FS_FCloseFile( f );
|
||||
trap_FS_FCloseFile(f);
|
||||
|
||||
ui_numArenas += UI_ParseInfos( buf, MAX_ARENAS - ui_numArenas, &ui_arenaInfos[ui_numArenas] );
|
||||
ui_numArenas += UI_ParseInfos(buf, MAX_ARENAS - ui_numArenas, &ui_arenaInfos[ui_numArenas]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,7 +164,7 @@ static void UI_LoadArenasFromFile( char *filename ) {
|
|||
UI_LoadArenas
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadArenas( void ) {
|
||||
static void UI_LoadArenas(void) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t numdirs;
|
||||
vmCvar_t arenasFile;
|
||||
|
@ -176,8 +178,8 @@ static void UI_LoadArenas( void ) {
|
|||
|
||||
ui_numArenas = 0;
|
||||
|
||||
trap_Cvar_Register( &arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM );
|
||||
if( *arenasFile.string )
|
||||
trap_Cvar_Register(&arenasFile, "g_arenasFile", "", CVAR_INIT | CVAR_ROM);
|
||||
if (*arenasFile.string)
|
||||
{
|
||||
UI_LoadArenasFromFile(arenasFile.string);
|
||||
}
|
||||
|
@ -187,39 +189,39 @@ static void UI_LoadArenas( void ) {
|
|||
}
|
||||
|
||||
// get all arenas from .arena files
|
||||
numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, DIRLIST_SIZE );
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs && ui_numArenas < 1024; i++, dirptr += dirlen+1)
|
||||
numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, DIRLIST_SIZE);
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs && ui_numArenas < 1024; i++, dirptr += dirlen + 1)
|
||||
{
|
||||
dirlen = strlen(dirptr);
|
||||
strcpy(filename, "scripts/");
|
||||
strcat(filename, dirptr);
|
||||
UI_LoadArenasFromFile(filename);
|
||||
}
|
||||
trap_Print( va( "%i arenas parsed\n", ui_numArenas ) );
|
||||
trap_Print(va("%i arenas parsed\n", ui_numArenas));
|
||||
if (outOfMemory) trap_Print(S_COLOR_YELLOW"WARNING: not enough memory in pool to load all arenas\n");
|
||||
|
||||
// set initial numbers
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", n ) );
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
Info_SetValueForKey(ui_arenaInfos[n], "num", va("%i", n));
|
||||
}
|
||||
|
||||
// go through and count single players levels
|
||||
ui_numSinglePlayerArenas = 0;
|
||||
ui_numSpecialSinglePlayerArenas = 0;
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
// determine type
|
||||
type = Info_ValueForKey( ui_arenaInfos[n], "type" );
|
||||
type = Info_ValueForKey(ui_arenaInfos[n], "type");
|
||||
|
||||
// if no type specified, it will be treated as "ffa"
|
||||
if( !*type ) {
|
||||
if (!*type) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( strstr( type, "single" ) ) {
|
||||
if (strstr(type, "single")) {
|
||||
// check for special single player arenas (training, final)
|
||||
tag = Info_ValueForKey( ui_arenaInfos[n], "special" );
|
||||
if( *tag ) {
|
||||
tag = Info_ValueForKey(ui_arenaInfos[n], "special");
|
||||
if (*tag) {
|
||||
ui_numSpecialSinglePlayerArenas++;
|
||||
continue;
|
||||
}
|
||||
|
@ -232,26 +234,26 @@ static void UI_LoadArenas( void ) {
|
|||
singlePlayerNum = 0;
|
||||
specialNum = singlePlayerNum + ui_numSinglePlayerArenas;
|
||||
otherNum = specialNum + ui_numSpecialSinglePlayerArenas;
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
// determine type
|
||||
type = Info_ValueForKey( ui_arenaInfos[n], "type" );
|
||||
type = Info_ValueForKey(ui_arenaInfos[n], "type");
|
||||
|
||||
// if no type specified, it will be treated as "ffa"
|
||||
if( *type ) {
|
||||
if( strstr( type, "single" ) ) {
|
||||
if (*type) {
|
||||
if (strstr(type, "single")) {
|
||||
// check for special single player arenas (training, final)
|
||||
tag = Info_ValueForKey( ui_arenaInfos[n], "special" );
|
||||
if( *tag ) {
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", specialNum++ ) );
|
||||
tag = Info_ValueForKey(ui_arenaInfos[n], "special");
|
||||
if (*tag) {
|
||||
Info_SetValueForKey(ui_arenaInfos[n], "num", va("%i", specialNum++));
|
||||
continue;
|
||||
}
|
||||
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", singlePlayerNum++ ) );
|
||||
Info_SetValueForKey(ui_arenaInfos[n], "num", va("%i", singlePlayerNum++));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", otherNum++ ) );
|
||||
Info_SetValueForKey(ui_arenaInfos[n], "num", va("%i", otherNum++));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,20 +262,20 @@ static void UI_LoadArenas( void ) {
|
|||
UI_GetArenaInfoByNumber
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetArenaInfoByNumber( int32_t num ) {
|
||||
const char *UI_GetArenaInfoByNumber(int32_t num) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t n;
|
||||
char *value;
|
||||
|
||||
if( num < 0 || num >= ui_numArenas ) {
|
||||
trap_Print( va( S_COLOR_RED "Invalid arena number: %i\n", num ) );
|
||||
if (num < 0 || num >= ui_numArenas) {
|
||||
trap_Print(va(S_COLOR_RED "Invalid arena number: %i\n", num));
|
||||
UI_LogFuncEnd();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
value = Info_ValueForKey( ui_arenaInfos[n], "num" );
|
||||
if( *value && atoi(value) == num ) {
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
value = Info_ValueForKey(ui_arenaInfos[n], "num");
|
||||
if (*value && atoi(value) == num) {
|
||||
UI_LogFuncEnd();
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
|
@ -288,12 +290,12 @@ const char *UI_GetArenaInfoByNumber( int32_t num ) {
|
|||
UI_GetArenaInfoByMap
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetArenaInfoByMap( const char *map ) {
|
||||
const char *UI_GetArenaInfoByMap(const char *map) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t n;
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "map" ), map ) == 0 ) {
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
if (Q_stricmp(Info_ValueForKey(ui_arenaInfos[n], "map"), map) == 0) {
|
||||
UI_LogFuncEnd();
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
|
@ -308,12 +310,12 @@ const char *UI_GetArenaInfoByMap( const char *map ) {
|
|||
UI_GetSpecialArenaInfo
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetSpecialArenaInfo( const char *tag ) {
|
||||
const char *UI_GetSpecialArenaInfo(const char *tag) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t n;
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "special" ), tag ) == 0 ) {
|
||||
for (n = 0; n < ui_numArenas; n++) {
|
||||
if (Q_stricmp(Info_ValueForKey(ui_arenaInfos[n], "special"), tag) == 0) {
|
||||
UI_LogFuncEnd();
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
|
@ -327,30 +329,30 @@ const char *UI_GetSpecialArenaInfo( const char *tag ) {
|
|||
UI_LoadBotsFromFile
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadBotsFromFile( char *filename ) {
|
||||
static void UI_LoadBotsFromFile(char *filename) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t len;
|
||||
fileHandle_t f;
|
||||
char buf[MAX_BOTS_TEXT];
|
||||
|
||||
len = trap_FS_FOpenFile( filename, &f, FS_READ );
|
||||
if ( !f ) {
|
||||
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
|
||||
len = trap_FS_FOpenFile(filename, &f, FS_READ);
|
||||
if (!f) {
|
||||
trap_Print(va(S_COLOR_RED "file not found: %s\n", filename));
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
if ( len >= MAX_BOTS_TEXT ) {
|
||||
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_BOTS_TEXT ) );
|
||||
trap_FS_FCloseFile( f );
|
||||
if (len >= MAX_BOTS_TEXT) {
|
||||
trap_Print(va(S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_BOTS_TEXT));
|
||||
trap_FS_FCloseFile(f);
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buf, len, f );
|
||||
trap_FS_Read(buf, len, f);
|
||||
buf[len] = 0;
|
||||
trap_FS_FCloseFile( f );
|
||||
trap_FS_FCloseFile(f);
|
||||
|
||||
ui_numBots += UI_ParseInfos( buf, MAX_BOTS - ui_numBots, &ui_botInfos[ui_numBots] );
|
||||
ui_numBots += UI_ParseInfos(buf, MAX_BOTS - ui_numBots, &ui_botInfos[ui_numBots]);
|
||||
if (outOfMemory) trap_Print(S_COLOR_YELLOW"WARNING: not enough memory in pool to load all bots\n");
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -361,7 +363,7 @@ static void UI_LoadBotsFromFile( char *filename ) {
|
|||
UI_LoadBots
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadBots( void ) {
|
||||
static void UI_LoadBots(void) {
|
||||
UI_LogFuncBegin();
|
||||
vmCvar_t botsFile;
|
||||
int32_t numdirs;
|
||||
|
@ -372,8 +374,8 @@ static void UI_LoadBots( void ) {
|
|||
|
||||
ui_numBots = 0;
|
||||
|
||||
trap_Cvar_Register( &botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM );
|
||||
if( *botsFile.string ) {
|
||||
trap_Cvar_Register(&botsFile, "g_botsFile", "", CVAR_INIT | CVAR_ROM);
|
||||
if (*botsFile.string) {
|
||||
UI_LoadBotsFromFile(botsFile.string);
|
||||
}
|
||||
else {
|
||||
|
@ -381,16 +383,16 @@ static void UI_LoadBots( void ) {
|
|||
}
|
||||
|
||||
// get all bots from .bot files
|
||||
numdirs = trap_FS_GetFileList("scripts", ".bot", dirlist, DIRLIST_SIZE );
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs; i++, dirptr += dirlen+1)
|
||||
numdirs = trap_FS_GetFileList("scripts", ".bot", dirlist, DIRLIST_SIZE);
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs; i++, dirptr += dirlen + 1)
|
||||
{
|
||||
dirlen = strlen(dirptr);
|
||||
strcpy(filename, "scripts/");
|
||||
strcat(filename, dirptr);
|
||||
UI_LoadBotsFromFile(filename);
|
||||
}
|
||||
trap_Print( va( "%i bots parsed\n", ui_numBots ) );
|
||||
trap_Print(va("%i bots parsed\n", ui_numBots));
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -400,10 +402,10 @@ static void UI_LoadBots( void ) {
|
|||
UI_GetBotInfoByNumber
|
||||
===============
|
||||
*/
|
||||
char *UI_GetBotInfoByNumber( int32_t num ) {
|
||||
char *UI_GetBotInfoByNumber(int32_t num) {
|
||||
UI_LogFuncBegin();
|
||||
if( num < 0 || num >= ui_numBots ) {
|
||||
trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) );
|
||||
if (num < 0 || num >= ui_numBots) {
|
||||
trap_Print(va(S_COLOR_RED "Invalid bot number: %i\n", num));
|
||||
UI_LogFuncEnd();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -417,14 +419,14 @@ char *UI_GetBotInfoByNumber( int32_t num ) {
|
|||
UI_GetBotInfoByName
|
||||
===============
|
||||
*/
|
||||
char *UI_GetBotInfoByName( const char *name ) {
|
||||
char *UI_GetBotInfoByName(const char *name) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t n;
|
||||
char *value;
|
||||
|
||||
for ( n = 0; n < ui_numBots ; n++ ) {
|
||||
value = Info_ValueForKey( ui_botInfos[n], "name" );
|
||||
if ( !Q_stricmp( value, name ) ) {
|
||||
for (n = 0; n < ui_numBots; n++) {
|
||||
value = Info_ValueForKey(ui_botInfos[n], "name");
|
||||
if (!Q_stricmp(value, name)) {
|
||||
UI_LogFuncEnd();
|
||||
return ui_botInfos[n];
|
||||
}
|
||||
|
@ -445,7 +447,7 @@ UI_GetBestScore
|
|||
Returns the player's best finish on a given level, 0 if the have not played the level
|
||||
===============
|
||||
*/
|
||||
void UI_GetBestScore( int32_t level, int32_t *score, int32_t *skill ) {
|
||||
void UI_GetBestScore(int32_t level, int32_t *score, int32_t *skill) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t n;
|
||||
int32_t skillScore;
|
||||
|
@ -454,12 +456,12 @@ void UI_GetBestScore( int32_t level, int32_t *score, int32_t *skill ) {
|
|||
char arenaKey[16];
|
||||
char scores[MAX_INFO_VALUE];
|
||||
|
||||
if( !score || !skill ) {
|
||||
if (!score || !skill) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
if( level < 0 || level > ui_numArenas ) {
|
||||
if (level < 0 || level > ui_numArenas) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
@ -467,17 +469,17 @@ void UI_GetBestScore( int32_t level, int32_t *score, int32_t *skill ) {
|
|||
bestScore = 0;
|
||||
bestScoreSkill = 0;
|
||||
|
||||
for( n = 1; n <= 5; n++ ) {
|
||||
trap_Cvar_VariableStringBuffer( va( "g_spScores%i", n ), scores, MAX_INFO_VALUE );
|
||||
for (n = 1; n <= 5; n++) {
|
||||
trap_Cvar_VariableStringBuffer(va("g_spScores%i", n), scores, MAX_INFO_VALUE);
|
||||
|
||||
Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
|
||||
skillScore = atoi( Info_ValueForKey( scores, arenaKey ) );
|
||||
Com_sprintf(arenaKey, sizeof(arenaKey), "l%i", level);
|
||||
skillScore = atoi(Info_ValueForKey(scores, arenaKey));
|
||||
|
||||
if( skillScore < 1 || skillScore > 8 ) {
|
||||
if (skillScore < 1 || skillScore > 8) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !bestScore || skillScore <= bestScore ) {
|
||||
if (!bestScore || skillScore <= bestScore) {
|
||||
bestScore = skillScore;
|
||||
bestScoreSkill = n;
|
||||
}
|
||||
|
@ -496,7 +498,7 @@ UI_SetBestScore
|
|||
Set the player's best finish for a level
|
||||
===============
|
||||
*/
|
||||
void UI_SetBestScore( int32_t level, int32_t score ) {
|
||||
void UI_SetBestScore(int32_t level, int32_t score) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t skill;
|
||||
int32_t oldScore;
|
||||
|
@ -504,32 +506,32 @@ void UI_SetBestScore( int32_t level, int32_t score ) {
|
|||
char scores[MAX_INFO_VALUE];
|
||||
|
||||
// validate score
|
||||
if( score < 1 || score > 8 ) {
|
||||
if (score < 1 || score > 8) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
// validate skill
|
||||
skill = (int32_t)trap_Cvar_VariableValue( "g_spSkill" );
|
||||
if( skill < 1 || skill > 5 ) {
|
||||
skill = (int32_t)trap_Cvar_VariableValue("g_spSkill");
|
||||
if (skill < 1 || skill > 5) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
// get scores
|
||||
trap_Cvar_VariableStringBuffer( va( "g_spScores%i", skill ), scores, MAX_INFO_VALUE );
|
||||
trap_Cvar_VariableStringBuffer(va("g_spScores%i", skill), scores, MAX_INFO_VALUE);
|
||||
|
||||
// see if this is better
|
||||
Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
|
||||
oldScore = atoi( Info_ValueForKey( scores, arenaKey ) );
|
||||
if( oldScore && oldScore <= score ) {
|
||||
Com_sprintf(arenaKey, sizeof(arenaKey), "l%i", level);
|
||||
oldScore = atoi(Info_ValueForKey(scores, arenaKey));
|
||||
if (oldScore && oldScore <= score) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
// update scores
|
||||
Info_SetValueForKey( scores, arenaKey, va( "%i", score ) );
|
||||
trap_Cvar_Set( va( "g_spScores%i", skill ), scores );
|
||||
Info_SetValueForKey(scores, arenaKey, va("%i", score));
|
||||
trap_Cvar_Set(va("g_spScores%i", skill), scores);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -539,30 +541,30 @@ void UI_SetBestScore( int32_t level, int32_t score ) {
|
|||
UI_LogAwardData
|
||||
===============
|
||||
*/
|
||||
void UI_LogAwardData( int32_t award, int32_t data ) {
|
||||
void UI_LogAwardData(int32_t award, int32_t data) {
|
||||
UI_LogFuncBegin();
|
||||
char key[16];
|
||||
char awardData[MAX_INFO_VALUE];
|
||||
int32_t oldValue;
|
||||
|
||||
if( data == 0 ) {
|
||||
if (data == 0) {
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
if( award >= AWARD_MAX ) {
|
||||
trap_Print( va( S_COLOR_RED "Bad award %i in UI_LogAwardData\n", award ) );
|
||||
if (award >= AWARD_MAX) {
|
||||
trap_Print(va(S_COLOR_RED "Bad award %i in UI_LogAwardData\n", award));
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
|
||||
trap_Cvar_VariableStringBuffer("g_spAwards", awardData, sizeof(awardData));
|
||||
|
||||
Com_sprintf( key, sizeof(key), "a%i", award );
|
||||
oldValue = atoi( Info_ValueForKey( awardData, key ) );
|
||||
Com_sprintf(key, sizeof(key), "a%i", award);
|
||||
oldValue = atoi(Info_ValueForKey(awardData, key));
|
||||
|
||||
Info_SetValueForKey( awardData, key, va( "%i", oldValue + data ) );
|
||||
trap_Cvar_Set( "g_spAwards", awardData );
|
||||
Info_SetValueForKey(awardData, key, va("%i", oldValue + data));
|
||||
trap_Cvar_Set("g_spAwards", awardData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -571,16 +573,16 @@ void UI_LogAwardData( int32_t award, int32_t data ) {
|
|||
UI_GetAwardLevel
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetAwardLevel( int32_t award ) {
|
||||
int32_t UI_GetAwardLevel(int32_t award) {
|
||||
UI_LogFuncBegin();
|
||||
char key[16];
|
||||
char awardData[MAX_INFO_VALUE];
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
|
||||
trap_Cvar_VariableStringBuffer("g_spAwards", awardData, sizeof(awardData));
|
||||
|
||||
Com_sprintf( key, sizeof(key), "a%i", award );
|
||||
Com_sprintf(key, sizeof(key), "a%i", award);
|
||||
UI_LogFuncEnd();
|
||||
return atoi( Info_ValueForKey( awardData, key ) );
|
||||
return atoi(Info_ValueForKey(awardData, key));
|
||||
}
|
||||
|
||||
|
||||
|
@ -589,7 +591,7 @@ int32_t UI_GetAwardLevel( int32_t award ) {
|
|||
UI_TierCompleted
|
||||
===============
|
||||
*/
|
||||
int32_t UI_TierCompleted( int32_t levelWon ) {
|
||||
int32_t UI_TierCompleted(int32_t levelWon) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t level;
|
||||
int32_t n;
|
||||
|
@ -602,14 +604,14 @@ int32_t UI_TierCompleted( int32_t levelWon ) {
|
|||
tier = levelWon / ARENAS_PER_TIER;
|
||||
level = tier * ARENAS_PER_TIER;
|
||||
|
||||
if( tier == UI_GetNumSPTiers() ) {
|
||||
info = UI_GetSpecialArenaInfo( "training" );
|
||||
if( levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
|
||||
if (tier == UI_GetNumSPTiers()) {
|
||||
info = UI_GetSpecialArenaInfo("training");
|
||||
if (levelWon == atoi(Info_ValueForKey(info, "num"))) {
|
||||
UI_LogFuncEnd();
|
||||
return 0;
|
||||
}
|
||||
info = UI_GetSpecialArenaInfo( "final" );
|
||||
if( !info || levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
|
||||
info = UI_GetSpecialArenaInfo("final");
|
||||
if (!info || levelWon == atoi(Info_ValueForKey(info, "num"))) {
|
||||
UI_LogFuncEnd();
|
||||
return tier + 1;
|
||||
}
|
||||
|
@ -619,12 +621,13 @@ int32_t UI_TierCompleted( int32_t levelWon ) {
|
|||
|
||||
if (uis.demoversion) {
|
||||
maxarenas = 2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
maxarenas = ARENAS_PER_TIER;
|
||||
}
|
||||
for( n = 0; n < maxarenas; n++, level++ ) {
|
||||
UI_GetBestScore( level, &score, &skill );
|
||||
if ( score != 1 ) {
|
||||
for (n = 0; n < maxarenas; n++, level++) {
|
||||
UI_GetBestScore(level, &score, &skill);
|
||||
if (score != 1) {
|
||||
UI_LogFuncEnd();
|
||||
return -1;
|
||||
}
|
||||
|
@ -642,51 +645,51 @@ UI_GetCurrentGame
|
|||
Returns the next level the player has not won
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetCurrentGame( int32_t curLevel ) {
|
||||
int32_t UI_GetCurrentGame(int32_t curLevel) {
|
||||
UI_LogFuncBegin();
|
||||
int32_t level;
|
||||
int32_t rank;
|
||||
int32_t skill;
|
||||
const char *info;
|
||||
|
||||
info = UI_GetSpecialArenaInfo( "training" );
|
||||
if( info ) {
|
||||
level = atoi( Info_ValueForKey( info, "num" ) );
|
||||
UI_GetBestScore( level, &rank, &skill );
|
||||
if ( !rank || rank > 1 ) {
|
||||
info = UI_GetSpecialArenaInfo("training");
|
||||
if (info) {
|
||||
level = atoi(Info_ValueForKey(info, "num"));
|
||||
UI_GetBestScore(level, &rank, &skill);
|
||||
if (!rank || rank > 1) {
|
||||
UI_LogFuncEnd();
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
// kef 7/31/00 -- we think we'd like to just send you to the next map, not the first map you haven't won
|
||||
|
||||
|
||||
if (curLevel == -1)
|
||||
{
|
||||
// -1 is a special value, the meaning of which is not currently clear to me
|
||||
for( level = 0; level < ui_numSinglePlayerArenas; level++ ) {
|
||||
UI_GetBestScore( level, &rank, &skill );
|
||||
if ( !rank || rank > 1 )
|
||||
for (level = 0; level < ui_numSinglePlayerArenas; level++) {
|
||||
UI_GetBestScore(level, &rank, &skill);
|
||||
if (!rank || rank > 1)
|
||||
{
|
||||
UI_LogFuncEnd();
|
||||
return level;
|
||||
}
|
||||
}
|
||||
info = UI_GetSpecialArenaInfo( "final" );
|
||||
if( !info ) {
|
||||
info = UI_GetSpecialArenaInfo("final");
|
||||
if (!info) {
|
||||
UI_LogFuncEnd();
|
||||
return -1;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
return atoi( Info_ValueForKey( info, "num" ) );
|
||||
return atoi(Info_ValueForKey(info, "num"));
|
||||
}
|
||||
else if ((curLevel >= 0) && (curLevel < (ui_numSinglePlayerArenas-1)))
|
||||
else if ((curLevel >= 0) && (curLevel < (ui_numSinglePlayerArenas - 1)))
|
||||
{
|
||||
// go to next map
|
||||
UI_LogFuncEnd();
|
||||
return curLevel+1;
|
||||
return curLevel + 1;
|
||||
}
|
||||
else if (curLevel == (ui_numSinglePlayerArenas-1))
|
||||
else if (curLevel == (ui_numSinglePlayerArenas - 1))
|
||||
{
|
||||
// finished final map...back to the beginning
|
||||
UI_LogFuncEnd();
|
||||
|
@ -695,13 +698,13 @@ int32_t UI_GetCurrentGame( int32_t curLevel ) {
|
|||
else
|
||||
{
|
||||
// bogus value for curLevel
|
||||
info = UI_GetSpecialArenaInfo( "final" );
|
||||
if( !info ) {
|
||||
info = UI_GetSpecialArenaInfo("final");
|
||||
if (!info) {
|
||||
UI_LogFuncEnd();
|
||||
return -1;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
return atoi( Info_ValueForKey( info, "num" ) );
|
||||
return atoi(Info_ValueForKey(info, "num"));
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -714,15 +717,15 @@ UI_NewGame
|
|||
Clears the scores and sets the difficutly level
|
||||
===============
|
||||
*/
|
||||
void UI_NewGame( void ) {
|
||||
void UI_NewGame(void) {
|
||||
UI_LogFuncBegin();
|
||||
trap_Cvar_Set( "g_spScores1", "" );
|
||||
trap_Cvar_Set( "g_spScores2", "" );
|
||||
trap_Cvar_Set( "g_spScores3", "" );
|
||||
trap_Cvar_Set( "g_spScores4", "" );
|
||||
trap_Cvar_Set( "g_spScores5", "" );
|
||||
trap_Cvar_Set( "g_spAwards", "" );
|
||||
trap_Cvar_Set( "g_spVideos", "" );
|
||||
trap_Cvar_Set("g_spScores1", "");
|
||||
trap_Cvar_Set("g_spScores2", "");
|
||||
trap_Cvar_Set("g_spScores3", "");
|
||||
trap_Cvar_Set("g_spScores4", "");
|
||||
trap_Cvar_Set("g_spScores5", "");
|
||||
trap_Cvar_Set("g_spAwards", "");
|
||||
trap_Cvar_Set("g_spVideos", "");
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -732,7 +735,7 @@ void UI_NewGame( void ) {
|
|||
UI_GetNumArenas
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetNumArenas( void ) {
|
||||
int32_t UI_GetNumArenas(void) {
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
return ui_numArenas;
|
||||
|
@ -744,7 +747,7 @@ int32_t UI_GetNumArenas( void ) {
|
|||
UI_GetNumSPArenas
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetNumSPArenas( void ) {
|
||||
int32_t UI_GetNumSPArenas(void) {
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
return ui_numSinglePlayerArenas;
|
||||
|
@ -756,7 +759,7 @@ int32_t UI_GetNumSPArenas( void ) {
|
|||
UI_GetNumSPTiers
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetNumSPTiers( void )
|
||||
int32_t UI_GetNumSPTiers(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
int32_t remainder;
|
||||
|
@ -778,7 +781,7 @@ int32_t UI_GetNumSPTiers( void )
|
|||
UI_GetNumBots
|
||||
===============
|
||||
*/
|
||||
int32_t UI_GetNumBots( void ) {
|
||||
int32_t UI_GetNumBots(void) {
|
||||
UI_LogFuncBegin();
|
||||
UI_LogFuncEnd();
|
||||
return ui_numBots;
|
||||
|
@ -790,13 +793,13 @@ int32_t UI_GetNumBots( void ) {
|
|||
UI_InitGameinfo
|
||||
===============
|
||||
*/
|
||||
void UI_InitGameinfo( void ) {
|
||||
void UI_InitGameinfo(void) {
|
||||
UI_LogFuncBegin();
|
||||
UI_InitMemory();
|
||||
UI_LoadArenas();
|
||||
UI_LoadBots();
|
||||
|
||||
if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 2) ) {
|
||||
if ((trap_Cvar_VariableValue("fs_restrict")) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 2)) {
|
||||
uis.demoversion = qtrue;
|
||||
}
|
||||
else {
|
||||
|
|
1181
code/ui/ui_ingame.c
1181
code/ui/ui_ingame.c
File diff suppressed because it is too large
Load diff
5909
code/ui/ui_menu.c
5909
code/ui/ui_menu.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue