1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Language menu changes

This commit is contained in:
NyakoFox 2024-04-11 17:50:07 -03:00
parent 504208ec30
commit 8c06371eed
3 changed files with 23 additions and 11 deletions

View file

@ -7075,13 +7075,13 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
int button_x = 0; int button_x = 0;
int button_y = 0; int button_y = 0;
bool spawn_buttons = false; bool spawn_buttons = false;
if (i >= (languagepage * 16)) if (i >= (languagepage * 12))
{ {
spawn_buttons = true; spawn_buttons = true;
button_count++; button_count++;
button_x = (button_count >= 8) ? 240 : 80; button_x = (button_count >= 6) ? 240 : 80;
button_y = 32 + 20 * (button_count % 8); button_y = 32 + 26 * (button_count % 6);
if (button_count >= 16) if (button_count >= 12)
{ {
spawn_buttons = false; spawn_buttons = false;
} }
@ -7093,8 +7093,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
if (spawn_buttons) if (spawn_buttons)
{ {
int button_width = SDL_max(120, font::len(PR_1X, loc::languagelist[i].code.c_str()) + 16); int button_width = SDL_max(136, font::len(PR_1X, loc::languagelist[i].code.c_str()) + 16);
touch::create_menu_button(button_x - button_width / 2, button_y, button_width, 16, loc::languagelist[i].code.c_str(), i); touch::create_menu_button(button_x - button_width / 2, button_y, button_width, 24, loc::languagelist[i].code.c_str(), i);
} }
} }
else else
@ -7108,8 +7108,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
if (spawn_buttons) if (spawn_buttons)
{ {
int button_width = SDL_max(120, font::len(flags, loc::languagelist[i].nativename.c_str()) + 16); int button_width = SDL_max(136, font::len(flags, loc::languagelist[i].nativename.c_str()) + 16);
touch::create_menu_button_flags(button_x - button_width / 2, button_y, button_width, 16, loc::languagelist[i].nativename.c_str(), i, flags); touch::create_menu_button_flags(button_x - button_width / 2, button_y, button_width, 24, loc::languagelist[i].nativename.c_str(), i, flags);
} }
} }
} }
@ -7119,7 +7119,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
} }
touch::create_menu_button(46 - 16, 200, 76, 26, loc::gettext("previous"), -2); 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(122, 200, 76, 26, loc::gettext("ok"), -3);
touch::create_menu_button(198 + 16, 200, 76, 26, loc::gettext("next"), -1); touch::create_menu_button(198 + 16, 200, 76, 26, loc::gettext("next"), -1);
break; break;

View file

@ -1264,7 +1264,7 @@ void menuactionpress(void)
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() / 12.0));
loc::loadlanguagelist(); loc::loadlanguagelist();
game.createmenu(Menu::language, true); game.createmenu(Menu::language, true);
game.currentmenuoption = loc::languagelist_curlang; game.currentmenuoption = loc::languagelist_curlang;
@ -1273,7 +1273,7 @@ void menuactionpress(void)
else if (game.currentmenuoption == -1) else if (game.currentmenuoption == -1)
{ {
// 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() / 12.0));
loc::loadlanguagelist(); loc::loadlanguagelist();
game.createmenu(Menu::language, true); game.createmenu(Menu::language, true);
game.currentmenuoption = loc::languagelist_curlang; game.currentmenuoption = loc::languagelist_curlang;

View file

@ -611,6 +611,18 @@ namespace touch
font::print(PR_CJK_LOW | font_scale | button->flags, button->x + 16 + offset * scale, button->y + ((button->height - height) / 2 + offset) * scale, button->text, use_r, use_g, use_b); font::print(PR_CJK_LOW | font_scale | button->flags, button->x + 16 + offset * scale, button->y + ((button->height - height) / 2 + offset) * scale, button->text, use_r, use_g, use_b);
break; break;
default: default:
// This is a dumb hack for the language menu, but... if this button is NOT for the current language, darken it (unless it's negative)
if (game.currentmenuname == Menu::language)
{
if (button->id != game.currentmenuoption && button->id >= 0)
{
use_r /= 2;
use_g /= 2;
use_b /= 2;
}
}
graphics.fill_rect(button->x + 4 * scale, button->y + 4 * scale, button->width, button->height, r / shadow_div, g / shadow_div, b / shadow_div); graphics.fill_rect(button->x + 4 * scale, button->y + 4 * scale, button->width, button->height, r / shadow_div, g / shadow_div, b / shadow_div);
graphics.fill_rect(button->x + offset * scale, button->y + offset * scale, button->width, button->height, use_r, use_g, use_b); graphics.fill_rect(button->x + offset * scale, button->y + offset * scale, button->width, button->height, use_r, use_g, use_b);