Show skip prompt during credits and ending picture

This adds a "- Press {button} to skip -" prompt to both the credits and
ending picture sequences.

It was always possible to skip them by pressing Enter, but not many
people knew this. In fact, even I didn't know this until I saw Elomavi
do it a year or so ago. So it's not really intuitive that this is
possible.

The prompt only shows up if you've completed the game before, and
disappears after two seconds similar to the "[Press {button} to return
to editor]" text.

Unfortunately, given how the game works, game completion is detected
based on if you have unlocked Flip Mode or not. At this point, the
unlock for the game being completed (unlock 5) will already be set to
true no matter what during the Plenary fanfare, but the Flip Mode unlock
(unlock 18) won't be until the player hits "play" on the main menu. As a
special case, the prompt will always show up in M&P (because Flip Mode
is always unlocked in M&P).
This commit is contained in:
Misa 2023-05-22 12:18:40 -07:00
parent d841612be2
commit ef46dadb68
20 changed files with 90 additions and 0 deletions

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Prem {button} per a activar el terminal" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="{button} per a activar els terminals" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Prem {button} per a interaccionar" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passió per lexploració" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Prement sempre endavant" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positivitat en la força" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Aktiviere das Terminal mit {button}" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Drücke {button}, um Terminals zu aktivieren" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Drücke {button} zum Interagieren" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Premu {button} por aktivigi terminalon" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Premu {button} por aktivigi terminalojn" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Premu {button} por interagi" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Pulsa {button} para activar terminal" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Pulsa {button} para activar terminales" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Pulsa {button} para interactuar" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="{button} pour activer le terminal" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="{button} pour activer les terminaux" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="{button} pour interagir" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Premi {button} per attivare il terminale" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Premi {button} per attivare i terminali" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Premi {button} per interagire" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="{button}: Terminal activeren" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="{button}: Terminals activeren" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="{button}: Interactie" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Aperte {button} para ativar o terminal" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Aperte {button} para ativar os terminais" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Aperte {button} para interagir" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="Prime {button} para ativar o terminal" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="Prime {button} para ativar os terminais" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Prime {button} para interagir" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="{button}: активировать терминал" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="{button}: активировать терминалы" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="{button}: взаимодействовать" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -498,6 +498,7 @@
<string english="Press {button} to activate terminal" translation="{button}, terminali etkinleştirir" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="Press {button} to activate terminals" translation="{button}, terminalleri etkinleştirir" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed. there are 3 next to each other in the ship" max="37"/>
<string english="Press {button} to interact" translation="Etkileşim kurmak için {button} tuşuna bas" explanation="keyboard key (E or ENTER) or controller button glyph is filled in for {button}. max is when displayed" max="37"/>
<string english="- Press {button} to skip -" translation="" explanation="keyboard key (ENTER) or controller button glyph is filled in for {button}. max is when displayed. This prompt is for skipping cutscenes" max="40"/>
<string english="Passion for Exploring" translation="Passion for Exploring" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Pushing Onwards" translation="Pushing Onwards" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>
<string english="Positive Force" translation="Positive Force" explanation="jukebox prompt. song name should probably not be translated" max="37*2"/>

View File

@ -384,6 +384,9 @@ void Game::init(void)
disabletemporaryaudiopause = true;
inputdelay = false;
old_skip_message_timer = 0;
skip_message_timer = 0;
setdefaultcontrollerbuttons();
}

View File

@ -531,6 +531,9 @@ public:
bool inputdelay;
bool statelocked;
int old_skip_message_timer;
int skip_message_timer;
};
#ifndef GAME_DEFINITION

View File

@ -78,6 +78,8 @@ void gamecompletelogic(void)
//Return to game
game.gamestate = GAMECOMPLETE2;
graphics.fademode = FADE_START_FADEIN;
game.skip_message_timer = 1000;
game.old_skip_message_timer = 1000;
}
}

View File

@ -157,6 +157,45 @@ static void inline drawglitchrunnertext(const int y)
font::print_wrap(PR_CEN, -1, y, buffer, tempr, tempg, tempb);
}
static inline void draw_skip_message()
{
/* Unlock 18 is Flip Mode.
* If this is the first playthrough, 5 (game completed) will be unlocked
* but not Flip Mode until the player hits "play" on the title screen */
bool draw =
#ifndef MAKEANDPLAY
game.unlock[18] &&
#endif
graphics.fademode == FADE_NONE;
if (!draw)
{
return;
}
const int alpha = graphics.lerp(
game.old_skip_message_timer, game.skip_message_timer
);
draw = alpha > 100;
if (!draw)
{
return;
}
char buffer[SCREEN_WIDTH_CHARS + 1];
vformat_buf(
buffer, sizeof(buffer),
loc::gettext("- Press {button} to skip -"),
"button:but",
vformat_button(ActionSet_InGame, Action_InGame_Map)
);
font::print(
PR_BRIGHTNESS(alpha) | PR_BOR | PR_CEN,
-1, graphics.flipmode ? 20 : 210, buffer,
220 - help.glow, 220 - help.glow, 255 - help.glow / 2
);
}
static void menurender(void)
{
@ -1875,6 +1914,8 @@ void gamecompleterender(void)
font::print(PR_2X | PR_CEN | PR_CJK_LOW, -1, creditOffset + position, loc::gettext("playing!"), tr, tg, tb);
}
draw_skip_message();
graphics.drawfade();
graphics.render();
@ -1907,6 +1948,8 @@ void gamecompleterender2(void)
graphics.fill_rect(graphics.lerp(game.oldcreditposx * 8, game.creditposx * 8) + 8, game.creditposy * 8, 8, 8, 0, 0, 0);
draw_skip_message();
graphics.drawfade();
graphics.render();

View File

@ -21,6 +21,21 @@ static inline void titleupdatetextcol(void)
if(graphics.col_tb>255) graphics.col_tb=255;
}
static inline void tick_skip_message_timer(void)
{
const bool tick = graphics.fademode == FADE_NONE;
if (!tick)
{
return;
}
game.old_skip_message_timer = game.skip_message_timer;
if (game.skip_message_timer > 0)
{
game.skip_message_timer -= 15;
}
}
void gamerenderfixed(void)
{
if (!game.blackout && !game.completestop)
@ -257,4 +272,11 @@ void gamecompleterenderfixed(void)
graphics.updatetitlecolours();
titleupdatetextcol();
tick_skip_message_timer();
}
void gamecompleterenderfixed2(void)
{
tick_skip_message_timer();
}

View File

@ -11,4 +11,6 @@ void teleporterrenderfixed(void);
void gamecompleterenderfixed(void);
void gamecompleterenderfixed2(void);
#endif /* RENDERFIXED_H */

View File

@ -1424,6 +1424,8 @@ void scriptclass::run(void)
game.gamestate = GAMECOMPLETE;
graphics.fademode = FADE_START_FADEIN;
game.creditposition = 0;
game.skip_message_timer = 1000;
game.old_skip_message_timer = 1000;
}
}
else if (words[0] == "finalmode")

View File

@ -175,6 +175,7 @@ static const inline struct ImplFunc* get_gamestate_funcs(
FUNC_LIST_END
FUNC_LIST_BEGIN(GAMECOMPLETE2)
{Func_fixed, gamecompleterenderfixed2},
{Func_delta, gamecompleterender2},
{Func_input, gamecompleteinput2},
{Func_fixed, gamecompletelogic2},