Skip to content

Commit 4b14d5c

Browse files
TerryCavanaghInfoTeddy
authored andcommitted
added 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!
1 parent bba57af commit 4b14d5c

File tree

5 files changed

+152
-12
lines changed

5 files changed

+152
-12
lines changed

desktop_version/src/Credits.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ static const char* translators[] = {
5858
" Sound of Mystery / craft",
5959
};
6060

61+
/* Hardcoded pagesizes for the translator credits. Simplifies paging backwards and forwards */
62+
static const int translator_pagesize[] = { 8, 9, 8, 10, 10, 4 };
63+
6164
/* Terry's Patrons... */
6265
static const char* superpatrons[] = {
6366
"Anders Ekermo",
@@ -174,7 +177,7 @@ static const char* githubfriends[] = {
174177
};
175178

176179
/* Calculate credits length, finally. */
177-
static const int creditmaxposition = 1228 + (10 * (
180+
static const int creditmaxposition = 1348 + (10 * (
178181
SDL_arraysize(superpatrons) + SDL_arraysize(patrons) + SDL_arraysize(githubfriends)
179182
)) + (12 * SDL_arraysize(translators));
180183

desktop_version/src/Game.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ void Game::init(void)
242242
currentmenuoption = 0;
243243
menutestmode = false;
244244
current_credits_list_index = 0;
245+
translator_credits_pagenum = 0;
245246
menuxoff = 0;
246247
menuyoff = 0;
247248
menucountdown = 0;
@@ -6703,6 +6704,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
67036704
case Menu::credits3:
67046705
case Menu::credits4:
67056706
case Menu::credits5:
6707+
case Menu::credits_localisations_implementation:
6708+
case Menu::credits_localisations_translations:
67066709
option(loc::gettext("next page"));
67076710
option(loc::gettext("previous page"));
67086711
option(loc::gettext("return"));

desktop_version/src/Game.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ namespace Menu
8585
credits4,
8686
credits5,
8787
credits6,
88+
credits_localisations_implementation,
89+
credits_localisations_translations,
8890
play,
8991
unlocktimetrial,
9092
unlocktimetrials,
@@ -375,6 +377,7 @@ class Game
375377
enum Menu::MenuName kludge_ingametemp;
376378
enum SLIDERMODE slidermode;
377379
int current_credits_list_index;
380+
int translator_credits_pagenum;
378381
int menuxoff, menuyoff;
379382
int menuspacing;
380383
std::vector<MenuStackFrame> menustack;

desktop_version/src/Input.cpp

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ static void menuactionpress(void)
15671567
case 0:
15681568
//next page
15691569
music.playef(Sound_VIRIDIAN);
1570-
game.createmenu(Menu::credits3, true);
1570+
game.createmenu(Menu::credits_localisations_implementation, true);
15711571
map.nexttowercolour();
15721572
break;
15731573
case 1:
@@ -1584,6 +1584,87 @@ static void menuactionpress(void)
15841584
break;
15851585
}
15861586
break;
1587+
case Menu::credits_localisations_implementation:
1588+
switch (game.currentmenuoption)
1589+
{
1590+
case 0:
1591+
//next page
1592+
music.playef(Sound_VIRIDIAN);
1593+
game.translator_credits_pagenum = 0;
1594+
game.createmenu(Menu::credits_localisations_translations, true);
1595+
map.nexttowercolour();
1596+
break;
1597+
case 1:
1598+
//previous page
1599+
music.playef(Sound_VIRIDIAN);
1600+
game.createmenu(Menu::credits25, true);
1601+
map.nexttowercolour();
1602+
break;
1603+
default:
1604+
//back
1605+
music.playef(Sound_VIRIDIAN);
1606+
game.returnmenu();
1607+
map.nexttowercolour();
1608+
break;
1609+
}
1610+
break;
1611+
case Menu::credits_localisations_translations:
1612+
switch (game.currentmenuoption)
1613+
{
1614+
case 0:
1615+
//next page
1616+
music.playef(Sound_VIRIDIAN);
1617+
game.translator_credits_pagenum++;
1618+
1619+
if (game.translator_credits_pagenum >= (int)SDL_arraysize(Credits::translator_pagesize))
1620+
{
1621+
// No more translators. Move to the next credits section
1622+
game.current_credits_list_index = 0;
1623+
game.createmenu(Menu::credits3, true);
1624+
}
1625+
else
1626+
{
1627+
// There are more translators. Refresh the menu with the next ones
1628+
game.current_credits_list_index = 0;
1629+
for (int i = 0; i < game.translator_credits_pagenum; i += 1)
1630+
{
1631+
game.current_credits_list_index += Credits::translator_pagesize[i];
1632+
}
1633+
1634+
game.createmenu(Menu::credits_localisations_translations, true);
1635+
}
1636+
1637+
map.nexttowercolour();
1638+
break;
1639+
case 1:
1640+
//previous page
1641+
music.playef(Sound_VIRIDIAN);
1642+
game.translator_credits_pagenum--;
1643+
if (game.translator_credits_pagenum >= 0)
1644+
{
1645+
game.current_credits_list_index = 0;
1646+
for (int i = 0; i < game.translator_credits_pagenum; i += 1)
1647+
{
1648+
game.current_credits_list_index += Credits::translator_pagesize[i];
1649+
}
1650+
game.createmenu(Menu::credits_localisations_translations, true);
1651+
}else {
1652+
//No more translators. Move to the previous credits section
1653+
game.current_credits_list_index = 0;
1654+
game.createmenu(Menu::credits_localisations_implementation, true);
1655+
}
1656+
1657+
map.nexttowercolour();
1658+
break;
1659+
default:
1660+
//back
1661+
music.playef(Sound_VIRIDIAN);
1662+
game.current_credits_list_index = 0;
1663+
game.returnmenu();
1664+
map.nexttowercolour();
1665+
break;
1666+
}
1667+
break;
15871668
case Menu::credits3:
15881669
switch (game.currentmenuoption)
15891670
{
@@ -1614,8 +1695,13 @@ static void menuactionpress(void)
16141695
if (game.current_credits_list_index < 0)
16151696
{
16161697
//No more super patrons. Move to the previous credits section
1698+
game.translator_credits_pagenum = (int)SDL_arraysize(Credits::translator_pagesize) - 1;
16171699
game.current_credits_list_index = 0;
1618-
game.createmenu(Menu::credits25, true);
1700+
for (int i = 0; i < game.translator_credits_pagenum; i += 1)
1701+
{
1702+
game.current_credits_list_index += Credits::translator_pagesize[i];
1703+
}
1704+
game.createmenu(Menu::credits_localisations_translations, true);
16191705
}
16201706
else
16211707
{

desktop_version/src/Render.cpp

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,13 @@ static void menurender(void)
533533
graphics.drawimagecol(IMAGE_SITE2, -1, 156, graphics.getRGB(tr, tg, tb), true);
534534
break;
535535
case Menu::credits2:
536-
font::print(PR_CEN, -1, 50, loc::gettext("Roomnames are by"), tr, tg, tb);
537-
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 65, "Bennett Foddy", tr, tg, tb);
538-
graphics.drawimagecol(IMAGE_SITE3, -1, 86, graphics.getRGB(tr, tg, tb), true);
539-
font::print(PR_CEN, -1, 110, loc::gettext("C++ version by"), tr, tg, tb);
540-
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 125, "Simon Roth", tr, tg, tb);
541-
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Ethan Lee", tr, tg, tb);
542-
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 165, "Misa Kai", tr, tg, tb);
536+
font::print(PR_CEN, -1, 40, loc::gettext("Roomnames are by"), tr, tg, tb);
537+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 55, "Bennett Foddy", tr, tg, tb);
538+
graphics.drawimagecol(IMAGE_SITE3, -1, 76, graphics.getRGB(tr, tg, tb), true);
539+
font::print(PR_CEN, -1, 100, loc::gettext("C++ version by"), tr, tg, tb);
540+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 115, "Simon Roth", tr, tg, tb);
541+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 135, "Ethan Lee", tr, tg, tb);
542+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 155, "Misa Kai", tr, tg, tb);
543543
break;
544544
case Menu::credits25:
545545
font::print(PR_CEN, -1, 40, loc::gettext("Beta Testing by"), tr, tg, tb);
@@ -548,6 +548,44 @@ static void menurender(void)
548548
font::print(PR_CEN, -1, 130, loc::gettext("Ending Picture by"), tr, tg, tb);
549549
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 145, "Pauli Kohberger", tr, tg, tb);
550550
break;
551+
case Menu::credits_localisations_implementation:
552+
font::print(PR_CEN, -1, 30, loc::gettext("Localisation Project Led by"), tr, tg, tb);
553+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 45, "Dav999", tr, tg, tb);
554+
font::print(PR_CEN, -1, 75, loc::gettext("Pan-European Font Design by"), tr, tg, tb);
555+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 90, "Reese Rivers", tr, tg, tb);
556+
font::print_wrap(PR_CEN, -1, 125, loc::gettext("With contributions on GitHub from"), tr, tg, tb);
557+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 140, "Alexandra Fox", tr, tg, tb);
558+
font::print(PR_2X | PR_CEN | PR_FONT_8X8, -1, 160, "mothbeanie", tr, tg, tb);
559+
break;
560+
case Menu::credits_localisations_translations:
561+
{
562+
font::print_wrap(PR_2X | PR_CEN | PR_FONT_8X8, -1, 15, loc::gettext("Translators"), tr, tg, tb);
563+
564+
int startidx = game.current_credits_list_index;
565+
int endidx = game.current_credits_list_index;
566+
endidx += Credits::translator_pagesize[game.translator_credits_pagenum];
567+
endidx = SDL_min(endidx, (int)SDL_arraysize(Credits::translators));
568+
569+
int maxheight = 110;
570+
571+
int totalheight = (endidx - startidx) * 10;
572+
int emptyspace = maxheight - totalheight;
573+
574+
int yofs = 50 + (emptyspace / 2);
575+
576+
for (int i = startidx; i < endidx; ++i)
577+
{
578+
if (Credits::translators[i][0] != ' ')
579+
{
580+
yofs += 5;
581+
font::print(PR_FONT_8X8, 80, yofs, loc::gettext(Credits::translators[i]), tr, tg, tb);
582+
}else{
583+
font::print(PR_FONT_8X8, 80, yofs, Credits::translators[i], tr, tg, tb);
584+
}
585+
yofs += 10;
586+
}
587+
break;
588+
}
551589
case Menu::credits3:
552590
{
553591
font::print_wrap(PR_CEN, -1, 20, loc::gettext("VVVVVV is supported by the following patrons"), tr, tg, tb);
@@ -1962,8 +2000,15 @@ void gamecompleterender(void)
19622000
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Reese Rivers", tr, tg, tb);
19632001
}
19642002
creditOffset += 40;
1965-
if (graphics.onscreen(creditOffset + position)) font::print(PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb);
1966-
creditOffset += 20;
2003+
if (graphics.onscreen(creditOffset + position))
2004+
{
2005+
font::print(PR_CJK_HIGH, 40, creditOffset + position, loc::gettext("With contributions on GitHub from"), tr, tg, tb);
2006+
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 10, "Alexandra Fox", tr, tg, tb);
2007+
font::print(PR_2X | PR_FONT_8X8, 60, creditOffset + position + 30, "mothbeanie", tr, tg, tb);
2008+
}
2009+
creditOffset += 100;
2010+
if (graphics.onscreen(creditOffset + position)) font::print(PR_2X | PR_CJK_HIGH | PR_CEN, -1, creditOffset + position, loc::gettext("Translators"), tr, tg, tb);
2011+
creditOffset += 40;
19672012
for (size_t i = 0; i < SDL_arraysize(Credits::translators); i += 1)
19682013
{
19692014
if (graphics.onscreen(creditOffset + position))

0 commit comments

Comments
 (0)