Touch input menu

This commit is contained in:
NyakoFox 2024-04-09 18:04:31 -03:00
parent 59c74955ee
commit f061bfa66b
3 changed files with 48 additions and 19 deletions

View File

@ -6980,6 +6980,15 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option(loc::gettext("return"));
menuyoff = 0;
maxspacing = 15;
auto_buttons = false;
touch::create_slider_button((320 - 160) / 2, 120 + 32, 160, 48, loc::gettext("ui scale"), &touch::scale, 5, 20);
touch::create_menu_button(46 - 16, 200, 76, 26, loc::gettext("previous"), -2);
touch::create_menu_button(122, 200, 76, 26, loc::gettext("return"), 2);
touch::create_menu_button(198 + 16, 200, 76, 26, loc::gettext("next"), -1);
break;
case Menu::language:
if (loc::languagelist.empty())

View File

@ -1184,7 +1184,7 @@ void menuactionpress(void)
}
if (game.currentmenuoption == -1)
{
// audio menu
// touch input menu
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::touch_input, true);
map.nexttowercolour();
@ -2039,6 +2039,18 @@ void menuactionpress(void)
case Menu::touch_input:
switch (game.currentmenuoption)
{
case -2:
// audio menu
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::audiooptions, true);
map.nexttowercolour();
break;
case -1:
// accessibility menu
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::accessibility, true);
map.nexttowercolour();
break;
case 0:
music.playef(Sound_CRY);
break;

View File

@ -800,6 +800,13 @@ static void menurender(void)
break;
}
case Menu::touch_input:
{
if (key.using_touch)
{
font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Touch Input"), tr, tg, tb);
font::print_wrap(PR_CEN, -1, 65, loc::gettext("Change touch input options."), tr, tg, tb);
}
else
{
switch (game.currentmenuoption)
{
@ -824,6 +831,7 @@ static void menurender(void)
break;
}
}
}
break;
case Menu::language:
if (loc::languagelist.empty())