mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-02-16 00:51:59 +00:00
Work on MSD-UI
*Fixed Communication between server and UI -Turned out the CG_Argv() and UI_Argv() couldn't handle 9 requests at once, so I defaulted back to direct trapping. *Fixed bug that was looking for some Vars in the wrong fields. *Added a few new shaders to get the alert lights to work. stuff for that will be uploaded tomorrow. *Implemented alert lights on the MSD-UI (works perfectly) *Added Description of a new feature to target_shiphealth (Custom MSD-Ship Display) *Added Alexander Richardson as 2D Artist to credits (I will supply his MSD's for the new system) *Fixed ui_transporter (It accidently got killed) Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
parent
63e3ed0928
commit
940469a4ce
4 changed files with 56 additions and 44 deletions
|
@ -880,8 +880,18 @@ static void CG_ServerCommand( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(!strcmp(cmd, "ui_msd")) {
|
||||
trap_SendConsoleCommand(va("ui_msd %s %s %s %s %s %s %s %s %s", CG_Argv(1), CG_Argv(2), CG_Argv(3), CG_Argv(4), CG_Argv(5), CG_Argv(6), CG_Argv(7), CG_Argv(8), CG_Argv(9)));
|
||||
if(!strcmp(cmd, "ui_msd")) {
|
||||
static char ui_msd1[MAX_STRING_CHARS], ui_msd2[MAX_STRING_CHARS], ui_msd3[MAX_STRING_CHARS], ui_msd4[MAX_STRING_CHARS], ui_msd5[MAX_STRING_CHARS], ui_msd6[MAX_STRING_CHARS], ui_msd7[MAX_STRING_CHARS], ui_msd8[MAX_STRING_CHARS], ui_msd9[MAX_STRING_CHARS];
|
||||
trap_Argv( 1, ui_msd1, sizeof( ui_msd1 ) );
|
||||
trap_Argv( 2, ui_msd2, sizeof( ui_msd2 ) );
|
||||
trap_Argv( 3, ui_msd3, sizeof( ui_msd3 ) );
|
||||
trap_Argv( 4, ui_msd4, sizeof( ui_msd4 ) );
|
||||
trap_Argv( 5, ui_msd5, sizeof( ui_msd5 ) );
|
||||
trap_Argv( 6, ui_msd6, sizeof( ui_msd6 ) );
|
||||
trap_Argv( 7, ui_msd7, sizeof( ui_msd7 ) );
|
||||
trap_Argv( 8, ui_msd8, sizeof( ui_msd8 ) );
|
||||
trap_Argv( 9, ui_msd9, sizeof( ui_msd9 ) );
|
||||
trap_SendConsoleCommand(va("ui_msd %s %s %s %s %s %s %s %s %s", ui_msd1, ui_msd2, ui_msd3, ui_msd4, ui_msd5, ui_msd6, ui_msd7, ui_msd8, ui_msd9));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ void ui_msd_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|||
currshield = target->n00bCount;
|
||||
shieldstate = target->splashDamage;
|
||||
if(target->falsetarget){
|
||||
while((temp = G_Find(temp, FOFS(targetname), target->falsetarget)) != NULL){
|
||||
while((temp = G_Find(temp, FOFS(truename), target->falsetarget)) != NULL){
|
||||
if(!Q_stricmp(temp->classname, "target_warp")) break;
|
||||
}
|
||||
if(temp){
|
||||
|
@ -162,7 +162,7 @@ void ui_msd_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|||
}
|
||||
}
|
||||
if(target->bluename){
|
||||
while((temp = G_Find(temp, FOFS(targetname), target->bluename)) != NULL){
|
||||
while((temp = G_Find(temp, FOFS(swapname), target->bluename)) != NULL){
|
||||
if(!Q_stricmp(temp->classname, "target_turbolift")) break;
|
||||
}
|
||||
if(temp){
|
||||
|
@ -174,7 +174,7 @@ void ui_msd_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|||
}
|
||||
}
|
||||
if(target->bluesound){
|
||||
while((temp = G_Find(temp, FOFS(targetname), target->bluesound)) != NULL){
|
||||
while((temp = G_Find(temp, FOFS(swapname), target->bluesound)) != NULL){
|
||||
if(!Q_stricmp(temp->classname, "ui_transporter")) break;
|
||||
}
|
||||
if(temp){
|
||||
|
@ -186,7 +186,7 @@ void ui_msd_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|||
}
|
||||
}
|
||||
if(target->falsename){
|
||||
while((temp = G_Find(temp, FOFS(targetname), target->falsename)) != NULL){
|
||||
while((temp = G_Find(temp, FOFS(falsename), target->falsename)) != NULL){
|
||||
if(!Q_stricmp(temp->classname, "target_alert")) break;
|
||||
}
|
||||
if(temp){
|
||||
|
@ -195,6 +195,7 @@ void ui_msd_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|||
}
|
||||
}
|
||||
trap_SendServerCommand(activator-g_entities, va("ui_msd %i %i %i %i %i %i %i %i %i", maxhull, currhull, maxshield, currshield, shieldstate, warpstate, turbostate, transstate, alertstate));
|
||||
//Debugging G_Printf(S_COLOR_YELLOW "ui_msd G %i %i %i %i %i %i %i %i %i\n", maxhull, currhull, maxshield, currshield, shieldstate, warpstate, turbostate, transstate, alertstate);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1299,7 +1299,22 @@ qboolean UI_ConsoleCommand( void ) {
|
|||
}
|
||||
|
||||
if ( Q_stricmp( cmd, "ui_msd" ) == 0 ) {
|
||||
UI_msdMenu( atoi(UI_Argv( 1 )), atoi(UI_Argv( 2 )), atoi(UI_Argv( 3 )), atoi(UI_Argv( 4 )), atoi(UI_Argv( 5 )), atoi(UI_Argv( 6 )), atoi(UI_Argv( 7 )), atoi(UI_Argv( 8 )), atoi(UI_Argv( 9 )) );
|
||||
static char ui_msd1[MAX_STRING_CHARS], ui_msd2[MAX_STRING_CHARS], ui_msd3[MAX_STRING_CHARS], ui_msd4[MAX_STRING_CHARS], ui_msd5[MAX_STRING_CHARS], ui_msd6[MAX_STRING_CHARS], ui_msd7[MAX_STRING_CHARS], ui_msd8[MAX_STRING_CHARS], ui_msd9[MAX_STRING_CHARS];
|
||||
trap_Argv( 1, ui_msd1, sizeof( ui_msd1 ) );
|
||||
trap_Argv( 2, ui_msd2, sizeof( ui_msd2 ) );
|
||||
trap_Argv( 3, ui_msd3, sizeof( ui_msd3 ) );
|
||||
trap_Argv( 4, ui_msd4, sizeof( ui_msd4 ) );
|
||||
trap_Argv( 5, ui_msd5, sizeof( ui_msd5 ) );
|
||||
trap_Argv( 6, ui_msd6, sizeof( ui_msd6 ) );
|
||||
trap_Argv( 7, ui_msd7, sizeof( ui_msd7 ) );
|
||||
trap_Argv( 8, ui_msd8, sizeof( ui_msd8 ) );
|
||||
trap_Argv( 9, ui_msd9, sizeof( ui_msd9 ) );
|
||||
UI_msdMenu( atoi(ui_msd1), atoi(ui_msd2), atoi(ui_msd3), atoi(ui_msd4), atoi(ui_msd5), atoi(ui_msd6), atoi(ui_msd7), atoi(ui_msd8), atoi(ui_msd9));
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if ( Q_stricmp( cmd, "ui_transporter" ) == 0 ) {
|
||||
UI_TransporterMenu( atoi(UI_Argv( 1 )) );
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
UI_TRANSPORTER.C
|
||||
UI_msd.C
|
||||
|
||||
User interface trigger from within game
|
||||
**********************************************************************/
|
||||
|
@ -69,6 +69,9 @@ qhandle_t loading2;
|
|||
qhandle_t loading3;
|
||||
qhandle_t loading4;
|
||||
qhandle_t loading5;
|
||||
qhandle_t redalert;
|
||||
qhandle_t yellowalert;
|
||||
qhandle_t bluealert;
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -100,56 +103,37 @@ static void M_msdMenu_Graphics (void)
|
|||
UI_DrawHandlePic( 20, 24, 64, 32, corner_ul_24_60); // Upper corner
|
||||
|
||||
// Lower corners
|
||||
if(s_msd.alertstate == 2)
|
||||
trap_R_SetColor( colorTable[CT_RED]);
|
||||
else if(s_msd.alertstate == 1)
|
||||
trap_R_SetColor( colorTable[CT_YELLOW]);
|
||||
else if(s_msd.alertstate == 3)
|
||||
trap_R_SetColor( colorTable[CT_BLUE] );
|
||||
else
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3]); //colorTable[CT_VDKPURPLE2]
|
||||
//colorTable[CT_VDKPURPLE2]
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3]);
|
||||
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( "MASTER SYSTEMS DISPLAY",UI_BIGFONT);
|
||||
length += 4;
|
||||
|
||||
// Upper half
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
|
||||
UI_DrawHandlePic( 79, 24, xTurboStart - (79 + length), PROP_BIG_HEIGHT, uis.whiteShader); // Top left line
|
||||
UI_DrawHandlePic( 20, 60, 60, 40, uis.whiteShader); //
|
||||
if(s_msd.alertstate == 2)
|
||||
trap_R_SetColor( colorTable[CT_RED]);
|
||||
else if(s_msd.alertstate == 1)
|
||||
trap_R_SetColor( colorTable[CT_YELLOW]);
|
||||
else if(s_msd.alertstate == 3)
|
||||
trap_R_SetColor( colorTable[CT_BLUE] );
|
||||
else
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3]);
|
||||
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
|
||||
if(s_msd.alertstate == 2){
|
||||
UI_DrawHandlePic( 20, 123, 60, 250, redalert); // Alert Fade Red
|
||||
}else if(s_msd.alertstate == 1){
|
||||
UI_DrawHandlePic( 20, 123, 60, 250, yellowalert); // Alert Fade Yellow
|
||||
}else if(s_msd.alertstate == 3){
|
||||
UI_DrawHandlePic( 20, 123, 60, 250, bluealert); // Alert Fade Blue
|
||||
}else{
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE1]); //DKGOLD1
|
||||
UI_DrawHandlePic( 20, 123, 60, 250, uis.whiteShader); // Left hand column
|
||||
}
|
||||
|
||||
// Lower half
|
||||
if(s_msd.alertstate == 2)
|
||||
trap_R_SetColor( colorTable[CT_RED] );
|
||||
else if(s_msd.alertstate == 1)
|
||||
trap_R_SetColor( colorTable[CT_YELLOW] );
|
||||
else if(s_msd.alertstate == 3)
|
||||
trap_R_SetColor( colorTable[CT_BLUE] );
|
||||
else
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
|
||||
UI_DrawHandlePic( 20, 380, 60, 70, uis.whiteShader); // Left Column
|
||||
|
||||
// Bottom line
|
||||
if(s_msd.alertstate == 2)
|
||||
trap_R_SetColor( colorTable[CT_RED] );
|
||||
else if(s_msd.alertstate == 1)
|
||||
trap_R_SetColor( colorTable[CT_YELLOW] );
|
||||
else if(s_msd.alertstate == 3)
|
||||
trap_R_SetColor( colorTable[CT_BLUE] );
|
||||
else
|
||||
trap_R_SetColor( colorTable[CT_DKPURPLE3] ); //colorTable[CT_VDKPURPLE2]
|
||||
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
|
||||
|
@ -222,6 +206,9 @@ void UI_msdMenu_Cache (void)
|
|||
loading3 = trap_R_RegisterShaderNoMip("menu/new/nav_lb.tga");
|
||||
loading4 = trap_R_RegisterShaderNoMip("menu/new/nav_db.tga");
|
||||
loading5 = trap_R_RegisterShaderNoMip("menu/new/nab_o.tga");
|
||||
redalert = trap_R_RegisterShaderNoMip("menu/alert/red");
|
||||
yellowalert = trap_R_RegisterShaderNoMip("menu/alert/yellow");
|
||||
bluealert = trap_R_RegisterShaderNoMip("menu/alert/blue");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -280,7 +267,6 @@ UI_msdMenu
|
|||
*/
|
||||
void UI_msdMenu(int maxhull, int currhull, int maxshield, int currshield, int shieldstate, int warpstate, int turbostate, int transstate, int alertstate)
|
||||
{
|
||||
|
||||
memset( &s_msd, 0, sizeof( s_msd ) );
|
||||
|
||||
s_msd.maxhull = maxhull;
|
||||
|
|
Loading…
Reference in a new issue