Skip to content

Commit

Permalink
added localisation credits to main menu credits
Browse files Browse the repository at this point in the history
In addition, this adds Ally and mothbeanie to the Localisation
Implementation page credits. Also updated the game complete credits!
  • Loading branch information
TerryCavanagh authored and InfoTeddy committed Dec 6, 2023
1 parent bba57af commit 4b14d5c
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 12 deletions.
5 changes: 4 additions & 1 deletion desktop_version/src/Credits.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ static const char* translators[] = {
" 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... */
static const char* superpatrons[] = {
"Anders Ekermo",
Expand Down Expand Up @@ -174,7 +177,7 @@ static const char* githubfriends[] = {
};

/* 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)
)) + (12 * SDL_arraysize(translators));

Expand Down
3 changes: 3 additions & 0 deletions desktop_version/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ void Game::init(void)
currentmenuoption = 0;
menutestmode = false;
current_credits_list_index = 0;
translator_credits_pagenum = 0;
menuxoff = 0;
menuyoff = 0;
menucountdown = 0;
Expand Down Expand Up @@ -6703,6 +6704,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
case Menu::credits3:
case Menu::credits4:
case Menu::credits5:
case Menu::credits_localisations_implementation:
case Menu::credits_localisations_translations:
option(loc::gettext("next page"));
option(loc::gettext("previous page"));
option(loc::gettext("return"));
Expand Down
3 changes: 3 additions & 0 deletions desktop_version/src/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ namespace Menu
credits4,
credits5,
credits6,
credits_localisations_implementation,
credits_localisations_translations,
play,
unlocktimetrial,
unlocktimetrials,
Expand Down Expand Up @@ -375,6 +377,7 @@ class Game
enum Menu::MenuName kludge_ingametemp;
enum SLIDERMODE slidermode;
int current_credits_list_index;
int translator_credits_pagenum;
int menuxoff, menuyoff;
int menuspacing;
std::vector<MenuStackFrame> menustack;
Expand Down
90 changes: 88 additions & 2 deletions desktop_version/src/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ static void menuactionpress(void)
case 0:
//next page
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::credits3, true);
game.createmenu(Menu::credits_localisations_implementation, true);
map.nexttowercolour();
break;
case 1:
Expand All @@ -1584,6 +1584,87 @@ static void menuactionpress(void)
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:
switch (game.currentmenuoption)
{
Expand Down Expand Up @@ -1614,8 +1695,13 @@ static void menuactionpress(void)
if (game.current_credits_list_index < 0)
{
//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.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
{
Expand Down
63 changes: 54 additions & 9 deletions desktop_version/src/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,13 @@ static void menurender(void)
graphics.drawimagecol(IMAGE_SITE2, -1, 156, graphics.getRGB(tr, tg, tb), true);
break;
case Menu::credits2:
font::print(PR_CEN, -1, 50, loc::gettext("Roomnames are by"), tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 65, "Bennett Foddy", tr, tg, tb);
graphics.drawimagecol(IMAGE_SITE3, -1, 86, graphics.getRGB(tr, tg, tb), true);
font::print(PR_CEN, -1, 110, 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, 145, "Ethan Lee", tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 165, "Misa Kai", 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, 55, "Bennett Foddy", tr, tg, tb);
graphics.drawimagecol(IMAGE_SITE3, -1, 76, graphics.getRGB(tr, tg, tb), true);
font::print(PR_CEN, -1, 100, loc::gettext("C++ version by"), 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, 135, "Ethan Lee", tr, tg, tb);
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 155, "Misa Kai", tr, tg, tb);
break;
case Menu::credits25:
font::print(PR_CEN, -1, 40, loc::gettext("Beta Testing by"), tr, tg, tb);
Expand All @@ -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_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Pauli Kohberger", tr, tg, tb);
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:
{
font::print_wrap(PR_CEN, -1, 20, loc::gettext("VVVVVV is supported by the following patrons"), tr, tg, tb);
Expand Down Expand Up @@ -1962,8 +2000,15 @@ void gamecompleterender(void)
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Reese Rivers", tr, tg, tb);
}
creditOffset += 40;
if (graphics.onscreen(creditOffset + position)) font::print(PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb);
creditOffset += 20;
if (graphics.onscreen(creditOffset + position))
{
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 += 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)
{
if (graphics.onscreen(creditOffset + position))
Expand Down

0 comments on commit 4b14d5c

Please sign in to comment.