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

Add localisation credits to main menu credits

In addition, this adds Ally and mothbeanie to the Localisation
Implementation page credits. Also updated the game complete credits!
This commit is contained in:
TerryCavanagh 2023-12-06 00:34:05 +01:00 committed by Misa
parent e754654926
commit 9a40993b5f
5 changed files with 152 additions and 12 deletions

View file

@ -58,6 +58,9 @@ static const char* translators[] = {
" Sound of Mystery / craft", " Sound of Mystery / craft",
}; };
/* Hardcoded pagesizes for the translator credits. Simplifies paging backwards and forwards */
static const int translator_pagesize[] = { 8, 9, 8, 10, 10, 4 };
/* Terry's Patrons... */ /* Terry's Patrons... */
static const char* superpatrons[] = { static const char* superpatrons[] = {
"Anders Ekermo", "Anders Ekermo",
@ -174,7 +177,7 @@ static const char* githubfriends[] = {
}; };
/* Calculate credits length, finally. */ /* Calculate credits length, finally. */
static const int creditmaxposition = 1228 + (10 * ( static const int creditmaxposition = 1348 + (10 * (
SDL_arraysize(superpatrons) + SDL_arraysize(patrons) + SDL_arraysize(githubfriends) SDL_arraysize(superpatrons) + SDL_arraysize(patrons) + SDL_arraysize(githubfriends)
)) + (12 * SDL_arraysize(translators)); )) + (12 * SDL_arraysize(translators));

View file

@ -242,6 +242,7 @@ void Game::init(void)
currentmenuoption = 0; currentmenuoption = 0;
menutestmode = false; menutestmode = false;
current_credits_list_index = 0; current_credits_list_index = 0;
translator_credits_pagenum = 0;
menuxoff = 0; menuxoff = 0;
menuyoff = 0; menuyoff = 0;
menucountdown = 0; menucountdown = 0;
@ -6703,6 +6704,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
case Menu::credits3: case Menu::credits3:
case Menu::credits4: case Menu::credits4:
case Menu::credits5: case Menu::credits5:
case Menu::credits_localisations_implementation:
case Menu::credits_localisations_translations:
option(loc::gettext("next page")); option(loc::gettext("next page"));
option(loc::gettext("previous page")); option(loc::gettext("previous page"));
option(loc::gettext("return")); option(loc::gettext("return"));

View file

@ -85,6 +85,8 @@ namespace Menu
credits4, credits4,
credits5, credits5,
credits6, credits6,
credits_localisations_implementation,
credits_localisations_translations,
play, play,
unlocktimetrial, unlocktimetrial,
unlocktimetrials, unlocktimetrials,
@ -375,6 +377,7 @@ public:
enum Menu::MenuName kludge_ingametemp; enum Menu::MenuName kludge_ingametemp;
enum SLIDERMODE slidermode; enum SLIDERMODE slidermode;
int current_credits_list_index; int current_credits_list_index;
int translator_credits_pagenum;
int menuxoff, menuyoff; int menuxoff, menuyoff;
int menuspacing; int menuspacing;
std::vector<MenuStackFrame> menustack; std::vector<MenuStackFrame> menustack;

View file

@ -1567,7 +1567,7 @@ static void menuactionpress(void)
case 0: case 0:
//next page //next page
music.playef(Sound_VIRIDIAN); music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::credits3, true); game.createmenu(Menu::credits_localisations_implementation, true);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
@ -1584,6 +1584,87 @@ static void menuactionpress(void)
break; break;
} }
break; break;
case Menu::credits_localisations_implementation:
switch (game.currentmenuoption)
{
case 0:
//next page
music.playef(Sound_VIRIDIAN);
game.translator_credits_pagenum = 0;
game.createmenu(Menu::credits_localisations_translations, true);
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::credits25, true);
map.nexttowercolour();
break;
default:
//back
music.playef(Sound_VIRIDIAN);
game.returnmenu();
map.nexttowercolour();
break;
}
break;
case Menu::credits_localisations_translations:
switch (game.currentmenuoption)
{
case 0:
//next page
music.playef(Sound_VIRIDIAN);
game.translator_credits_pagenum++;
if (game.translator_credits_pagenum >= (int)SDL_arraysize(Credits::translator_pagesize))
{
// No more translators. Move to the next credits section
game.current_credits_list_index = 0;
game.createmenu(Menu::credits3, true);
}
else
{
// There are more translators. Refresh the menu with the next ones
game.current_credits_list_index = 0;
for (int i = 0; i < game.translator_credits_pagenum; i += 1)
{
game.current_credits_list_index += Credits::translator_pagesize[i];
}
game.createmenu(Menu::credits_localisations_translations, true);
}
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(Sound_VIRIDIAN);
game.translator_credits_pagenum--;
if (game.translator_credits_pagenum >= 0)
{
game.current_credits_list_index = 0;
for (int i = 0; i < game.translator_credits_pagenum; i += 1)
{
game.current_credits_list_index += Credits::translator_pagesize[i];
}
game.createmenu(Menu::credits_localisations_translations, true);
}else {
//No more translators. Move to the previous credits section
game.current_credits_list_index = 0;
game.createmenu(Menu::credits_localisations_implementation, true);
}
map.nexttowercolour();
break;
default:
//back
music.playef(Sound_VIRIDIAN);
game.current_credits_list_index = 0;
game.returnmenu();
map.nexttowercolour();
break;
}
break;
case Menu::credits3: case Menu::credits3:
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1614,8 +1695,13 @@ static void menuactionpress(void)
if (game.current_credits_list_index < 0) if (game.current_credits_list_index < 0)
{ {
//No more super patrons. Move to the previous credits section //No more super patrons. Move to the previous credits section
game.translator_credits_pagenum = (int)SDL_arraysize(Credits::translator_pagesize) - 1;
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu(Menu::credits25, true); for (int i = 0; i < game.translator_credits_pagenum; i += 1)
{
game.current_credits_list_index += Credits::translator_pagesize[i];
}
game.createmenu(Menu::credits_localisations_translations, true);
} }
else else
{ {

View file

@ -533,13 +533,13 @@ static void menurender(void)
graphics.drawimagecol(IMAGE_SITE2, -1, 156, graphics.getRGB(tr, tg, tb), true); graphics.drawimagecol(IMAGE_SITE2, -1, 156, graphics.getRGB(tr, tg, tb), true);
break; break;
case Menu::credits2: case Menu::credits2:
font::print(PR_CEN, -1, 50, loc::gettext("Roomnames are by"), tr, tg, tb); font::print(PR_CEN, -1, 40, loc::gettext("Roomnames are by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 65, "Bennett Foddy", tr, tg, tb); font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 55, "Bennett Foddy", tr, tg, tb);
graphics.drawimagecol(IMAGE_SITE3, -1, 86, graphics.getRGB(tr, tg, tb), true); graphics.drawimagecol(IMAGE_SITE3, -1, 76, graphics.getRGB(tr, tg, tb), true);
font::print(PR_CEN, -1, 110, loc::gettext("C++ version by"), tr, tg, tb); font::print(PR_CEN, -1, 100, loc::gettext("C++ version by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 125, "Simon Roth", tr, tg, tb); font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 115, "Simon Roth", tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Ethan Lee", tr, tg, tb); font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 135, "Ethan Lee", tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 165, "Misa Kai", tr, tg, tb); font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 155, "Misa Kai", tr, tg, tb);
break; break;
case Menu::credits25: case Menu::credits25:
font::print(PR_CEN, -1, 40, loc::gettext("Beta Testing by"), tr, tg, tb); font::print(PR_CEN, -1, 40, loc::gettext("Beta Testing by"), tr, tg, tb);
@ -548,6 +548,44 @@ static void menurender(void)
font::print(PR_CEN, -1, 130, loc::gettext("Ending Picture by"), tr, tg, tb); font::print(PR_CEN, -1, 130, loc::gettext("Ending Picture by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Pauli Kohberger", tr, tg, tb); font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Pauli Kohberger", tr, tg, tb);
break; break;
case Menu::credits_localisations_implementation:
font::print(PR_CEN, -1, 30, loc::gettext("Localisation Project Led by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 45, "Dav999", tr, tg, tb);
font::print(PR_CEN, -1, 75, loc::gettext("Pan-European Font Design by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 90, "Reese Rivers", tr, tg, tb);
font::print_wrap(PR_CEN, -1, 125, loc::gettext("With contributions on GitHub from"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 140, "Alexandra Fox", tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 160, "mothbeanie", tr, tg, tb);
break;
case Menu::credits_localisations_translations:
{
font::print_wrap(PR_2X | PR_CEN | PR_FONT_8X8, -1, 15, loc::gettext("Translators"), tr, tg, tb);
int startidx = game.current_credits_list_index;
int endidx = game.current_credits_list_index;
endidx += Credits::translator_pagesize[game.translator_credits_pagenum];
endidx = SDL_min(endidx, (int)SDL_arraysize(Credits::translators));
int maxheight = 110;
int totalheight = (endidx - startidx) * 10;
int emptyspace = maxheight - totalheight;
int yofs = 50 + (emptyspace / 2);
for (int i = startidx; i < endidx; ++i)
{
if (Credits::translators[i][0] != ' ')
{
yofs += 5;
font::print(PR_FONT_8X8, 80, yofs, loc::gettext(Credits::translators[i]), tr, tg, tb);
}else{
font::print(PR_FONT_8X8, 80, yofs, Credits::translators[i], tr, tg, tb);
}
yofs += 10;
}
break;
}
case Menu::credits3: case Menu::credits3:
{ {
font::print_wrap(PR_CEN, -1, 20, loc::gettext("VVVVVV is supported by the following patrons"), tr, tg, tb); font::print_wrap(PR_CEN, -1, 20, loc::gettext("VVVVVV is supported by the following patrons"), tr, tg, tb);
@ -1967,9 +2005,16 @@ void gamecompleterender(void)
creditOffset += 40; creditOffset += 40;
if (graphics.onscreen(creditOffset + position)) if (graphics.onscreen(creditOffset + position))
{ {
font::print(PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb); font::print(PR_CJK_HIGH, 40, creditOffset + position, loc::gettext("With contributions on GitHub from"), tr, tg, tb);
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Alexandra Fox", tr, tg, tb);
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 30, "mothbeanie", tr, tg, tb);
} }
creditOffset += 20; creditOffset += 100;
if (graphics.onscreen(creditOffset + position))
{
font::print(PR_2X | PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb);
}
creditOffset += 40;
for (size_t i = 0; i < SDL_arraysize(Credits::translators); i += 1) for (size_t i = 0; i < SDL_arraysize(Credits::translators); i += 1)
{ {
if (graphics.onscreen(creditOffset + position)) if (graphics.onscreen(creditOffset + position))