Screen for waiting during intermission after connecting

This commit is contained in:
Sryder 2018-07-02 22:11:03 +01:00
parent 5c2110dafe
commit c8f61edea5
5 changed files with 58 additions and 2 deletions

View file

@ -2145,6 +2145,7 @@ static void CL_ConnectToServer(boolean viams)
} }
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes)))); while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
F_StartWaitingPlayers();
DEBFILE(va("Synchronisation Finished\n")); DEBFILE(va("Synchronisation Finished\n"));
displayplayer = consoleplayer; displayplayer = consoleplayer;

View file

@ -386,6 +386,8 @@ static void D_Display(void)
case GS_WAITINGPLAYERS: case GS_WAITINGPLAYERS:
// The clientconnect drawer is independent... // The clientconnect drawer is independent...
// I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer();
case GS_DEDICATEDSERVER: case GS_DEDICATEDSERVER:
case GS_NULL: case GS_NULL:
break; break;

View file

@ -58,6 +58,9 @@ static patch_t *ttkart; // *vroom* KART
static patch_t *ttcheckers; // *vroom* KART static patch_t *ttcheckers; // *vroom* KART
static patch_t *ttkflash; // flash screen static patch_t *ttkflash; // flash screen
static patch_t *driver[2]; // Driving character on the waiting screen
static UINT8 *waitcolormap; // colormap for the spinning character
static void F_SkyScroll(INT32 scrollspeed); static void F_SkyScroll(INT32 scrollspeed);
// //
@ -1015,6 +1018,50 @@ void F_TitleDemoTicker(void)
keypressed = false; keypressed = false;
} }
// ================
// WAITINGPLAYERS
// ================
void F_StartWaitingPlayers(void)
{
INT32 i;
INT32 randskin;
spriteframe_t *sprframe;
wipegamestate = GS_TITLESCREEN; // technically wiping from title screen
finalecount = 0;
randskin = M_RandomKey(numskins);
waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0);
for (i = 0; i < 2; i++)
{
sprframe = &skins[randskin].spritedef.spriteframes[(6+i) & FF_FRAMEMASK];
driver[i] = W_CachePatchNum(sprframe->lumppat[1], PU_LEVEL);
}
}
void F_WaitingPlayersTicker()
{
finalecount++;
// dumb hack, only start the music on the 1st tick so if you instantly go into the map you aren't hearing a tic of music
if (finalecount == 2)
S_ChangeMusicInternal("WAIT2J", true);
}
void F_WaitingPlayersDrawer(void)
{
UINT32 frame = (finalecount % 8) / 4; // The game only tics every other frame while waitingplayers
INT32 flags = V_FLIP;
const char *waittext1 = "You will join";
const char *waittext2 = "the next race...";
V_DrawFill(0, 0, 320, 200, 31);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
}
// ========== // ==========
// CONTINUE // CONTINUE
// ========== // ==========

View file

@ -39,6 +39,10 @@ FUNCMATH void F_GameEndDrawer(void);
void F_IntroDrawer(void); void F_IntroDrawer(void);
void F_TitleScreenDrawer(void); void F_TitleScreenDrawer(void);
void F_StartWaitingPlayers(void);
void F_WaitingPlayersTicker(void);
void F_WaitingPlayersDrawer(void);
void F_GameEvaluationDrawer(void); void F_GameEvaluationDrawer(void);
void F_StartGameEvaluation(void); void F_StartGameEvaluation(void);
void F_GameEvaluationTicker(void); void F_GameEvaluationTicker(void);

View file

@ -2155,9 +2155,11 @@ void G_Ticker(boolean run)
break; break;
case GS_TITLESCREEN: case GS_TITLESCREEN:
case GS_WAITINGPLAYERS:
F_TitleScreenTicker(run); F_TitleScreenTicker(run);
break; break;
case GS_WAITINGPLAYERS:
F_WaitingPlayersTicker();
break;
case GS_DEDICATEDSERVER: case GS_DEDICATEDSERVER:
case GS_NULL: case GS_NULL:
@ -3630,7 +3632,7 @@ void G_SaveGameData(boolean force)
if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified
modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@; modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@;
else if (modifiedgame && !savemoddata) else if (modifiedgame && !savemoddata)
{ {
free(savebuffer); free(savebuffer);
save_p = savebuffer = NULL; save_p = savebuffer = NULL;