Rework intro skipping

- Pressing/holding any input will now skip only ONE screen of the Intro, like a REAL VIDEOGAME
- Allow you to skip before the end of INTROSCENE_DISCLAIMER, but only once the text has been solid for half a second
- Fix regression re exiting title demos after using -skipintro command line parameter
    - intro_scenenum was stuck at 0, so the game was softlocked!
This commit is contained in:
toaster 2024-03-19 22:03:09 +00:00
parent 15344f56cd
commit 1c971660a9
2 changed files with 42 additions and 19 deletions

View file

@ -671,13 +671,42 @@ void F_IntroTicker(void)
return;
}
if (timetonext <= 0)
// check for skipping
const boolean disclaimerskippable =
(
intro_scenenum == INTROSCENE_DISCLAIMER
&& dc_state == DISCLAIMER_FINAL
&& dc_tics >= (TICRATE/2) + (5*6) // bottom text needs to fade all the way in
);
const boolean doskip =
(
skippableallowed
&& keypressed
&& (timetonext > 10)
&& (
intro_scenenum >= INTROSCENE_KREW
|| disclaimerskippable
)
);
if (keypressed)
keypressed = false;
if (doskip && disclaimerskippable)
{
dc_state = DISCLAIMER_OUT;
dc_tics = 0;
timetonext = 10;
}
else if (doskip || timetonext <= 0)
{
intro_scenenum++;
if (intro_scenenum == (M_GameTrulyStarted()
? NUMINTROSCENES
: INTROSCENE_KREW)
)
INT32 destscenenum = NUMINTROSCENES-1;
if (M_GameTrulyStarted() == false)
destscenenum = INTROSCENE_DISCLAIMER;
else if (doskip)
destscenenum = INTROSCENE_KREW;
if (intro_scenenum > destscenenum)
{
D_StartTitle();
// Custom built fade to skip the to-black
@ -687,10 +716,14 @@ void F_IntroTicker(void)
//F_NewCutscene(introtext[intro_scenenum]);
timetonext = introscenetime[intro_scenenum];
animtimer = stoptimer = 0;
if (intro_scenenum == INTROSCENE_DISCLAIMER)
wipegamestate = -1;
if (intro_scenenum == INTROSCENE_KREW)
if (
doskip
|| intro_scenenum == INTROSCENE_DISCLAIMER
|| intro_scenenum == INTROSCENE_KREW
)
{
wipegamestate = -1;
}
}
if (intro_scenenum == INTROSCENE_KREW)
@ -711,10 +744,6 @@ void F_IntroTicker(void)
F_WriteText();
// check for skipping
if (keypressed)
keypressed = false;
if (animtimer > 0)
animtimer--;
}
@ -776,12 +805,6 @@ boolean F_IntroResponder(event_t *event)
if (keypressed)
return false;
if (intro_scenenum <= INTROSCENE_DISCLAIMER)
{
// do not allow skipping the disclaimer
return false;
}
keypressed = true;
return true;
}

View file

@ -1399,7 +1399,7 @@ boolean G_Responder(event_t *ev)
{
if (F_IntroResponder(ev))
{
D_SetDeferredStartTitle(true);
//D_SetDeferredStartTitle(true); -- intro state tracked in f_finale directly
return true;
}
}