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

Game.cpp: make menu options (in Game::createmenu) translatable

This mainly adds loc::gettext calls for menu option labels.

This commit is part of rewritten history of the localization branch.
The original (unsquashed) commit history can be found here:
https://github.com/Dav999-v/VVVVVV/tree/localization-orig
This commit is contained in:
Dav999-v 2022-12-30 23:32:38 +01:00 committed by Misa Elizabeth Kai
parent 1e45e263f5
commit 713fc00034

View file

@ -6005,48 +6005,48 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
break; break;
} }
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("play"); option(loc::gettext("play"));
#endif #endif
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
option("levels"); option(loc::gettext("levels"));
#endif #endif
option("options"); option(loc::gettext("options"));
if (loc::show_translator_menu) if (loc::show_translator_menu)
{ {
option(loc::gettext("translator")); option(loc::gettext("translator"));
} }
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("credits"); option(loc::gettext("credits"));
#endif #endif
option("quit"); option(loc::gettext("quit"));
menuyoff = -10; menuyoff = -10;
maxspacing = 15; maxspacing = 15;
break; break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
case Menu::playerworlds: case Menu::playerworlds:
option("play a level"); option(loc::gettext("play a level"));
#if !defined(NO_EDITOR) #if !defined(NO_EDITOR)
option("level editor"); option(loc::gettext("level editor"));
#endif #endif
option("open level folder", FILESYSTEM_openDirectoryEnabled()); option(loc::gettext("open level folder"), FILESYSTEM_openDirectoryEnabled());
option("show level folder path"); option(loc::gettext("show level folder path"));
option("back to menu"); option(loc::gettext("return"));
menuyoff = -40; menuyoff = -40;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::confirmshowlevelspath: case Menu::confirmshowlevelspath:
option("no, don't show me"); option(loc::gettext("no, don't show me"));
option("yes, reveal the path"); option(loc::gettext("yes, reveal the path"));
menuyoff = -10; menuyoff = -10;
break; break;
case Menu::showlevelspath: case Menu::showlevelspath:
option("return to levels"); option(loc::gettext("return to levels"));
menuyoff = 60; menuyoff = 60;
break; break;
case Menu::levellist: case Menu::levellist:
if(cl.ListOfMetaData.size()==0) if(cl.ListOfMetaData.size()==0)
{ {
option("ok"); option(loc::gettext("ok"));
menuyoff = -20; menuyoff = -20;
} }
else else
@ -6112,22 +6112,22 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
{ {
if((size_t) ((levelpage*8)+8) <cl.ListOfMetaData.size()) if((size_t) ((levelpage*8)+8) <cl.ListOfMetaData.size())
{ {
option("next page"); option(loc::gettext("next page"));
} }
else else
{ {
option("first page"); option(loc::gettext("first page"));
} }
if (levelpage == 0) if (levelpage == 0)
{ {
option("last page"); option(loc::gettext("last page"));
} }
else else
{ {
option("previous page"); option(loc::gettext("previous page"));
} }
} }
option("return to menu"); option(loc::gettext("return"));
menuxoff = 20; menuxoff = 20;
menuyoff = 70-(menuoptions.size()*10); menuyoff = 70-(menuoptions.size()*10);
@ -6137,24 +6137,24 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
break; break;
#endif #endif
case Menu::quickloadlevel: case Menu::quickloadlevel:
option("continue from save"); option(loc::gettext("continue from save"));
option("start from beginning"); option(loc::gettext("start from beginning"));
option("delete save"); option(loc::gettext("delete save"));
option("back to levels"); option(loc::gettext("back to levels"));
menuyoff = -30; menuyoff = -30;
break; break;
case Menu::deletequicklevel: case Menu::deletequicklevel:
option("no! don't delete"); option(loc::gettext("no! don't delete"));
option("yes, delete save"); option(loc::gettext("yes, delete save"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::youwannaquit: case Menu::youwannaquit:
option("yes, quit"); option(loc::gettext("yes, quit"));
option("no, return"); option(loc::gettext("no, return"));
menuyoff = -20; menuyoff = -20;
break; break;
case Menu::errornostart: case Menu::errornostart:
option("ok"); option(loc::gettext("ok"));
menuyoff = -20; menuyoff = -20;
break; break;
case Menu::gameplayoptions: case Menu::gameplayoptions:
@ -6162,89 +6162,89 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
if (ingame_titlemode && unlock[18]) if (ingame_titlemode && unlock[18])
#endif #endif
{ {
option("flip mode"); option(loc::gettext("flip mode"));
} }
option("toggle fps"); option(loc::gettext("toggle fps"));
option("speedrun options"); option(loc::gettext("speedrun options"));
option("advanced options"); option(loc::gettext("advanced options"));
option("clear main game data"); option(loc::gettext("clear main game data"));
option("clear custom level data"); option(loc::gettext("clear custom level data"));
option("return"); option(loc::gettext("return"));
menuyoff = -10; menuyoff = -10;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::graphicoptions: case Menu::graphicoptions:
if (!gameScreen.isForcedFullscreen()) if (!gameScreen.isForcedFullscreen())
{ {
option("toggle fullscreen"); option(loc::gettext("toggle fullscreen"));
} }
option("scaling mode"); option(loc::gettext("scaling mode"));
if (!gameScreen.isForcedFullscreen()) if (!gameScreen.isForcedFullscreen())
{ {
option("resize to nearest", gameScreen.isWindowed); option(loc::gettext("resize to nearest"), gameScreen.isWindowed);
} }
option("toggle filter"); option(loc::gettext("toggle filter"));
option("toggle analogue"); option(loc::gettext("toggle analogue"));
option("toggle vsync"); option(loc::gettext("toggle vsync"));
option("return"); option(loc::gettext("return"));
menuyoff = -10; menuyoff = -10;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::ed_settings: case Menu::ed_settings:
option("change description"); option(loc::gettext("change description"));
option("edit scripts"); option(loc::gettext("edit scripts"));
option("change music"); option(loc::gettext("change music"));
option("editor ghosts"); option(loc::gettext("editor ghosts"));
option("load level"); option(loc::gettext("load level"));
option("save level"); option(loc::gettext("save level"));
option("options"); option(loc::gettext("options"));
option("quit to main menu"); option(loc::gettext("quit to main menu"));
menuyoff = -20; menuyoff = -20;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::ed_desc: case Menu::ed_desc:
option("change name"); option(loc::gettext("change name"));
option("change author"); option(loc::gettext("change author"));
option("change description"); option(loc::gettext("change description"));
option("change website"); option(loc::gettext("change website"));
option("back to settings"); option(loc::gettext("return"));
menuyoff = 6; menuyoff = 6;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::ed_music: case Menu::ed_music:
option("next song"); option(loc::gettext("next song"));
option("previous song"); option(loc::gettext("previous song"));
option("back"); option(loc::gettext("return"));
menuyoff = 16; menuyoff = 16;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::ed_quit: case Menu::ed_quit:
option("yes, save and quit"); option(loc::gettext("yes, save and quit"));
option("no, quit without saving"); option(loc::gettext("no, quit without saving"));
option("return to editor"); option(loc::gettext("return to editor"));
menuyoff = 8; menuyoff = 8;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::options: case Menu::options:
option("gameplay"); option(loc::gettext("gameplay"));
option("graphics"); option(loc::gettext("graphics"));
option("audio"); option(loc::gettext("audio"));
option("game pad"); option(loc::gettext("game pad"));
option("accessibility"); option(loc::gettext("accessibility"));
option(loc::gettext("language")); option(loc::gettext("language"));
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::speedrunneroptions: case Menu::speedrunneroptions:
option("glitchrunner mode"); option(loc::gettext("glitchrunner mode"));
option("input delay"); option(loc::gettext("input delay"));
option("interact button"); option(loc::gettext("interact button"));
option("fake load screen"); option(loc::gettext("fake load screen"));
option("toggle in-game timer"); option(loc::gettext("toggle in-game timer"));
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
@ -6252,54 +6252,54 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
{ {
int i; int i;
option("none"); option(loc::gettext("none"));
for (i = 1; i < GlitchrunnerNumVersions; ++i) for (i = 1; i < GlitchrunnerNumVersions; ++i)
{ {
option(GlitchrunnerMode_enum_to_string((enum GlitchrunnerMode) i)); option(loc::gettext(GlitchrunnerMode_enum_to_string((enum GlitchrunnerMode) i)));
} }
break; break;
} }
case Menu::advancedoptions: case Menu::advancedoptions:
option("unfocus pause"); option(loc::gettext("unfocus pause"));
option("unfocus audio pause"); option(loc::gettext("unfocus audio pause"));
option("room name background"); option(loc::gettext("room name background"));
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::audiooptions: case Menu::audiooptions:
option("music volume"); option(loc::gettext("music volume"));
option("sound volume"); option(loc::gettext("sound volume"));
if (music.mmmmmm) if (music.mmmmmm)
{ {
option("soundtrack"); option(loc::gettext("soundtrack"));
} }
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::accessibility: case Menu::accessibility:
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("unlock play modes"); option(loc::gettext("unlock play modes"));
#endif #endif
option("invincibility", !ingame_titlemode || !incompetitive()); option(loc::gettext("invincibility"), !ingame_titlemode || !incompetitive());
option("slowdown", !ingame_titlemode || !incompetitive()); option(loc::gettext("slowdown"), !ingame_titlemode || !incompetitive());
option("animated backgrounds"); option(loc::gettext("animated backgrounds"));
option("screen effects"); option(loc::gettext("screen effects"));
option("text outline"); option(loc::gettext("text outline"));
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
case Menu::controller: case Menu::controller:
option("analog stick sensitivity"); option(loc::gettext("analog stick sensitivity"));
option("bind flip"); option(loc::gettext("bind flip"));
option("bind enter"); option(loc::gettext("bind enter"));
option("bind menu"); option(loc::gettext("bind menu"));
option("bind restart"); option(loc::gettext("bind restart"));
option("bind interact"); option(loc::gettext("bind interact"));
option("return"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 10; maxspacing = 10;
break; break;
@ -6365,72 +6365,52 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
break; break;
case Menu::cleardatamenu: case Menu::cleardatamenu:
case Menu::clearcustomdatamenu: case Menu::clearcustomdatamenu:
option("no! don't delete"); option(loc::gettext("no! don't delete"));
option("yes, delete everything"); option(loc::gettext("yes, delete everything"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::setinvincibility: case Menu::setinvincibility:
option("no, return to options"); option(loc::gettext("no, return to options"));
option("yes, enable"); option(loc::gettext("yes, enable"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::setslowdown: case Menu::setslowdown:
option("normal speed"); option(loc::gettext("normal speed"));
option("80% speed"); option(loc::gettext("80% speed"));
option("60% speed"); option(loc::gettext("60% speed"));
option("40% speed"); option(loc::gettext("40% speed"));
menuyoff = 16; menuyoff = 16;
break; break;
case Menu::unlockmenu: case Menu::unlockmenu:
option("unlock time trials"); option(loc::gettext("unlock time trials"));
option("unlock intermissions", !unlock[16]); option(loc::gettext("unlock intermissions"), !unlock[16]);
option("unlock no death mode", !unlock[17]); option(loc::gettext("unlock no death mode"), !unlock[17]);
option("unlock flip mode", !unlock[18]); option(loc::gettext("unlock flip mode"), !unlock[18]);
option("unlock ship jukebox", (stat_trinkets<20)); option(loc::gettext("unlock ship jukebox"), (stat_trinkets<20));
option("unlock secret lab", !unlock[8]); option(loc::gettext("unlock secret lab"), !unlock[8]);
option("return"); option(loc::gettext("return"));
menuyoff = -20; menuyoff = -20;
break; break;
case Menu::credits: case Menu::credits:
option("next page"); option(loc::gettext("next page"));
option("last page"); option(loc::gettext("last page"));
option("return"); option(loc::gettext("return"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::credits2: case Menu::credits2:
option("next page");
option("previous page");
option("return");
menuyoff = 64;
break;
case Menu::credits25: case Menu::credits25:
option("next page");
option("previous page");
option("return");
menuyoff = 64;
break;
case Menu::credits3: case Menu::credits3:
option("next page");
option("previous page");
option("return");
menuyoff = 64;
break;
case Menu::credits4: case Menu::credits4:
option("next page");
option("previous page");
option("return");
menuyoff = 64;
break;
case Menu::credits5: case Menu::credits5:
option("next page"); option(loc::gettext("next page"));
option("previous page"); option(loc::gettext("previous page"));
option("return"); option(loc::gettext("return"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::credits6: case Menu::credits6:
option("first page"); option(loc::gettext("first page"));
option("previous page"); option(loc::gettext("previous page"));
option("return"); option(loc::gettext("return"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::play: case Menu::play:
@ -6527,23 +6507,23 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
{ {
if (save_exists()) if (save_exists())
{ {
option("continue"); option(loc::gettext("continue"));
} }
else else
{ {
option("new game"); option(loc::gettext("new game"));
} }
//ok, secret lab! no notification, but test: //ok, secret lab! no notification, but test:
if (unlock[8]) if (unlock[8])
{ {
option("secret lab"); option(loc::gettext("secret lab"));
} }
option("play modes"); option(loc::gettext("play modes"));
if (save_exists()) if (save_exists())
{ {
option("new game"); option(loc::gettext("new game"));
} }
option("return"); option(loc::gettext("return"));
if (unlock[8]) if (unlock[8])
{ {
menuyoff = -30; menuyoff = -30;
@ -6561,56 +6541,56 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
case Menu::unlocknodeathmode: case Menu::unlocknodeathmode:
case Menu::unlockintermission: case Menu::unlockintermission:
case Menu::unlockflipmode: case Menu::unlockflipmode:
option("continue"); option(loc::gettext("proceed"));
menuyoff = 70; menuyoff = 70;
break; break;
case Menu::newgamewarning: case Menu::newgamewarning:
option("start new game"); option(loc::gettext("start new game"));
option("return to menu"); option(loc::gettext("return"));
menuyoff = 64; menuyoff = 64;
break; break;
case Menu::playmodes: case Menu::playmodes:
option("time trials", !nocompetitive()); option(loc::gettext("time trials"), !nocompetitive_unless_translator());
option("intermissions", unlock[16]); option(loc::gettext("intermissions"), unlock[16]);
option("no death mode", unlock[17] && !nocompetitive()); option(loc::gettext("no death mode"), unlock[17] && !nocompetitive());
option("flip mode", unlock[18]); option(loc::gettext("flip mode"), unlock[18]);
option("return to play menu"); option(loc::gettext("return"));
menuyoff = 8; menuyoff = 8;
maxspacing = 20; maxspacing = 20;
break; break;
case Menu::intermissionmenu: case Menu::intermissionmenu:
option("play intermission 1"); option(loc::gettext("play intermission 1"));
option("play intermission 2"); option(loc::gettext("play intermission 2"));
option("return to play menu"); option(loc::gettext("return"));
menuyoff = -35; menuyoff = -35;
break; break;
case Menu::playint1: case Menu::playint1:
option("Vitellary"); option(loc::gettext("Vitellary"));
option("Vermilion"); option(loc::gettext("Vermilion"));
option("Verdigris"); option(loc::gettext("Verdigris"));
option("Victoria"); option(loc::gettext("Victoria"));
option("return"); option(loc::gettext("return"));
menuyoff = 10; menuyoff = 10;
break; break;
case Menu::playint2: case Menu::playint2:
option("Vitellary"); option(loc::gettext("Vitellary"));
option("Vermilion"); option(loc::gettext("Vermilion"));
option("Verdigris"); option(loc::gettext("Verdigris"));
option("Victoria"); option(loc::gettext("Victoria"));
option("return"); option(loc::gettext("return"));
menuyoff = 10; menuyoff = 10;
break; break;
case Menu::continuemenu: case Menu::continuemenu:
map.settowercolour(3); map.settowercolour(3);
option("continue from teleporter"); option(loc::gettext("continue from teleporter"));
option("continue from quicksave"); option(loc::gettext("continue from quicksave"));
option("return to play menu"); option(loc::gettext("return"));
menuyoff = 20; menuyoff = 20;
break; break;
case Menu::startnodeathmode: case Menu::startnodeathmode:
option("disable cutscenes"); option(loc::gettext("disable cutscenes"));
option("enable cutscenes"); option(loc::gettext("enable cutscenes"));
option("return to play menu"); option(loc::gettext("return"));
menuyoff = 40; menuyoff = 40;
break; break;
case Menu::gameover: case Menu::gameover:
@ -6618,29 +6598,29 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
menudest=Menu::gameover2; menudest=Menu::gameover2;
break; break;
case Menu::gameover2: case Menu::gameover2:
option("return to play menu"); option(loc::gettext("return to play menu"));
menuyoff = 80; menuyoff = 80;
break; break;
case Menu::unlockmenutrials: case Menu::unlockmenutrials:
option("space station 1", !unlock[9]); option(loc::gettext("space station 1"), !unlock[9]);
option("the laboratory", !unlock[10]); option(loc::gettext("the laboratory"), !unlock[10]);
option("the tower", !unlock[11]); option(loc::gettext("the tower"), !unlock[11]);
option("space station 2", !unlock[12]); option(loc::gettext("space station 2"), !unlock[12]);
option("the warp zone", !unlock[13]); option(loc::gettext("the warp zone"), !unlock[13]);
option("the final level", !unlock[14]); option(loc::gettext("the final level"), !unlock[14]);
option("return to unlock menu"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
break; break;
case Menu::timetrials: case Menu::timetrials:
option(unlock[9] ? "space station 1" : "???", unlock[9]); option(loc::gettext(unlock[9] ? "space station 1" : "???"), unlock[9]);
option(unlock[10] ? "the laboratory" : "???", unlock[10]); option(loc::gettext(unlock[10] ? "the laboratory" : "???"), unlock[10]);
option(unlock[11] ? "the tower" : "???", unlock[11]); option(loc::gettext(unlock[11] ? "the tower" : "???"), unlock[11]);
option(unlock[12] ? "space station 2" : "???", unlock[12]); option(loc::gettext(unlock[12] ? "space station 2" : "???"), unlock[12]);
option(unlock[13] ? "the warp zone" : "???", unlock[13]); option(loc::gettext(unlock[13] ? "the warp zone" : "???"), unlock[13]);
option(unlock[14] ? "the final level" : "???", unlock[14]); option(loc::gettext(unlock[14] ? "the final level" : "???"), unlock[14]);
option("return to play menu"); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
break; break;
@ -6649,7 +6629,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
menudest = Menu::nodeathmodecomplete2; menudest = Menu::nodeathmodecomplete2;
break; break;
case Menu::nodeathmodecomplete2: case Menu::nodeathmodecomplete2:
option("return to play menu"); option(loc::gettext("return to play menu"));
menuyoff = 70; menuyoff = 70;
break; break;
case Menu::timetrialcomplete: case Menu::timetrialcomplete:
@ -6661,22 +6641,22 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
menudest=Menu::timetrialcomplete3; menudest=Menu::timetrialcomplete3;
break; break;
case Menu::timetrialcomplete3: case Menu::timetrialcomplete3:
option("return to play menu"); option(loc::gettext("return to play menu"));
option("try again"); option(loc::gettext("try again"));
menuyoff = 70; menuyoff = 70;
break; break;
case Menu::gamecompletecontinue: case Menu::gamecompletecontinue:
option("return to play menu"); option(loc::gettext("return to play menu"));
menuyoff = 70; menuyoff = 70;
break; break;
case Menu::errorsavingsettings: case Menu::errorsavingsettings:
option("ok"); option(loc::gettext("ok"));
option("silence"); option(loc::gettext("silence"));
menuyoff = 10; menuyoff = 10;
break; break;
case Menu::errorloadinglevel: case Menu::errorloadinglevel:
case Menu::warninglevellist: case Menu::warninglevellist:
option("ok"); option(loc::gettext("ok"));
menuyoff = 50; menuyoff = 50;
break; break;
} }