Translate NDM hardest room on-the-fly

Otherwise, cycling languages through CTRL+F8 would result in mismatched
languages.
This commit is contained in:
Misa 2024-01-21 18:32:18 -08:00 committed by Misa Elizabeth Kai
parent 531b151d12
commit 3d61f9067b
3 changed files with 20 additions and 2 deletions

View File

@ -221,6 +221,10 @@ void Game::init(void)
nocutscenes = false;
ndmresultcrewrescued = 0;
ndmresulttrinkets = 0;
ndmresulthardestroom.clear();
ndmresulthardestroom_x = hardestroom_x;
ndmresulthardestroom_y = hardestroom_y;
ndmresulthardestroom_specialname = false;
customcol=0;
@ -7798,7 +7802,10 @@ void Game::copyndmresults(void)
{
ndmresultcrewrescued = crewrescued();
ndmresulttrinkets = trinkets();
ndmresulthardestroom = loc::gettext_roomname(false, hardestroom_x, hardestroom_y, hardestroom.c_str(), hardestroom_specialname);
ndmresulthardestroom = hardestroom;
ndmresulthardestroom_x = hardestroom_x;
ndmresulthardestroom_y = hardestroom_y;
ndmresulthardestroom_specialname = hardestroom_specialname;
SDL_memcpy(ndmresultcrewstats, crewstats, sizeof(ndmresultcrewstats));
}

View File

@ -428,6 +428,9 @@ public:
int ndmresultcrewrescued;
int ndmresulttrinkets;
std::string ndmresulthardestroom;
int ndmresulthardestroom_x;
int ndmresulthardestroom_y;
bool ndmresulthardestroom_specialname;
void copyndmresults(void);
//Time Trials

View File

@ -1382,7 +1382,15 @@ static void menurender(void)
font::print_wrap(PR_CEN | PR_CJK_LOW, -1, 110, buffer, tr, tg, tb);
font::print(PR_CEN, -1, 145, loc::gettext("You managed to reach:"), tr, tg, tb);
font::print(PR_CEN | PR_CJK_LOW, -1, 155, game.ndmresulthardestroom, tr, tg, tb);
font::print(
PR_CEN | PR_CJK_LOW, -1, 155,
loc::gettext_roomname(
false,
game.ndmresulthardestroom_x, game.ndmresulthardestroom_y,
game.ndmresulthardestroom.c_str(), game.ndmresulthardestroom_specialname
),
tr, tg, tb
);
const char* encouragement;
switch (game.ndmresultcrewrescued)