mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Credits: Add the sliding intermission button for skipping
Rules of skipping are slightly changed to match the slidein. - No skipping in the first two seconds - Automatically shuffles away once it gets to the end
This commit is contained in:
parent
40a79056fa
commit
75900e4891
2 changed files with 46 additions and 19 deletions
|
|
@ -712,6 +712,7 @@ void F_StartCredits(void)
|
||||||
finalecount = 0;
|
finalecount = 0;
|
||||||
animtimer = 0;
|
animtimer = 0;
|
||||||
timetonext = 2*TICRATE;
|
timetonext = 2*TICRATE;
|
||||||
|
keypressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void F_CreditDrawer(void)
|
void F_CreditDrawer(void)
|
||||||
|
|
@ -769,6 +770,15 @@ void F_CreditDrawer(void)
|
||||||
if (((y>>FRACBITS) * vid.dupy) > vid.height)
|
if (((y>>FRACBITS) * vid.dupy) > vid.height)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (finalecount)
|
||||||
|
{
|
||||||
|
Y_DrawIntermissionButton(-1, (timetonext ? 5*TICRATE : TICRATE) - finalecount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Y_DrawIntermissionButton(timetonext, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void F_CreditTicker(void)
|
void F_CreditTicker(void)
|
||||||
|
|
@ -805,18 +815,6 @@ void F_CreditTicker(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits)
|
|
||||||
if (!credits[i] && y <= 120<<FRACBITS && !finalecount)
|
|
||||||
{
|
|
||||||
timetonext = 5*TICRATE+1;
|
|
||||||
finalecount = 5*TICRATE;
|
|
||||||
|
|
||||||
// You watched all the credits? What a trooper!
|
|
||||||
gamedata->everfinishedcredits = true;
|
|
||||||
if (M_UpdateUnlockablesAndExtraEmblems(true, true))
|
|
||||||
G_SaveGameData();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timetonext)
|
if (timetonext)
|
||||||
timetonext--;
|
timetonext--;
|
||||||
else
|
else
|
||||||
|
|
@ -824,8 +822,39 @@ void F_CreditTicker(void)
|
||||||
|
|
||||||
credbgtimer++;
|
credbgtimer++;
|
||||||
|
|
||||||
if (finalecount && --finalecount == 0)
|
// Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits)
|
||||||
F_StartGameEvaluation();
|
|
||||||
|
if (finalecount)
|
||||||
|
{
|
||||||
|
if (--finalecount == 0)
|
||||||
|
{
|
||||||
|
F_StartGameEvaluation();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keypressed)
|
||||||
|
{
|
||||||
|
finalecount = TICRATE;
|
||||||
|
|
||||||
|
if (netgame
|
||||||
|
&& (server || IsPlayerAdmin(consoleplayer))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!credits[i] && y <= 120<<FRACBITS)
|
||||||
|
{
|
||||||
|
timetonext = 5*TICRATE;
|
||||||
|
finalecount = 5*TICRATE;
|
||||||
|
|
||||||
|
// You watched all the credits? What a trooper!
|
||||||
|
gamedata->everfinishedcredits = true;
|
||||||
|
if (M_UpdateUnlockablesAndExtraEmblems(true, true))
|
||||||
|
G_SaveGameData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean F_CreditResponder(event_t *event)
|
boolean F_CreditResponder(event_t *event)
|
||||||
|
|
@ -881,6 +910,9 @@ boolean F_CreditResponder(event_t *event)
|
||||||
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
|
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (timetonext)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (keypressed)
|
if (keypressed)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1370,11 +1370,6 @@ boolean G_Responder(event_t *ev)
|
||||||
|
|
||||||
if (F_CreditResponder(ev))
|
if (F_CreditResponder(ev))
|
||||||
{
|
{
|
||||||
// Skip credits for everyone
|
|
||||||
if (! netgame)
|
|
||||||
F_StartGameEvaluation();
|
|
||||||
else if (server || IsPlayerAdmin(consoleplayer))
|
|
||||||
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue