mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-02-23 12:31:15 +00:00
more ui updates
This commit is contained in:
parent
71bdb3d0b8
commit
22f826eabd
5 changed files with 2978 additions and 2995 deletions
|
@ -416,22 +416,6 @@
|
|||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UI_EXPORTS</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_team.c">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UI_EXPORTS</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UI_EXPORTS</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_teamorders.c">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UI_EXPORTS</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UI_EXPORTS</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_transporter.c" />
|
||||
<ClCompile Include="ui_turbolift.c" />
|
||||
<ClCompile Include="ui_logger.c" />
|
||||
|
|
|
@ -113,12 +113,6 @@
|
|||
<ClCompile Include="ui_syscalls.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_team.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_teamorders.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui_transporter.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
|
|
@ -2,45 +2,46 @@
|
|||
UI_TRANSPORTER.C
|
||||
|
||||
User interface trigger from within game
|
||||
**********************************************************************/
|
||||
**********************************************************************/
|
||||
#include "ui_local.h"
|
||||
#include "ui_logger.h"
|
||||
|
||||
char *delayList[20] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
|
||||
"11", "12", "13", "14", "15", "20", "30", "60", 0 };
|
||||
static const char* delayList[20] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "20", "30", "60", 0 };
|
||||
|
||||
char srvList[6][MAX_QPATH];
|
||||
int32_t srvCount;
|
||||
char srvList[6][MAX_QPATH];
|
||||
int32_t srvCount;
|
||||
|
||||
typedef struct //static
|
||||
{
|
||||
menuframework_s menu;
|
||||
sfxHandle_t openingVoice;
|
||||
menubitmap_s quitmenu;
|
||||
menubitmap_s engage;
|
||||
menubitmap_s engage2;
|
||||
menulist_s locButton;
|
||||
menulist_s srvButton;
|
||||
menulist_s delButton;
|
||||
sfxHandle_t openingVoice;
|
||||
menubitmap_s quitmenu;
|
||||
menubitmap_s engage;
|
||||
menubitmap_s engage2;
|
||||
menulist_s locButton;
|
||||
menulist_s srvButton;
|
||||
menulist_s delButton;
|
||||
|
||||
char *srvListPtr[7];
|
||||
char *mlist[MAX_QPATH];
|
||||
|
||||
int32_t targetEntID;
|
||||
char* srvListPtr[7];
|
||||
char* mlist[MAX_QPATH];
|
||||
|
||||
int32_t targetEntID;
|
||||
} transporter_t;
|
||||
|
||||
transporter_t s_transporter;
|
||||
transporter_t s_transporter;
|
||||
|
||||
#define ID_COMPUTERVOICE 6
|
||||
enum ui_transporterIDs_e {
|
||||
ID_COMPUTERVOICE = 6,
|
||||
|
||||
#define ID_QUIT 10
|
||||
#define ID_ENGAGE 100
|
||||
#define ID_ENGAGE2 101
|
||||
ID_QUIT = 10,
|
||||
ID_ENGAGE = 100,
|
||||
ID_ENGAGE2
|
||||
};
|
||||
|
||||
extern adminGeneric_t s_adminGeneric;
|
||||
extern void AdminGeneric_InitLists( void );
|
||||
extern void AdminGeneric_InitLists(void);
|
||||
|
||||
void UI_TransporterMenu_Cache (void);
|
||||
void UI_TransporterMenu_Cache(void);
|
||||
|
||||
|
||||
/*static void TransCreateMaplist(void) {
|
||||
|
@ -58,9 +59,9 @@ void TransDataReceived(const char *data) {
|
|||
|
||||
UI_LogFuncBegin();
|
||||
|
||||
for(i = 0; i < 6; i++) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
temp = Info_ValueForKey(data, va("d%i", i));
|
||||
if(!temp[0]) break;
|
||||
if (!temp[0]) break;
|
||||
Q_strncpyz(srvList[i], temp, sizeof(srvList[i]));
|
||||
srvCount++;
|
||||
}
|
||||
|
@ -72,7 +73,7 @@ void TransDataReceived(const char *data) {
|
|||
M_Transporter_Event
|
||||
=================
|
||||
*/
|
||||
static void M_Transporter_Event (void* ptr, int32_t notification)
|
||||
static void M_Transporter_Event(void* ptr, int32_t notification)
|
||||
{
|
||||
int32_t id;
|
||||
//menubitmap_s *holdLocation;
|
||||
|
@ -84,57 +85,57 @@ static void M_Transporter_Event (void* ptr, int32_t notification)
|
|||
|
||||
/*if ( notification != QM_ACTIVATED )
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}*/
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case ID_QUIT:
|
||||
if ( notification == QM_ACTIVATED )
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_ENGAGE: // Active only if a deck has been chosen
|
||||
if ( notification == QM_ACTIVATED ) {
|
||||
if(s_transporter.delButton.curvalue <= 16)
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, s_transporter.delButton.curvalue));
|
||||
case ID_QUIT:
|
||||
if (notification == QM_ACTIVATED)
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_ENGAGE: // Active only if a deck has been chosen
|
||||
if (notification == QM_ACTIVATED) {
|
||||
if (s_transporter.delButton.curvalue <= 16)
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, s_transporter.delButton.curvalue));
|
||||
else {
|
||||
switch (s_transporter.delButton.curvalue) {
|
||||
case 17:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 20));
|
||||
break;
|
||||
case 18:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 30));
|
||||
break;
|
||||
case 19:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 60));
|
||||
break;
|
||||
}
|
||||
}
|
||||
UI_ForceMenuOff();
|
||||
}
|
||||
break;
|
||||
case ID_ENGAGE2: // Active only if a deck has been chosen
|
||||
if (notification == QM_ACTIVATED) {
|
||||
if (srvCount > 0) {
|
||||
if (s_transporter.delButton.curvalue <= 16)
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, s_transporter.delButton.curvalue));
|
||||
else {
|
||||
switch(s_transporter.delButton.curvalue) {
|
||||
case 17:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 20));
|
||||
break;
|
||||
case 18:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 30));
|
||||
break;
|
||||
case 19:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterLoc %i %i %i", s_transporter.targetEntID, s_transporter.locButton.curvalue + 1, 60));
|
||||
break;
|
||||
switch (s_transporter.delButton.curvalue) {
|
||||
case 17:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 20));
|
||||
break;
|
||||
case 18:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 30));
|
||||
break;
|
||||
case 19:
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 60));
|
||||
break;
|
||||
}
|
||||
}
|
||||
UI_ForceMenuOff();
|
||||
}
|
||||
break;
|
||||
case ID_ENGAGE2: // Active only if a deck has been chosen
|
||||
if ( notification == QM_ACTIVATED ) {
|
||||
if(srvCount > 0) {
|
||||
if(s_transporter.delButton.curvalue <= 16)
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue , s_transporter.delButton.curvalue));
|
||||
else {
|
||||
switch(s_transporter.delButton.curvalue) {
|
||||
case 17:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 20));
|
||||
break;
|
||||
case 18:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 30));
|
||||
break;
|
||||
case 19:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("ui_transporterExt %i %i %i", s_transporter.targetEntID, s_transporter.srvButton.curvalue, 60));
|
||||
break;
|
||||
}
|
||||
}
|
||||
UI_ForceMenuOff();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -144,9 +145,9 @@ static void M_Transporter_Event (void* ptr, int32_t notification)
|
|||
TransporterMenu_Key
|
||||
=================
|
||||
*/
|
||||
sfxHandle_t TransporterMenu_Key (int32_t key)
|
||||
sfxHandle_t TransporterMenu_Key(int32_t key)
|
||||
{
|
||||
return ( Menu_DefaultKey( &s_transporter.menu, key ) );
|
||||
return (Menu_DefaultKey(&s_transporter.menu, key));
|
||||
}
|
||||
|
||||
extern qhandle_t leftRound;
|
||||
|
@ -164,11 +165,11 @@ qhandle_t loading5;
|
|||
M_TransporterMenu_Graphics
|
||||
=================
|
||||
*/
|
||||
static void M_TransporterMenu_Graphics (void)
|
||||
static void M_TransporterMenu_Graphics(void)
|
||||
{
|
||||
//menubitmap_s *holdDeck;
|
||||
//int32_t i;
|
||||
int32_t length,xTurboStart;
|
||||
int32_t length, xTurboStart;
|
||||
//int32_t numColor, roundColor;
|
||||
|
||||
UI_LogFuncBegin();
|
||||
|
@ -176,82 +177,82 @@ static void M_TransporterMenu_Graphics (void)
|
|||
// 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_LTPURPLE1] ); //colorTable[CT_LTBLUE1] //[CT_DKGOLD1] //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 70, 56, 128, 128, transporter_sym); // Transporter graphic
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
|
||||
UI_DrawHandlePic(20, 24, 64, 32, corner_ul_24_60); // Upper corner
|
||||
trap_R_SetColor(colorTable[CT_LTPURPLE1]); //colorTable[CT_LTBLUE1] //[CT_DKGOLD1] //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic(70, 56, 128, 128, transporter_sym); // Transporter graphic
|
||||
|
||||
// Lower corners
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 20, 440, 64, 16, corner_ll_12_60); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic(20, 440, 64, 16, corner_ll_12_60); //
|
||||
|
||||
xTurboStart = 604;
|
||||
length = UI_ProportionalStringWidth( menu_normal_text[MNT_TRANSPORTER],UI_BIGFONT);
|
||||
length = UI_ProportionalStringWidth(menu_normal_text[MNT_TRANSPORTER], 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); //
|
||||
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); //
|
||||
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
|
||||
|
||||
|
||||
UI_DrawProportionalString( xTurboStart, 24,
|
||||
menu_normal_text[MNT_TRANSPORTER], UI_BIGFONT | UI_RIGHT, colorTable[CT_WHITE]);
|
||||
UI_DrawProportionalString(xTurboStart, 24,
|
||||
menu_normal_text[MNT_TRANSPORTER], 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);
|
||||
|
||||
trap_R_SetColor( colorTable[CT_LTGOLD1] );
|
||||
UI_DrawHandlePic( 86, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 86, 290, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 86, 340, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 86, 390, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 164, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 164, 290, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 164, 340, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 164, 390, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 242, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 242, 290, 76, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 242, 340, 76, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic( 242, 390, 76, 46, uis.whiteShader);
|
||||
trap_R_SetColor(colorTable[CT_LTGOLD1]);
|
||||
UI_DrawHandlePic(86, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(86, 290, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(86, 340, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(86, 390, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(164, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(164, 290, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(164, 340, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(164, 390, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(242, 240, 74, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(242, 290, 76, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(242, 340, 76, 46, uis.whiteShader);
|
||||
UI_DrawHandlePic(242, 390, 76, 46, uis.whiteShader);
|
||||
|
||||
trap_R_SetColor( colorTable[CT_LTPURPLE1] );
|
||||
UI_DrawHandlePic( 84, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 158, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 162, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 236, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 240, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 316, 192, -2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic( 84, 192, 74, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic( 162, 192, 74, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic( 240, 192, 76, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic( 84, 435, 76, -2, uis.whiteShader);
|
||||
UI_DrawHandlePic( 162, 435, 76, -2, uis.whiteShader);
|
||||
UI_DrawHandlePic( 240, 435, 78, -2, uis.whiteShader);
|
||||
trap_R_SetColor(colorTable[CT_LTPURPLE1]);
|
||||
UI_DrawHandlePic(84, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(158, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(162, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(236, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(240, 192, 2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(316, 192, -2, 243, uis.whiteShader);
|
||||
UI_DrawHandlePic(84, 192, 74, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic(162, 192, 74, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic(240, 192, 76, 2, uis.whiteShader);
|
||||
UI_DrawHandlePic(84, 435, 76, -2, uis.whiteShader);
|
||||
UI_DrawHandlePic(162, 435, 76, -2, uis.whiteShader);
|
||||
UI_DrawHandlePic(240, 435, 78, -2, uis.whiteShader);
|
||||
|
||||
trap_R_SetColor( colorTable[CT_LTBLUE1] );
|
||||
UI_DrawHandlePic( 366, 208, 243, 212, loading2 );
|
||||
trap_R_SetColor( colorTable[CT_LTGOLD1] );
|
||||
UI_DrawHandlePic( 366, 208, 243, 212, loading3 );
|
||||
UI_DrawHandlePic( 366, 208, 243, 212, loading1 );
|
||||
trap_R_SetColor( colorTable[CT_DKBLUE1] );
|
||||
UI_DrawHandlePic( 366, 208, 243, 212, loading4 );
|
||||
trap_R_SetColor( colorTable[CT_DKORANGE] );
|
||||
UI_DrawHandlePic( 366, 208, 243, 212, loading5 );
|
||||
trap_R_SetColor(colorTable[CT_LTBLUE1]);
|
||||
UI_DrawHandlePic(366, 208, 243, 212, loading2);
|
||||
trap_R_SetColor(colorTable[CT_LTGOLD1]);
|
||||
UI_DrawHandlePic(366, 208, 243, 212, loading3);
|
||||
UI_DrawHandlePic(366, 208, 243, 212, loading1);
|
||||
trap_R_SetColor(colorTable[CT_DKBLUE1]);
|
||||
UI_DrawHandlePic(366, 208, 243, 212, loading4);
|
||||
trap_R_SetColor(colorTable[CT_DKORANGE]);
|
||||
UI_DrawHandlePic(366, 208, 243, 212, loading5);
|
||||
|
||||
UI_DrawProportionalString(487, 297, "1", UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
UI_DrawProportionalString(508, 297, "2", UI_TINYFONT, colorTable[CT_BLACK]);
|
||||
|
@ -279,8 +280,8 @@ static void TransporterMenu_Draw(void)
|
|||
// Draw graphics particular to Main Menu
|
||||
|
||||
M_TransporterMenu_Graphics();
|
||||
|
||||
Menu_Draw( &s_transporter.menu );
|
||||
|
||||
Menu_Draw(&s_transporter.menu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -289,8 +290,8 @@ static void TransporterMenu_Draw(void)
|
|||
UI_TransporterMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_TransporterMenu_Cache (void)
|
||||
{
|
||||
void UI_TransporterMenu_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");
|
||||
|
@ -311,7 +312,7 @@ TransporterMenu_Init
|
|||
*/
|
||||
void TransporterMenu_Init(void)
|
||||
{
|
||||
int32_t y,pad,x;
|
||||
int32_t y, pad, x;
|
||||
//int32_t i;
|
||||
int32_t width;
|
||||
|
||||
|
@ -319,136 +320,136 @@ void TransporterMenu_Init(void)
|
|||
|
||||
AdminGeneric_InitLists();
|
||||
|
||||
s_transporter.menu.nitems = 0;
|
||||
s_transporter.menu.draw = TransporterMenu_Draw;
|
||||
s_transporter.menu.key = TransporterMenu_Key;
|
||||
s_transporter.menu.wrapAround = qtrue;
|
||||
s_transporter.menu.descX = MENU_DESC_X;
|
||||
s_transporter.menu.descY = MENU_DESC_Y;
|
||||
s_transporter.menu.titleX = MENU_TITLE_X;
|
||||
s_transporter.menu.titleY = MENU_TITLE_Y;
|
||||
s_transporter.menu.nitems = 0;
|
||||
s_transporter.menu.draw = TransporterMenu_Draw;
|
||||
s_transporter.menu.key = TransporterMenu_Key;
|
||||
s_transporter.menu.wrapAround = qtrue;
|
||||
s_transporter.menu.descX = MENU_DESC_X;
|
||||
s_transporter.menu.descY = MENU_DESC_Y;
|
||||
s_transporter.menu.titleX = MENU_TITLE_X;
|
||||
s_transporter.menu.titleY = MENU_TITLE_Y;
|
||||
|
||||
pad = PROP_BIG_HEIGHT + 10;
|
||||
width = MENU_BUTTON_MED_WIDTH-20;
|
||||
width = MENU_BUTTON_MED_WIDTH - 20;
|
||||
y = 72;
|
||||
x = 208;
|
||||
|
||||
s_transporter.engage.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.engage.generic.x = x;
|
||||
s_transporter.engage.generic.y = y;
|
||||
s_transporter.engage.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.engage.generic.id = ID_ENGAGE;
|
||||
s_transporter.engage.generic.callback = M_Transporter_Event;
|
||||
s_transporter.engage.width = width;
|
||||
s_transporter.engage.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.engage.color = CT_DKPURPLE1;
|
||||
s_transporter.engage.color2 = CT_LTPURPLE1;
|
||||
s_transporter.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.engage.textY = 12;
|
||||
s_transporter.engage.textEnum = MBT_ENGAGE;
|
||||
s_transporter.engage.textcolor = CT_BLACK;
|
||||
s_transporter.engage.textcolor2 = CT_WHITE;
|
||||
s_transporter.engage.textStyle = UI_TINYFONT;
|
||||
s_transporter.engage.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.engage.generic.x = x;
|
||||
s_transporter.engage.generic.y = y;
|
||||
s_transporter.engage.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.engage.generic.id = ID_ENGAGE;
|
||||
s_transporter.engage.generic.callback = M_Transporter_Event;
|
||||
s_transporter.engage.width = width;
|
||||
s_transporter.engage.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.engage.color = CT_DKPURPLE1;
|
||||
s_transporter.engage.color2 = CT_LTPURPLE1;
|
||||
s_transporter.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.engage.textY = 12;
|
||||
s_transporter.engage.textEnum = MBT_ENGAGE;
|
||||
s_transporter.engage.textcolor = CT_BLACK;
|
||||
s_transporter.engage.textcolor2 = CT_WHITE;
|
||||
s_transporter.engage.textStyle = UI_TINYFONT;
|
||||
|
||||
y += pad;
|
||||
|
||||
s_transporter.engage2.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.engage2.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.engage2.generic.x = x;
|
||||
s_transporter.engage2.generic.y = y;
|
||||
s_transporter.engage2.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.engage2.generic.id = ID_ENGAGE2;
|
||||
s_transporter.engage2.generic.callback = M_Transporter_Event;
|
||||
s_transporter.engage2.width = width;
|
||||
s_transporter.engage2.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.engage2.color = CT_DKPURPLE1;
|
||||
s_transporter.engage2.color2 = CT_LTPURPLE1;
|
||||
s_transporter.engage2.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.engage2.textY = 12;
|
||||
s_transporter.engage2.textEnum = MBT_ENGAGE;
|
||||
s_transporter.engage2.textcolor = CT_BLACK;
|
||||
s_transporter.engage2.textcolor2 = CT_WHITE;
|
||||
s_transporter.engage2.textStyle = UI_TINYFONT;
|
||||
s_transporter.engage2.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.engage2.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.engage2.generic.x = x;
|
||||
s_transporter.engage2.generic.y = y;
|
||||
s_transporter.engage2.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.engage2.generic.id = ID_ENGAGE2;
|
||||
s_transporter.engage2.generic.callback = M_Transporter_Event;
|
||||
s_transporter.engage2.width = width;
|
||||
s_transporter.engage2.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.engage2.color = CT_DKPURPLE1;
|
||||
s_transporter.engage2.color2 = CT_LTPURPLE1;
|
||||
s_transporter.engage2.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.engage2.textY = 12;
|
||||
s_transporter.engage2.textEnum = MBT_ENGAGE;
|
||||
s_transporter.engage2.textcolor = CT_BLACK;
|
||||
s_transporter.engage2.textcolor2 = CT_WHITE;
|
||||
s_transporter.engage2.textStyle = UI_TINYFONT;
|
||||
|
||||
y += pad;
|
||||
|
||||
s_transporter.quitmenu.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.quitmenu.generic.x = x;
|
||||
s_transporter.quitmenu.generic.y = y;
|
||||
s_transporter.quitmenu.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.quitmenu.generic.id = ID_QUIT;
|
||||
s_transporter.quitmenu.generic.callback = M_Transporter_Event;
|
||||
s_transporter.quitmenu.width = width;
|
||||
s_transporter.quitmenu.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.quitmenu.color = CT_DKPURPLE1;
|
||||
s_transporter.quitmenu.color2 = CT_LTPURPLE1;
|
||||
s_transporter.quitmenu.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.quitmenu.textY = 12;
|
||||
s_transporter.quitmenu.textEnum = MBT_RETURNMENU;
|
||||
s_transporter.quitmenu.textcolor = CT_BLACK;
|
||||
s_transporter.quitmenu.textcolor2 = CT_WHITE;
|
||||
s_transporter.quitmenu.textStyle = UI_TINYFONT;
|
||||
s_transporter.quitmenu.generic.type = MTYPE_BITMAP;
|
||||
s_transporter.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_transporter.quitmenu.generic.x = x;
|
||||
s_transporter.quitmenu.generic.y = y;
|
||||
s_transporter.quitmenu.generic.name = GRAPHIC_BUTTONLEFT;
|
||||
s_transporter.quitmenu.generic.id = ID_QUIT;
|
||||
s_transporter.quitmenu.generic.callback = M_Transporter_Event;
|
||||
s_transporter.quitmenu.width = width;
|
||||
s_transporter.quitmenu.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.quitmenu.color = CT_DKPURPLE1;
|
||||
s_transporter.quitmenu.color2 = CT_LTPURPLE1;
|
||||
s_transporter.quitmenu.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.quitmenu.textY = 12;
|
||||
s_transporter.quitmenu.textEnum = MBT_RETURNMENU;
|
||||
s_transporter.quitmenu.textcolor = CT_BLACK;
|
||||
s_transporter.quitmenu.textcolor2 = CT_WHITE;
|
||||
s_transporter.quitmenu.textStyle = UI_TINYFONT;
|
||||
|
||||
y -= (2*pad);
|
||||
y -= (2 * pad);
|
||||
x += width + 8;
|
||||
|
||||
s_transporter.locButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.locButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.locButton.generic.x = x;
|
||||
s_transporter.locButton.generic.y = y;
|
||||
s_transporter.locButton.width = width;
|
||||
s_transporter.locButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.locButton.itemnames = (const char**)s_adminGeneric.locListPtr;
|
||||
s_transporter.locButton.color = CT_DKPURPLE1;
|
||||
s_transporter.locButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.locButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.locButton.textY = 12;
|
||||
s_transporter.locButton.textEnum = MBT_ADMIN_BEAMLOC;
|
||||
s_transporter.locButton.textcolor = CT_BLACK;
|
||||
s_transporter.locButton.textcolor2 = CT_WHITE;
|
||||
s_transporter.locButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.locButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.locButton.generic.x = x;
|
||||
s_transporter.locButton.generic.y = y;
|
||||
s_transporter.locButton.width = width;
|
||||
s_transporter.locButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.locButton.itemnames = (const char**)s_adminGeneric.locListPtr;
|
||||
s_transporter.locButton.color = CT_DKPURPLE1;
|
||||
s_transporter.locButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.locButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.locButton.textY = 12;
|
||||
s_transporter.locButton.textEnum = MBT_ADMIN_BEAMLOC;
|
||||
s_transporter.locButton.textcolor = CT_BLACK;
|
||||
s_transporter.locButton.textcolor2 = CT_WHITE;
|
||||
|
||||
y += pad;
|
||||
|
||||
s_transporter.srvButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.srvButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.srvButton.generic.x = x;
|
||||
s_transporter.srvButton.generic.y = y;
|
||||
s_transporter.srvButton.width = width;
|
||||
s_transporter.srvButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.srvButton.itemnames = (const char**)s_transporter.srvListPtr;
|
||||
s_transporter.srvButton.color = CT_DKPURPLE1;
|
||||
s_transporter.srvButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.srvButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.srvButton.textY = 12;
|
||||
s_transporter.srvButton.textEnum = MBT_TRANS_EXTERN;
|
||||
s_transporter.srvButton.textcolor = CT_BLACK;
|
||||
s_transporter.srvButton.textcolor2 = CT_WHITE;
|
||||
s_transporter.srvButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.srvButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.srvButton.generic.x = x;
|
||||
s_transporter.srvButton.generic.y = y;
|
||||
s_transporter.srvButton.width = width;
|
||||
s_transporter.srvButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.srvButton.itemnames = (const char**)s_transporter.srvListPtr;
|
||||
s_transporter.srvButton.color = CT_DKPURPLE1;
|
||||
s_transporter.srvButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.srvButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.srvButton.textY = 12;
|
||||
s_transporter.srvButton.textEnum = MBT_TRANS_EXTERN;
|
||||
s_transporter.srvButton.textcolor = CT_BLACK;
|
||||
s_transporter.srvButton.textcolor2 = CT_WHITE;
|
||||
|
||||
y += pad;
|
||||
|
||||
s_transporter.delButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.delButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.delButton.generic.x = x;
|
||||
s_transporter.delButton.generic.y = y;
|
||||
s_transporter.delButton.width = width;
|
||||
s_transporter.delButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.delButton.itemnames = (const char**)delayList;
|
||||
s_transporter.delButton.color = CT_DKPURPLE1;
|
||||
s_transporter.delButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.delButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.delButton.textY = 12;
|
||||
s_transporter.delButton.textEnum = MBT_TRANS_DELAY;
|
||||
s_transporter.delButton.textcolor = CT_BLACK;
|
||||
s_transporter.delButton.textcolor2 = CT_WHITE;
|
||||
s_transporter.delButton.generic.type = MTYPE_SPINCONTROL;
|
||||
s_transporter.delButton.generic.flags = QMF_HIGHLIGHT_IF_FOCUS | QMF_ALTERNATE;
|
||||
s_transporter.delButton.generic.x = x;
|
||||
s_transporter.delButton.generic.y = y;
|
||||
s_transporter.delButton.width = width;
|
||||
s_transporter.delButton.height = PROP_BIG_HEIGHT;
|
||||
s_transporter.delButton.itemnames = (const char**)delayList;
|
||||
s_transporter.delButton.color = CT_DKPURPLE1;
|
||||
s_transporter.delButton.color2 = CT_LTPURPLE1;
|
||||
s_transporter.delButton.textX = MENU_BUTTON_TEXT_X;
|
||||
s_transporter.delButton.textY = 12;
|
||||
s_transporter.delButton.textEnum = MBT_TRANS_DELAY;
|
||||
s_transporter.delButton.textcolor = CT_BLACK;
|
||||
s_transporter.delButton.textcolor2 = CT_WHITE;
|
||||
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.delButton );
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.srvButton );
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.locButton );
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.engage );
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.engage2 );
|
||||
Menu_AddItem( &s_transporter.menu, &s_transporter.quitmenu );
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.delButton);
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.srvButton);
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.locButton);
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.engage);
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.engage2);
|
||||
Menu_AddItem(&s_transporter.menu, &s_transporter.quitmenu);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -461,11 +462,11 @@ void SrvData_Init(void) {
|
|||
int32_t i;
|
||||
|
||||
UI_LogFuncBegin();
|
||||
for(i = 0; i < 6; i++) {
|
||||
if(!srvList[i][0]) break;
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (!srvList[i][0]) break;
|
||||
s_transporter.srvListPtr[i] = srvList[i];
|
||||
}
|
||||
s_transporter.srvListPtr[i+1] = 0;
|
||||
s_transporter.srvListPtr[i + 1] = 0;
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -474,16 +475,16 @@ void SrvData_Init(void) {
|
|||
UI_TransporterMenu
|
||||
===============
|
||||
*/
|
||||
void UI_TransporterMenu (int32_t trNum)
|
||||
void UI_TransporterMenu(int32_t trNum)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
|
||||
if ( !trNum ){
|
||||
if (!trNum){
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
memset( &s_transporter, 0, sizeof( s_transporter ) );
|
||||
memset(&s_transporter, 0, sizeof(s_transporter));
|
||||
|
||||
s_transporter.targetEntID = trNum;
|
||||
|
||||
|
@ -497,11 +498,11 @@ void UI_TransporterMenu (int32_t trNum)
|
|||
|
||||
SrvData_Init();
|
||||
|
||||
TransporterMenu_Init();
|
||||
TransporterMenu_Init();
|
||||
|
||||
UI_PushMenu( &s_transporter.menu );
|
||||
UI_PushMenu(&s_transporter.menu);
|
||||
|
||||
Menu_AdjustCursor( &s_transporter.menu, 1 );
|
||||
Menu_AdjustCursor(&s_transporter.menu, 1);
|
||||
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
|
|
@ -2,86 +2,88 @@
|
|||
UI_TURBOLIFT.C
|
||||
|
||||
User interface trigger from within game
|
||||
**********************************************************************/
|
||||
**********************************************************************/
|
||||
#include "ui_local.h"
|
||||
#include "ui_logger.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t deckNum;
|
||||
char deckDesc[MAX_QPATH];
|
||||
int32_t deckNum;
|
||||
char deckDesc[MAX_QPATH];
|
||||
} deckData_t;
|
||||
|
||||
// Data for Closing Credits Menu
|
||||
typedef struct //static
|
||||
{
|
||||
menuframework_s menu;
|
||||
int32_t maxDecks;
|
||||
int32_t chosenDeck;
|
||||
int32_t highLightedDeck;
|
||||
sfxHandle_t openingVoice;
|
||||
menubitmap_s quitmenu;
|
||||
menubitmap_s engage;
|
||||
menubitmap_s deck1;
|
||||
menubitmap_s deck2;
|
||||
menubitmap_s deck3;
|
||||
menubitmap_s deck4;
|
||||
menubitmap_s deck5;
|
||||
menubitmap_s deck6;
|
||||
menubitmap_s deck7;
|
||||
menubitmap_s deck8;
|
||||
menubitmap_s deck9;
|
||||
menubitmap_s deck10;
|
||||
menubitmap_s deck11;
|
||||
menubitmap_s deck12;
|
||||
menubitmap_s deck13;
|
||||
menubitmap_s deck14;
|
||||
menubitmap_s deck15;
|
||||
menubitmap_s deck16;
|
||||
int32_t maxDecks;
|
||||
int32_t chosenDeck;
|
||||
int32_t highLightedDeck;
|
||||
sfxHandle_t openingVoice;
|
||||
menubitmap_s quitmenu;
|
||||
menubitmap_s engage;
|
||||
menubitmap_s deck1;
|
||||
menubitmap_s deck2;
|
||||
menubitmap_s deck3;
|
||||
menubitmap_s deck4;
|
||||
menubitmap_s deck5;
|
||||
menubitmap_s deck6;
|
||||
menubitmap_s deck7;
|
||||
menubitmap_s deck8;
|
||||
menubitmap_s deck9;
|
||||
menubitmap_s deck10;
|
||||
menubitmap_s deck11;
|
||||
menubitmap_s deck12;
|
||||
menubitmap_s deck13;
|
||||
menubitmap_s deck14;
|
||||
menubitmap_s deck15;
|
||||
menubitmap_s deck16;
|
||||
|
||||
deckData_t deckData[MAX_DECKS];
|
||||
int32_t numDecks;
|
||||
deckData_t deckData[MAX_DECKS];
|
||||
int32_t numDecks;
|
||||
|
||||
int32_t liftNum;
|
||||
int32_t liftNum;
|
||||
} turbolift_t;
|
||||
|
||||
turbolift_t s_turbolift;
|
||||
|
||||
void TurboliftMenu_LoadText (void);
|
||||
void TurboliftMenu_LoadText(void);
|
||||
|
||||
#define ID_ARROW1UP 2
|
||||
#define ID_ARROW1DOWN 3
|
||||
#define ID_ARROW2UP 4
|
||||
#define ID_ARROW2DOWN 5
|
||||
#define ID_COMPUTERVOICE 6
|
||||
enum ui_turboliftIDs_e {
|
||||
ID_ARROW1UP = 2,
|
||||
ID_ARROW1DOWN,
|
||||
ID_ARROW2UP,
|
||||
ID_ARROW2DOWN,
|
||||
ID_COMPUTERVOICE,
|
||||
|
||||
#define ID_QUIT 10
|
||||
#define ID_DECK1 11
|
||||
#define ID_DECK2 12
|
||||
#define ID_DECK3 13
|
||||
#define ID_DECK4 14
|
||||
#define ID_DECK5 15
|
||||
#define ID_DECK6 16
|
||||
#define ID_DECK7 17
|
||||
#define ID_DECK8 18
|
||||
#define ID_DECK9 19
|
||||
#define ID_DECK10 20
|
||||
#define ID_DECK11 21
|
||||
#define ID_DECK12 22
|
||||
#define ID_DECK13 23
|
||||
#define ID_DECK14 24
|
||||
#define ID_DECK15 25
|
||||
#define ID_DECK16 26
|
||||
#define ID_ENGAGE 100
|
||||
ID_QUIT = 10,
|
||||
ID_DECK1,
|
||||
ID_DECK2,
|
||||
ID_DECK3,
|
||||
ID_DECK4,
|
||||
ID_DECK5,
|
||||
ID_DECK6,
|
||||
ID_DECK7,
|
||||
ID_DECK8,
|
||||
ID_DECK9,
|
||||
ID_DECK10,
|
||||
ID_DECK11,
|
||||
ID_DECK12,
|
||||
ID_DECK13,
|
||||
ID_DECK14,
|
||||
ID_DECK15,
|
||||
ID_DECK16,
|
||||
ID_ENGAGE = 100
|
||||
};
|
||||
|
||||
void UI_HolodeckMenu_Cache (void);
|
||||
void UI_HolodeckMenu_Cache(void);
|
||||
|
||||
/*
|
||||
=================
|
||||
M_Turbolift_Event
|
||||
=================
|
||||
*/
|
||||
static void M_Turbolift_Event (void* ptr, int32_t notification)
|
||||
static void M_Turbolift_Event(void* ptr, int32_t notification)
|
||||
{
|
||||
int32_t id;
|
||||
menubitmap_s *holdDeck;
|
||||
|
@ -92,59 +94,59 @@ static void M_Turbolift_Event (void* ptr, int32_t notification)
|
|||
|
||||
/*if ( notification != QM_ACTIVATED )
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}*/
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case ID_QUIT:
|
||||
if ( notification == QM_ACTIVATED )
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_DECK1:
|
||||
case ID_DECK2:
|
||||
case ID_DECK3:
|
||||
case ID_DECK4:
|
||||
case ID_DECK5:
|
||||
case ID_DECK6:
|
||||
case ID_DECK7:
|
||||
case ID_DECK8:
|
||||
case ID_DECK9:
|
||||
case ID_DECK10:
|
||||
case ID_DECK11:
|
||||
case ID_DECK12:
|
||||
case ID_DECK13:
|
||||
case ID_DECK14:
|
||||
case ID_DECK15:
|
||||
case ID_DECK16:
|
||||
case ID_QUIT:
|
||||
if (notification == QM_ACTIVATED)
|
||||
UI_PopMenu();
|
||||
break;
|
||||
case ID_DECK1:
|
||||
case ID_DECK2:
|
||||
case ID_DECK3:
|
||||
case ID_DECK4:
|
||||
case ID_DECK5:
|
||||
case ID_DECK6:
|
||||
case ID_DECK7:
|
||||
case ID_DECK8:
|
||||
case ID_DECK9:
|
||||
case ID_DECK10:
|
||||
case ID_DECK11:
|
||||
case ID_DECK12:
|
||||
case ID_DECK13:
|
||||
case ID_DECK14:
|
||||
case ID_DECK15:
|
||||
case ID_DECK16:
|
||||
|
||||
if ( notification == QM_ACTIVATED )
|
||||
if (notification == QM_ACTIVATED)
|
||||
{
|
||||
if (s_turbolift.chosenDeck >= 0)
|
||||
{
|
||||
if (s_turbolift.chosenDeck >= 0)
|
||||
{
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
holdDeck += s_turbolift.chosenDeck;
|
||||
holdDeck->textcolor = CT_BLACK;
|
||||
}
|
||||
|
||||
s_turbolift.chosenDeck = id - ID_DECK1;
|
||||
s_turbolift.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
holdDeck += s_turbolift.chosenDeck;
|
||||
//holdDeck->textcolor = CT_WHITE;//CT_LTGOLD1;
|
||||
holdDeck->textcolor = CT_BLACK;
|
||||
}
|
||||
else if ( notification == QM_GOTFOCUS )
|
||||
{
|
||||
s_turbolift.highLightedDeck = id - ID_DECK1;
|
||||
}
|
||||
break;
|
||||
case ID_ENGAGE: // Active only if a deck has been chosen
|
||||
if ( notification == QM_ACTIVATED ) {
|
||||
UI_ForceMenuOff();
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "deck %i %i", s_turbolift.liftNum, s_turbolift.deckData[s_turbolift.chosenDeck].deckNum ) );
|
||||
}
|
||||
break;
|
||||
|
||||
s_turbolift.chosenDeck = id - ID_DECK1;
|
||||
s_turbolift.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
holdDeck += s_turbolift.chosenDeck;
|
||||
//holdDeck->textcolor = CT_WHITE;//CT_LTGOLD1;
|
||||
}
|
||||
else if (notification == QM_GOTFOCUS)
|
||||
{
|
||||
s_turbolift.highLightedDeck = id - ID_DECK1;
|
||||
}
|
||||
break;
|
||||
case ID_ENGAGE: // Active only if a deck has been chosen
|
||||
if (notification == QM_ACTIVATED) {
|
||||
UI_ForceMenuOff();
|
||||
trap_Cmd_ExecuteText(EXEC_APPEND, va("deck %i %i", s_turbolift.liftNum, s_turbolift.deckData[s_turbolift.chosenDeck].deckNum));
|
||||
}
|
||||
break;
|
||||
}
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -154,9 +156,9 @@ static void M_Turbolift_Event (void* ptr, int32_t notification)
|
|||
TurboliftMenu_Key
|
||||
=================
|
||||
*/
|
||||
sfxHandle_t TurboliftMenu_Key (int32_t key)
|
||||
sfxHandle_t TurboliftMenu_Key(int32_t key)
|
||||
{
|
||||
return ( Menu_DefaultKey( &s_turbolift.menu, key ) );
|
||||
return (Menu_DefaultKey(&s_turbolift.menu, key));
|
||||
}
|
||||
|
||||
qhandle_t leftRound;
|
||||
|
@ -169,87 +171,87 @@ qhandle_t turbolift;
|
|||
M_TurboliftMenu_Graphics
|
||||
=================
|
||||
*/
|
||||
static void M_TurboliftMenu_Graphics (void)
|
||||
static void M_TurboliftMenu_Graphics(void)
|
||||
{
|
||||
menubitmap_s *holdDeck;
|
||||
int32_t i,length,xTurboStart;
|
||||
int32_t numColor,roundColor;
|
||||
int32_t i, length, xTurboStart;
|
||||
int32_t numColor, roundColor;
|
||||
|
||||
UI_LogFuncBegin();
|
||||
|
||||
// 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
|
||||
UI_DrawHandlePic( 20, 353, 64, 16, corner_ll_12_60); // Lower Corner
|
||||
trap_R_SetColor( colorTable[CT_LTPURPLE1] ); //colorTable[CT_LTBLUE1] //[CT_DKGOLD1] //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 100, 86, 128, 128, turbolift); // Turbolift graphic
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
|
||||
UI_DrawHandlePic(20, 24, 64, 32, corner_ul_24_60); // Upper corner
|
||||
UI_DrawHandlePic(20, 353, 64, 16, corner_ll_12_60); // Lower Corner
|
||||
trap_R_SetColor(colorTable[CT_LTPURPLE1]); //colorTable[CT_LTBLUE1] //[CT_DKGOLD1] //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic(100, 86, 128, 128, turbolift); // Turbolift graphic
|
||||
|
||||
// Lower corners
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 20, 375, 64, -16, corner_ll_12_60); //
|
||||
UI_DrawHandlePic( 20, 440, 64, 16, corner_ll_12_60); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic(20, 375, 64, -16, corner_ll_12_60); //
|
||||
UI_DrawHandlePic(20, 440, 64, 16, corner_ll_12_60); //
|
||||
|
||||
xTurboStart = 604;
|
||||
length = UI_ProportionalStringWidth( menu_normal_text[MNT_TURBOLIFT],UI_BIGFONT);
|
||||
length = UI_ProportionalStringWidth(menu_normal_text[MNT_TURBOLIFT], 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); //
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
|
||||
UI_DrawHandlePic( 20, 123, 60, 240, uis.whiteShader); // Left hand column
|
||||
UI_DrawHandlePic( 69, 356, 245, 12, uis.whiteShader); //
|
||||
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); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //DKGOLD1
|
||||
UI_DrawHandlePic(20, 123, 60, 240, uis.whiteShader); // Left hand column
|
||||
UI_DrawHandlePic(69, 356, 245, 12, uis.whiteShader); //
|
||||
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_DKPURPLE1]
|
||||
UI_DrawHandlePic(319, 356, 93, 5, uis.whiteShader); //
|
||||
UI_DrawHandlePic(319, 360, 31, 8, uis.whiteShader); //
|
||||
UI_DrawHandlePic(381, 360, 31, 8, uis.whiteShader); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_DKPURPLE1]
|
||||
UI_DrawHandlePic(319, 356, 93, 5, uis.whiteShader); //
|
||||
UI_DrawHandlePic(319, 360, 31, 8, uis.whiteShader); //
|
||||
UI_DrawHandlePic(381, 360, 31, 8, uis.whiteShader); //
|
||||
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE1]);
|
||||
UI_DrawHandlePic(417, 356, 93, 12, uis.whiteShader); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE1]);
|
||||
UI_DrawHandlePic(417, 356, 93, 12, uis.whiteShader); //
|
||||
|
||||
UI_DrawHandlePic(510, 356,114, 12, uis.whiteShader); //
|
||||
UI_DrawHandlePic(510, 356, 114, 12, uis.whiteShader); //
|
||||
|
||||
// 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
|
||||
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 69, 376, 158, 12, uis.whiteShader); // Top line
|
||||
UI_DrawHandlePic(232, 376, 82, 12, uis.whiteShader); // Top line
|
||||
UI_DrawHandlePic(417, 376, 12, 12, uis.whiteShader); //
|
||||
UI_DrawHandlePic(434, 376, 190, 12, uis.whiteShader); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic(69, 376, 158, 12, uis.whiteShader); // Top line
|
||||
UI_DrawHandlePic(232, 376, 82, 12, uis.whiteShader); // Top line
|
||||
UI_DrawHandlePic(417, 376, 12, 12, uis.whiteShader); //
|
||||
UI_DrawHandlePic(434, 376, 190, 12, uis.whiteShader); //
|
||||
|
||||
// Funky indent
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE1] ); //colorTable[CT_DKGOLD1]
|
||||
UI_DrawHandlePic(319, 383, 93, 5, uis.whiteShader); //
|
||||
UI_DrawHandlePic(319, 376, 31, 8, uis.whiteShader); //
|
||||
UI_DrawHandlePic(381, 376, 31, 8, uis.whiteShader); //
|
||||
trap_R_SetColor(colorTable[CT_DKPURPLE1]); //colorTable[CT_DKGOLD1]
|
||||
UI_DrawHandlePic(319, 383, 93, 5, uis.whiteShader); //
|
||||
UI_DrawHandlePic(319, 376, 31, 8, uis.whiteShader); //
|
||||
UI_DrawHandlePic(381, 376, 31, 8, 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
|
||||
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
|
||||
|
||||
|
||||
UI_DrawProportionalString( xTurboStart, 24,
|
||||
menu_normal_text[MNT_TURBOLIFT], UI_BIGFONT | UI_RIGHT, colorTable[CT_WHITE]);
|
||||
UI_DrawProportionalString(xTurboStart, 24,
|
||||
menu_normal_text[MNT_TURBOLIFT], 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);
|
||||
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
|
||||
// Print deck buttons
|
||||
for (i=0;i<s_turbolift.maxDecks;i++)
|
||||
for (i = 0; i < s_turbolift.maxDecks; i++)
|
||||
{
|
||||
if (s_turbolift.deckData[i].deckNum )
|
||||
if (s_turbolift.deckData[i].deckNum)
|
||||
{
|
||||
if (s_turbolift.chosenDeck == i) // This deck was chosen
|
||||
{
|
||||
|
@ -262,38 +264,38 @@ static void M_TurboliftMenu_Graphics (void)
|
|||
roundColor = CT_DKPURPLE1;//CT_DKGOLD1;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( holdDeck->generic.x - 6,
|
||||
holdDeck->generic.y,
|
||||
va("%d",s_turbolift.deckData[i].deckNum), UI_BIGFONT|UI_RIGHT, colorTable[numColor]); //i+1
|
||||
UI_DrawProportionalString(holdDeck->generic.x - 6,
|
||||
holdDeck->generic.y,
|
||||
va("%d", s_turbolift.deckData[i].deckNum), UI_BIGFONT | UI_RIGHT, colorTable[numColor]); //i+1
|
||||
|
||||
trap_R_SetColor( colorTable[roundColor]);
|
||||
UI_DrawHandlePic( holdDeck->generic.x - 45,
|
||||
holdDeck->generic.y,
|
||||
16, 32, leftRound);
|
||||
trap_R_SetColor(colorTable[roundColor]);
|
||||
UI_DrawHandlePic(holdDeck->generic.x - 45,
|
||||
holdDeck->generic.y,
|
||||
16, 32, leftRound);
|
||||
}
|
||||
|
||||
holdDeck++;
|
||||
}
|
||||
|
||||
|
||||
if ( s_turbolift.highLightedDeck >= 0 )
|
||||
|
||||
if (s_turbolift.highLightedDeck >= 0)
|
||||
{
|
||||
UI_DrawProportionalString( 353, 409,
|
||||
s_turbolift.deckData[s_turbolift.highLightedDeck].deckDesc, UI_SMALLFONT|UI_CENTER, colorTable[CT_WHITE]);
|
||||
UI_DrawProportionalString(353, 409,
|
||||
s_turbolift.deckData[s_turbolift.highLightedDeck].deckDesc, UI_SMALLFONT | UI_CENTER, colorTable[CT_WHITE]);
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_DrawProportionalString( 353, 409, menu_normal_text[MNT_SPECFICYDECK], UI_SMALLFONT|UI_CENTER, colorTable[CT_WHITE]);
|
||||
UI_DrawProportionalString(353, 409, menu_normal_text[MNT_SPECFICYDECK], UI_SMALLFONT | UI_CENTER, colorTable[CT_WHITE]);
|
||||
}
|
||||
|
||||
// Round graphic on left of engage & quit button
|
||||
trap_R_SetColor( colorTable[s_turbolift.quitmenu.color]);
|
||||
trap_R_SetColor(colorTable[s_turbolift.quitmenu.color]);
|
||||
UI_DrawHandlePic(s_turbolift.engage.generic.x - 14,
|
||||
s_turbolift.engage.generic.y,
|
||||
s_turbolift.engage.generic.y,
|
||||
MENU_BUTTON_MED_HEIGHT, s_turbolift.engage.height, uis.graphicButtonLeftEnd);
|
||||
|
||||
UI_DrawHandlePic(s_turbolift.quitmenu.generic.x - 14,
|
||||
s_turbolift.quitmenu.generic.y,
|
||||
s_turbolift.quitmenu.generic.y,
|
||||
MENU_BUTTON_MED_HEIGHT, s_turbolift.quitmenu.height, uis.graphicButtonLeftEnd);
|
||||
|
||||
UI_LogFuncEnd();
|
||||
|
@ -311,8 +313,8 @@ static void TurboliftMenu_Draw(void)
|
|||
|
||||
// Draw graphics particular to Main Menu
|
||||
M_TurboliftMenu_Graphics();
|
||||
|
||||
Menu_Draw( &s_turbolift.menu );
|
||||
|
||||
Menu_Draw(&s_turbolift.menu);
|
||||
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
@ -322,8 +324,8 @@ static void TurboliftMenu_Draw(void)
|
|||
UI_TurboliftMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_TurboliftMenu_Cache (void)
|
||||
{
|
||||
void UI_TurboliftMenu_Cache(void)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
|
||||
leftRound = trap_R_RegisterShaderNoMip("menu/common/halfroundl_24.tga");
|
||||
|
@ -336,37 +338,37 @@ void UI_TurboliftMenu_Cache (void)
|
|||
|
||||
|
||||
//Sorts decks in ascending order
|
||||
static int32_t QDECL SortDecks( const void *arg1, const void *arg2 )
|
||||
static int32_t QDECL SortDecks(const void *arg1, const void *arg2)
|
||||
{
|
||||
int32_t deck1;
|
||||
int32_t deck2;
|
||||
|
||||
UI_LogFuncBegin();
|
||||
|
||||
deck1 = ( (deckData_t *)arg1)->deckNum;
|
||||
deck2 = ( (deckData_t *)arg2)->deckNum;
|
||||
deck1 = ((deckData_t *)arg1)->deckNum;
|
||||
deck2 = ((deckData_t *)arg2)->deckNum;
|
||||
|
||||
if ( deck1 < 0 )
|
||||
if (deck1 < 0)
|
||||
deck1 = 0;
|
||||
|
||||
if ( deck2 < 0 )
|
||||
if (deck2 < 0)
|
||||
deck2 = 0;
|
||||
|
||||
if ( deck1 > deck2 ){
|
||||
if (deck1 > deck2){
|
||||
UI_LogFuncEnd();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( deck1 == deck2 ){
|
||||
if (deck1 == deck2){
|
||||
UI_LogFuncEnd();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
UI_LogFuncEnd();
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void UI_TurboliftMenu_LoadDecks( void )
|
||||
static void UI_TurboliftMenu_LoadDecks(void)
|
||||
{
|
||||
char buffer[MAX_TOKEN_CHARS];
|
||||
int32_t i;
|
||||
|
@ -377,37 +379,37 @@ static void UI_TurboliftMenu_LoadDecks( void )
|
|||
UI_LogFuncBegin();
|
||||
|
||||
//load the string
|
||||
trap_GetConfigString( CS_TURBOLIFT_DATA, buffer, sizeof( buffer ) );
|
||||
trap_GetConfigString(CS_TURBOLIFT_DATA, buffer, sizeof(buffer));
|
||||
|
||||
if ( !buffer[0] ){
|
||||
if (!buffer[0]){
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
memset( &s_turbolift.deckData, 0, sizeof( s_turbolift.deckData ) );
|
||||
memset(&s_turbolift.deckData, 0, sizeof(s_turbolift.deckData));
|
||||
|
||||
for ( i=0; i < MAX_DECKS; i++ )
|
||||
for (i = 0; i < MAX_DECKS; i++)
|
||||
{
|
||||
temp = Info_ValueForKey( buffer, va( "d%i", i ) );
|
||||
temp = Info_ValueForKey(buffer, va("d%i", i));
|
||||
|
||||
if ( !temp[0] )
|
||||
if (!temp[0])
|
||||
break;
|
||||
|
||||
s_turbolift.deckData[ s_turbolift.numDecks ].deckNum = atoi( temp );
|
||||
s_turbolift.deckData[s_turbolift.numDecks].deckNum = atoi(temp);
|
||||
|
||||
temp = Info_ValueForKey( buffer, va( "n%i", i ) );
|
||||
temp = Info_ValueForKey(buffer, va("n%i", i));
|
||||
|
||||
Q_strncpyz(s_turbolift.deckData[s_turbolift.numDecks].deckDesc, temp, sizeof(s_turbolift.deckData[s_turbolift.numDecks].deckDesc));
|
||||
|
||||
Q_strncpyz( s_turbolift.deckData[ s_turbolift.numDecks ].deckDesc, temp, sizeof( s_turbolift.deckData[ s_turbolift.numDecks ].deckDesc ) );
|
||||
|
||||
s_turbolift.numDecks++;
|
||||
}
|
||||
|
||||
//TiM - sort the decks into their sequential order
|
||||
qsort( s_turbolift.deckData, s_turbolift.numDecks, sizeof( deckData_t ), SortDecks );
|
||||
qsort(s_turbolift.deckData, s_turbolift.numDecks, sizeof(deckData_t), SortDecks);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
static void UI_ManageDeckLoading( void )
|
||||
static void UI_ManageDeckLoading(void)
|
||||
{
|
||||
char fileRoute[MAX_QPATH];
|
||||
char mapRoute[MAX_QPATH];
|
||||
|
@ -421,15 +423,15 @@ static void UI_ManageDeckLoading( void )
|
|||
UI_LogFuncBegin();
|
||||
|
||||
//get the map name
|
||||
trap_GetConfigString( CS_SERVERINFO, info, sizeof( info ) );
|
||||
Com_sprintf( mapRoute, sizeof( fileRoute ), "maps/%s", Info_ValueForKey( info, "mapname" ) );
|
||||
trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));
|
||||
Com_sprintf(mapRoute, sizeof(fileRoute), "maps/%s", Info_ValueForKey(info, "mapname"));
|
||||
|
||||
//check for language
|
||||
UI_LanguageFilename( mapRoute, "turbolift", fileRoute );
|
||||
UI_LanguageFilename(mapRoute, "turbolift", fileRoute);
|
||||
|
||||
file_len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
|
||||
file_len = trap_FS_FOpenFile(fileRoute, &f, FS_READ);
|
||||
|
||||
if ( file_len <= 1 )
|
||||
if (file_len <= 1)
|
||||
{
|
||||
//UI_Logger( LL_WARN, "Attempted to load %s, but wasn't found.\n", fileRoute );
|
||||
UI_TurboliftMenu_LoadDecks();
|
||||
|
@ -437,19 +439,19 @@ static void UI_ManageDeckLoading( void )
|
|||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buffer, file_len, f );
|
||||
trap_FS_FCloseFile( f );
|
||||
trap_FS_Read(buffer, file_len, f);
|
||||
trap_FS_FCloseFile(f);
|
||||
|
||||
if ( !buffer[0] )
|
||||
if (!buffer[0])
|
||||
{
|
||||
UI_Logger( LL_ERROR, "Attempted to load %s, but no data was read.\n", fileRoute );
|
||||
UI_Logger(LL_ERROR, "Attempted to load %s, but no data was read.\n", fileRoute);
|
||||
UI_TurboliftMenu_LoadDecks();
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
s_turbolift.numDecks = 0;
|
||||
memset( &s_turbolift.deckData, 0, sizeof( s_turbolift.deckData ) );
|
||||
memset(&s_turbolift.deckData, 0, sizeof(s_turbolift.deckData));
|
||||
buffer[file_len] = '\0';
|
||||
|
||||
COM_BeginParseSession();
|
||||
|
@ -458,39 +460,39 @@ static void UI_ManageDeckLoading( void )
|
|||
//UI_Logger( LL_DEBUG, "Beginning Parse\n" );
|
||||
|
||||
//expected format is 'decknum' <space> 'deck Desc'
|
||||
while( 1 )
|
||||
while (1)
|
||||
{
|
||||
token = COM_Parse( &textPtr );
|
||||
if ( !token[0] )
|
||||
token = COM_Parse(&textPtr);
|
||||
if (!token[0])
|
||||
break;
|
||||
|
||||
//UI_Logger( LL_DEBUG, "First Token: %s\n", token );
|
||||
|
||||
//in case of Scooter's EF SP style DAT files, which require 'DECK' in front of the number
|
||||
if ( !Q_strncmp( token, "DECK", 4 ) )
|
||||
if (!Q_strncmp(token, "DECK", 4))
|
||||
token += 4;
|
||||
|
||||
//grab the deck number
|
||||
s_turbolift.deckData[s_turbolift.numDecks].deckNum = atoi( token );
|
||||
s_turbolift.deckData[s_turbolift.numDecks].deckNum = atoi(token);
|
||||
|
||||
token = COM_ParseExt( &textPtr, qfalse );
|
||||
token = COM_ParseExt(&textPtr, qfalse);
|
||||
if (!token[0])
|
||||
continue;
|
||||
|
||||
//UI_Logger( LL_DEBUG, "Second Token: %s\n", token );
|
||||
|
||||
Q_strncpyz( s_turbolift.deckData[s_turbolift.numDecks].deckDesc,
|
||||
token,
|
||||
sizeof( s_turbolift.deckData[s_turbolift.numDecks].deckDesc ) );
|
||||
Q_strncpyz(s_turbolift.deckData[s_turbolift.numDecks].deckDesc,
|
||||
token,
|
||||
sizeof(s_turbolift.deckData[s_turbolift.numDecks].deckDesc));
|
||||
|
||||
s_turbolift.numDecks++;
|
||||
|
||||
//if this is an EF SP style script, there may be more data after these two. ignore them
|
||||
if ( COM_ParseExt( &textPtr, qfalse ) == NULL )
|
||||
SkipRestOfLine( &textPtr );
|
||||
if (COM_ParseExt(&textPtr, qfalse) == NULL)
|
||||
SkipRestOfLine(&textPtr);
|
||||
}
|
||||
|
||||
qsort( s_turbolift.deckData, s_turbolift.numDecks, sizeof( deckData_t ), SortDecks );
|
||||
qsort(s_turbolift.deckData, s_turbolift.numDecks, sizeof(deckData_t), SortDecks);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
@ -501,110 +503,110 @@ TurboliftMenu_Init
|
|||
*/
|
||||
void TurboliftMenu_Init(void)
|
||||
{
|
||||
int32_t y,pad,x;
|
||||
int32_t y, pad, x;
|
||||
menubitmap_s *holdDeck;
|
||||
int32_t i,width;
|
||||
int32_t i, width;
|
||||
|
||||
UI_LogFuncBegin();
|
||||
|
||||
UI_ManageDeckLoading();
|
||||
|
||||
s_turbolift.menu.nitems = 0;
|
||||
s_turbolift.menu.draw = TurboliftMenu_Draw;
|
||||
s_turbolift.menu.key = TurboliftMenu_Key;
|
||||
s_turbolift.menu.wrapAround = qtrue;
|
||||
s_turbolift.menu.descX = MENU_DESC_X;
|
||||
s_turbolift.menu.descY = MENU_DESC_Y;
|
||||
s_turbolift.menu.titleX = MENU_TITLE_X;
|
||||
s_turbolift.menu.titleY = MENU_TITLE_Y;
|
||||
s_turbolift.menu.nitems = 0;
|
||||
s_turbolift.menu.draw = TurboliftMenu_Draw;
|
||||
s_turbolift.menu.key = TurboliftMenu_Key;
|
||||
s_turbolift.menu.wrapAround = qtrue;
|
||||
s_turbolift.menu.descX = MENU_DESC_X;
|
||||
s_turbolift.menu.descY = MENU_DESC_Y;
|
||||
s_turbolift.menu.titleX = MENU_TITLE_X;
|
||||
s_turbolift.menu.titleY = MENU_TITLE_Y;
|
||||
|
||||
s_turbolift.chosenDeck = -1;
|
||||
s_turbolift.highLightedDeck = -1;
|
||||
|
||||
pad = PROP_BIG_HEIGHT + 10;
|
||||
y = 72;
|
||||
y = 72;
|
||||
x = 319;
|
||||
width = MENU_BUTTON_MED_WIDTH-20;
|
||||
width = MENU_BUTTON_MED_WIDTH - 20;
|
||||
|
||||
s_turbolift.maxDecks = MAX_DECKS;
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
|
||||
for (i=0;i<s_turbolift.maxDecks;i++)
|
||||
for (i = 0; i < s_turbolift.maxDecks; i++)
|
||||
{
|
||||
holdDeck->generic.type = MTYPE_BITMAP;
|
||||
holdDeck->generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
holdDeck->generic.x = x;
|
||||
holdDeck->generic.y = y;
|
||||
holdDeck->generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
holdDeck->generic.id = ID_DECK1 + i;
|
||||
holdDeck->generic.callback = M_Turbolift_Event;
|
||||
holdDeck->width = width;
|
||||
holdDeck->height = PROP_BIG_HEIGHT;
|
||||
holdDeck->color = CT_DKPURPLE1;//CT_VDKRED1;//CT_DKGOLD1;
|
||||
holdDeck->color2 = CT_LTPURPLE1;//CT_DKRED1;//CT_LTGOLD1;
|
||||
holdDeck->textX = MENU_BUTTON_TEXT_X;
|
||||
holdDeck->textY = 12;
|
||||
holdDeck->textEnum = MBT_DECK;
|
||||
holdDeck->textcolor = CT_BLACK;
|
||||
holdDeck->textcolor2 = CT_WHITE;
|
||||
holdDeck->textStyle = UI_TINYFONT;
|
||||
holdDeck->generic.type = MTYPE_BITMAP;
|
||||
holdDeck->generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
holdDeck->generic.x = x;
|
||||
holdDeck->generic.y = y;
|
||||
holdDeck->generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
holdDeck->generic.id = ID_DECK1 + i;
|
||||
holdDeck->generic.callback = M_Turbolift_Event;
|
||||
holdDeck->width = width;
|
||||
holdDeck->height = PROP_BIG_HEIGHT;
|
||||
holdDeck->color = CT_DKPURPLE1;//CT_VDKRED1;//CT_DKGOLD1;
|
||||
holdDeck->color2 = CT_LTPURPLE1;//CT_DKRED1;//CT_LTGOLD1;
|
||||
holdDeck->textX = MENU_BUTTON_TEXT_X;
|
||||
holdDeck->textY = 12;
|
||||
holdDeck->textEnum = MBT_DECK;
|
||||
holdDeck->textcolor = CT_BLACK;
|
||||
holdDeck->textcolor2 = CT_WHITE;
|
||||
holdDeck->textStyle = UI_TINYFONT;
|
||||
|
||||
holdDeck++;
|
||||
y += pad;
|
||||
|
||||
// Start the next column
|
||||
if (i == ((s_turbolift.maxDecks-1)/2))
|
||||
if (i == ((s_turbolift.maxDecks - 1) / 2))
|
||||
{
|
||||
x += width + 90;
|
||||
x += width + 90;
|
||||
y = 80;
|
||||
}
|
||||
}
|
||||
|
||||
s_turbolift.engage.generic.type = MTYPE_BITMAP;
|
||||
s_turbolift.engage.generic.flags = QMF_GRAYED;
|
||||
s_turbolift.engage.generic.x = 110;
|
||||
s_turbolift.engage.generic.y = 72 + (pad * 5);
|
||||
s_turbolift.engage.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_turbolift.engage.generic.id = ID_ENGAGE;
|
||||
s_turbolift.engage.generic.callback = M_Turbolift_Event;
|
||||
s_turbolift.engage.width = width;
|
||||
s_turbolift.engage.height = PROP_BIG_HEIGHT;
|
||||
s_turbolift.engage.color = CT_DKORANGE;
|
||||
s_turbolift.engage.color2 = CT_LTORANGE;
|
||||
s_turbolift.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_turbolift.engage.textY = 6;
|
||||
s_turbolift.engage.textEnum = MBT_ENGAGE;
|
||||
s_turbolift.engage.textcolor = CT_BLACK;
|
||||
s_turbolift.engage.textcolor2 = CT_WHITE;
|
||||
s_turbolift.engage.generic.type = MTYPE_BITMAP;
|
||||
s_turbolift.engage.generic.flags = QMF_GRAYED;
|
||||
s_turbolift.engage.generic.x = 110;
|
||||
s_turbolift.engage.generic.y = 72 + (pad * 5);
|
||||
s_turbolift.engage.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_turbolift.engage.generic.id = ID_ENGAGE;
|
||||
s_turbolift.engage.generic.callback = M_Turbolift_Event;
|
||||
s_turbolift.engage.width = width;
|
||||
s_turbolift.engage.height = PROP_BIG_HEIGHT;
|
||||
s_turbolift.engage.color = CT_DKORANGE;
|
||||
s_turbolift.engage.color2 = CT_LTORANGE;
|
||||
s_turbolift.engage.textX = MENU_BUTTON_TEXT_X;
|
||||
s_turbolift.engage.textY = 6;
|
||||
s_turbolift.engage.textEnum = MBT_ENGAGE;
|
||||
s_turbolift.engage.textcolor = CT_BLACK;
|
||||
s_turbolift.engage.textcolor2 = CT_WHITE;
|
||||
//s_turbolift.engage.generic.statusbarfunc = Turbolift_StatusBar;
|
||||
|
||||
s_turbolift.quitmenu.generic.type = MTYPE_BITMAP;
|
||||
s_turbolift.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_turbolift.quitmenu.generic.x = 110;
|
||||
s_turbolift.quitmenu.generic.y = 72 + (pad * 7);
|
||||
s_turbolift.quitmenu.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_turbolift.quitmenu.generic.id = ID_QUIT;
|
||||
s_turbolift.quitmenu.generic.callback = M_Turbolift_Event;
|
||||
s_turbolift.quitmenu.width = width;
|
||||
s_turbolift.quitmenu.height = PROP_BIG_HEIGHT;
|
||||
s_turbolift.quitmenu.color = CT_DKORANGE;
|
||||
s_turbolift.quitmenu.color2 = CT_LTORANGE;
|
||||
s_turbolift.quitmenu.textX = MENU_BUTTON_TEXT_X;
|
||||
s_turbolift.quitmenu.textY = 6;
|
||||
s_turbolift.quitmenu.textEnum = MBT_RETURNMENU;//MBT_RETURN;
|
||||
s_turbolift.quitmenu.textcolor = CT_BLACK;
|
||||
s_turbolift.quitmenu.textcolor2 = CT_WHITE;
|
||||
s_turbolift.quitmenu.generic.type = MTYPE_BITMAP;
|
||||
s_turbolift.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
|
||||
s_turbolift.quitmenu.generic.x = 110;
|
||||
s_turbolift.quitmenu.generic.y = 72 + (pad * 7);
|
||||
s_turbolift.quitmenu.generic.name = GRAPHIC_BUTTONRIGHT;
|
||||
s_turbolift.quitmenu.generic.id = ID_QUIT;
|
||||
s_turbolift.quitmenu.generic.callback = M_Turbolift_Event;
|
||||
s_turbolift.quitmenu.width = width;
|
||||
s_turbolift.quitmenu.height = PROP_BIG_HEIGHT;
|
||||
s_turbolift.quitmenu.color = CT_DKORANGE;
|
||||
s_turbolift.quitmenu.color2 = CT_LTORANGE;
|
||||
s_turbolift.quitmenu.textX = MENU_BUTTON_TEXT_X;
|
||||
s_turbolift.quitmenu.textY = 6;
|
||||
s_turbolift.quitmenu.textEnum = MBT_RETURNMENU;//MBT_RETURN;
|
||||
s_turbolift.quitmenu.textcolor = CT_BLACK;
|
||||
s_turbolift.quitmenu.textcolor2 = CT_WHITE;
|
||||
//s_turbolift.quitmenu.generic.statusbarfunc = Turbolift_StatusBar;
|
||||
|
||||
Menu_AddItem( &s_turbolift.menu, &s_turbolift.engage );
|
||||
Menu_AddItem( &s_turbolift.menu, &s_turbolift.quitmenu );
|
||||
Menu_AddItem(&s_turbolift.menu, &s_turbolift.engage);
|
||||
Menu_AddItem(&s_turbolift.menu, &s_turbolift.quitmenu);
|
||||
|
||||
holdDeck = &s_turbolift.deck1;
|
||||
for (i=0;i<s_turbolift.maxDecks;i++)
|
||||
for (i = 0; i < s_turbolift.maxDecks; i++)
|
||||
{
|
||||
if (s_turbolift.deckData[i].deckDesc[0])
|
||||
{
|
||||
Menu_AddItem( &s_turbolift.menu, holdDeck );
|
||||
Menu_AddItem(&s_turbolift.menu, holdDeck);
|
||||
}
|
||||
holdDeck++;
|
||||
}
|
||||
|
@ -616,16 +618,16 @@ void TurboliftMenu_Init(void)
|
|||
UI_TurboliftMenu
|
||||
===============
|
||||
*/
|
||||
void UI_TurboliftMenu ( int32_t liftNum )
|
||||
void UI_TurboliftMenu(int32_t liftNum)
|
||||
{
|
||||
UI_LogFuncBegin();
|
||||
|
||||
if ( !liftNum ){
|
||||
if (!liftNum){
|
||||
UI_LogFuncEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
memset( &s_turbolift, 0, sizeof( s_turbolift ) );
|
||||
memset(&s_turbolift, 0, sizeof(s_turbolift));
|
||||
|
||||
s_turbolift.liftNum = liftNum;
|
||||
|
||||
|
@ -637,11 +639,11 @@ void UI_TurboliftMenu ( int32_t liftNum )
|
|||
|
||||
UI_TurboliftMenu_Cache();
|
||||
|
||||
TurboliftMenu_Init();
|
||||
TurboliftMenu_Init();
|
||||
|
||||
UI_PushMenu( &s_turbolift.menu );
|
||||
UI_PushMenu(&s_turbolift.menu);
|
||||
|
||||
Menu_AdjustCursor( &s_turbolift.menu, 1 );
|
||||
Menu_AdjustCursor(&s_turbolift.menu, 1);
|
||||
UI_LogFuncEnd();
|
||||
}
|
||||
|
||||
|
|
4870
code/ui/ui_video.c
4870
code/ui/ui_video.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue