mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 18:39:45 +01:00
Accessibility menu
This commit is contained in:
parent
3bdeaf8ed3
commit
21496e32f1
3 changed files with 117 additions and 67 deletions
|
@ -6993,8 +6993,13 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
break;
|
||||
}
|
||||
case Menu::accessibility:
|
||||
{
|
||||
int offset = -1;
|
||||
#if !defined(MAKEANDPLAY)
|
||||
option(loc::gettext("unlock play modes"));
|
||||
// For now, we're not going to allow the player to unlock play modes from the options menu, until we come up with a good UI for it.
|
||||
//touch::create_menu_button((320 - 160) / 2, 120 - 32, 160, 26, loc::gettext("unlock play modes"), 0);
|
||||
offset = 0;
|
||||
#endif
|
||||
option(loc::gettext("invincibility"), !ingame_titlemode || !incompetitive());
|
||||
option(loc::gettext("slowdown"), !ingame_titlemode || !incompetitive());
|
||||
|
@ -7005,8 +7010,19 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
menuyoff = 0;
|
||||
maxspacing = 15;
|
||||
|
||||
buttonscentered = true;
|
||||
auto_buttons = false;
|
||||
|
||||
touch::create_toggle_button((320 - 160) / 2, 120 - 24 - 8, 160, 12, loc::gettext("invincibility"), offset + 1, map.invincibility);
|
||||
touch::create_slider_button((320 - 160) / 2, 120 - 16, 160, 48, loc::gettext("game speed"), &slowdown, 12, 30);
|
||||
touch::create_toggle_button((320 - 160) / 2, 120 + 32, 160, 12, loc::gettext("animated backgrounds"), offset + 3, !colourblindmode);
|
||||
touch::create_toggle_button((320 - 160) / 2, 120 + 48, 160, 12, loc::gettext("screen effects"), offset + 4, !noflashingmode);
|
||||
touch::create_toggle_button((320 - 160) / 2, 120 + 64, 160, 12, loc::gettext("text outline"), offset + 5, !graphics.notextoutline);
|
||||
|
||||
touch::create_menu_button(46 - 16, 200, 76, 26, loc::gettext("previous"), -2);
|
||||
touch::create_menu_button(122, 200, 76, 26, loc::gettext("return"), offset + 6);
|
||||
touch::create_menu_button(198 + 16, 200, 76, 26, loc::gettext("next"), -1);
|
||||
break;
|
||||
}
|
||||
case Menu::controller:
|
||||
option(loc::gettext("analog stick sensitivity"));
|
||||
option(loc::gettext("bind flip"));
|
||||
|
@ -7027,7 +7043,9 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
|
||||
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((320 - 160) / 2, 120 - 32, 160, 26, loc::gettext("control style"), 1, false);
|
||||
|
||||
touch::create_slider_button((320 - 160) / 2, 120 + 16, 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);
|
||||
|
@ -7035,6 +7053,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
|
||||
break;
|
||||
case Menu::language:
|
||||
auto_buttons = false;
|
||||
if (loc::languagelist.empty())
|
||||
{
|
||||
option(loc::gettext("ok"));
|
||||
|
@ -7061,6 +7080,11 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
menuyoff = 70-(menuoptions.size()*10);
|
||||
maxspacing = 5;
|
||||
}
|
||||
|
||||
touch::create_menu_button(46 - 16, 200, 76, 26, loc::gettext("previous"), -2);
|
||||
touch::create_menu_button(122, 200, 76, 26, loc::gettext("return"), -3);
|
||||
touch::create_menu_button(198 + 16, 200, 76, 26, loc::gettext("next"), -1);
|
||||
|
||||
break;
|
||||
case Menu::translator_main:
|
||||
option(loc::gettext("translator options"));
|
||||
|
@ -7159,6 +7183,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
option(loc::gettext("no, return to options"));
|
||||
option(loc::gettext("yes, enable"));
|
||||
menuyoff = 64;
|
||||
buttonyoff = -24;
|
||||
break;
|
||||
case Menu::setslowdown:
|
||||
option(loc::gettext("normal speed"));
|
||||
|
@ -7345,7 +7370,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
{
|
||||
option(loc::gettext("secret lab"));
|
||||
}
|
||||
option(loc::gettext("play modes"));
|
||||
option(loc::gettext("play modes"), true, PR_RTL_XFLIP, false); // Disable an auto button for play modes for now, we haven't done the menu
|
||||
if (save_exists())
|
||||
{
|
||||
option(loc::gettext("new game"));
|
||||
|
@ -7375,6 +7400,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
option(loc::gettext("start new game"));
|
||||
option(loc::gettext("return"));
|
||||
menuyoff = 64;
|
||||
buttonyoff = -16;
|
||||
break;
|
||||
case Menu::playmodes:
|
||||
option(loc::gettext("time trials"), !nocompetitive_unless_translator());
|
||||
|
@ -7544,10 +7570,11 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
{
|
||||
if (menuoptions[i].auto_button)
|
||||
{
|
||||
int button_width = SDL_max(160, font::len(menuoptions[i].print_flags, menuoptions[i].text) + 16);
|
||||
touch::create_menu_button(
|
||||
(320 - 160) / 2,
|
||||
(320 - button_width) / 2,
|
||||
base_y + offset * (button_height + button_spacing),
|
||||
160,
|
||||
button_width,
|
||||
button_height,
|
||||
menuoptions[i].text,
|
||||
i,
|
||||
|
|
|
@ -902,6 +902,21 @@ void menuactionpress(void)
|
|||
break;
|
||||
case Menu::accessibility:
|
||||
{
|
||||
if (game.currentmenuoption == -2)
|
||||
{
|
||||
// touch menu
|
||||
music.playef(Sound_VIRIDIAN);
|
||||
game.createmenu(Menu::touch_input, true);
|
||||
map.nexttowercolour();
|
||||
}
|
||||
if (game.currentmenuoption == -1)
|
||||
{
|
||||
// language menu
|
||||
music.playef(Sound_VIRIDIAN);
|
||||
game.createmenu(Menu::language, true);
|
||||
map.nexttowercolour();
|
||||
}
|
||||
|
||||
int accessibilityoffset = 0;
|
||||
#if !defined(MAKEANDPLAY)
|
||||
accessibilityoffset = 1;
|
||||
|
|
|
@ -1236,6 +1236,13 @@ static void menurender(void)
|
|||
break;
|
||||
case Menu::accessibility:
|
||||
{
|
||||
if (key.using_touch)
|
||||
{
|
||||
font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Accessibility"), tr, tg, tb);
|
||||
font::print_wrap(PR_CEN, -1, 65, loc::gettext("Disable screen effects, enable slowdown modes or invincibility."), tr, tg, tb);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef MAKEANDPLAY
|
||||
#define OFFSET 0
|
||||
#else
|
||||
|
@ -1320,6 +1327,7 @@ static void menurender(void)
|
|||
font::print(PR_BOR | PR_CEN, -1, next_y, text, 255, 255, 255);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue