1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-09 18:39:45 +01:00

Fix first-time lang screen

This commit is contained in:
NyakoFox 2024-04-11 12:37:54 -03:00
parent a32bf13691
commit d54af27e9a

View file

@ -1236,16 +1236,28 @@ void menuactionpress(void)
if (game.currentmenuoption == -3) if (game.currentmenuoption == -3)
{ {
// return // return
if (loc::pre_title_lang_menu)
{
/* Make the title screen appear, we haven't seen it yet.
* game.returnmenu() works because Menu::mainmenu
* is created before the language menu. */
game.menustart = false;
loc::pre_title_lang_menu = false;
}
else
{
map.nexttowercolour();
game.currentmenuoption = loc::languagelist_curlang;
}
game.returnmenu(); game.returnmenu();
map.nexttowercolour();
game.currentmenuoption = loc::languagelist_curlang;
} }
else if (game.currentmenuoption == -2) else if (game.currentmenuoption == -2)
{ {
// go left a page (or wrap to end) // go left a page (or wrap to end)
game.languagepage = POS_MOD(game.languagepage - 1, (int) SDL_ceilf(loc::languagelist.size() / 16.0)); game.languagepage = POS_MOD(game.languagepage - 1, (int) SDL_ceilf(loc::languagelist.size() / 16.0));
loc::loadlanguagelist(); loc::loadlanguagelist();
loc::pre_title_lang_menu = false;
game.createmenu(Menu::language, true); game.createmenu(Menu::language, true);
game.currentmenuoption = loc::languagelist_curlang; game.currentmenuoption = loc::languagelist_curlang;
map.nexttowercolour(); map.nexttowercolour();
@ -1255,7 +1267,6 @@ void menuactionpress(void)
// go right a page (or wrap to start) // go right a page (or wrap to start)
game.languagepage = POS_MOD(game.languagepage + 1, (int) SDL_ceilf(loc::languagelist.size() / 16.0)); game.languagepage = POS_MOD(game.languagepage + 1, (int) SDL_ceilf(loc::languagelist.size() / 16.0));
loc::loadlanguagelist(); loc::loadlanguagelist();
loc::pre_title_lang_menu = false;
game.createmenu(Menu::language, true); game.createmenu(Menu::language, true);
game.currentmenuoption = loc::languagelist_curlang; game.currentmenuoption = loc::languagelist_curlang;
map.nexttowercolour(); map.nexttowercolour();
@ -1272,15 +1283,6 @@ void menuactionpress(void)
graphics.grphx.init_translations(); graphics.grphx.init_translations();
} }
if (loc::pre_title_lang_menu)
{
/* Make the title screen appear, we haven't seen it yet.
* game.returnmenu() works because Menu::mainmenu
* is created before the language menu. */
game.menustart = false;
loc::pre_title_lang_menu = false;
}
if (prev_lang != loc::lang) if (prev_lang != loc::lang)
{ {
recomputetextboxes(); recomputetextboxes();
@ -1288,6 +1290,15 @@ void menuactionpress(void)
if (!key.using_touch) if (!key.using_touch)
{ {
if (loc::pre_title_lang_menu)
{
/* Make the title screen appear, we haven't seen it yet.
* game.returnmenu() works because Menu::mainmenu
* is created before the language menu. */
game.menustart = false;
loc::pre_title_lang_menu = false;
}
game.returnmenu(); game.returnmenu();
map.nexttowercolour(); map.nexttowercolour();
} }
@ -1295,7 +1306,6 @@ void menuactionpress(void)
{ {
// We need to respawn the buttons // We need to respawn the buttons
loc::loadlanguagelist(); loc::loadlanguagelist();
loc::pre_title_lang_menu = false;
game.createmenu(Menu::language, true); game.createmenu(Menu::language, true);
game.currentmenuoption = loc::languagelist_curlang; game.currentmenuoption = loc::languagelist_curlang;
} }