Fix first-time lang screen
This commit is contained in:
parent
1007c7f85f
commit
d6d29a8898
|
@ -1230,16 +1230,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();
|
||||||
|
@ -1249,7 +1261,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();
|
||||||
|
@ -1266,15 +1277,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();
|
||||||
|
@ -1282,6 +1284,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();
|
||||||
}
|
}
|
||||||
|
@ -1289,7 +1300,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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue