mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-22 00:39:46 +01:00
Recompute text boxes in Flip Mode
With the new system of retranslating text boxes on-the-fly, this also enables us to retranslate them whenever the player toggles Flip Mode. This is relevant because the Intermission 1 instructional text boxes refer to a floor when Flip Mode is off, but when it is on, it talks about the ceiling.
This commit is contained in:
parent
94b9722b7b
commit
d989c232af
1 changed files with 17 additions and 6 deletions
|
@ -269,6 +269,16 @@ static void updatebuttonmappings(int bind)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void recomputetextboxes(void)
|
||||||
|
{
|
||||||
|
/* Retranslate and reposition all text boxes. */
|
||||||
|
for (size_t i = 0; i < graphics.textboxes.size(); i++)
|
||||||
|
{
|
||||||
|
graphics.textboxes[i].updatetext();
|
||||||
|
graphics.textboxes[i].applyposition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void toggleflipmode(void)
|
static void toggleflipmode(void)
|
||||||
{
|
{
|
||||||
graphics.setflipmode = !graphics.setflipmode;
|
graphics.setflipmode = !graphics.setflipmode;
|
||||||
|
@ -283,6 +293,12 @@ static void toggleflipmode(void)
|
||||||
{
|
{
|
||||||
music.playef(Sound_VIRIDIAN);
|
music.playef(Sound_VIRIDIAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Some text boxes change depending on Flip Mode, so update text boxes. */
|
||||||
|
const bool temp = graphics.flipmode;
|
||||||
|
graphics.flipmode = graphics.setflipmode;
|
||||||
|
recomputetextboxes();
|
||||||
|
graphics.flipmode = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fadetomode = false;
|
static bool fadetomode = false;
|
||||||
|
@ -1131,12 +1147,7 @@ static void menuactionpress(void)
|
||||||
|
|
||||||
if (prev_lang != loc::lang)
|
if (prev_lang != loc::lang)
|
||||||
{
|
{
|
||||||
/* Retranslate and reposition all text boxes. */
|
recomputetextboxes();
|
||||||
for (size_t i = 0; i < graphics.textboxes.size(); i++)
|
|
||||||
{
|
|
||||||
graphics.textboxes[i].updatetext();
|
|
||||||
graphics.textboxes[i].applyposition();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
game.returnmenu();
|
game.returnmenu();
|
||||||
|
|
Loading…
Reference in a new issue