- fixed Redneck Rampage ingame menu and added selection validation to the load menu.

This commit is contained in:
Christoph Oelckers 2019-11-30 23:59:22 +01:00
parent 06d5705ae6
commit 0fc439a969
3 changed files with 4 additions and 2 deletions

View file

@ -165,6 +165,7 @@ protected:
if (savegameManager.SavegameCount() > 0) if (savegameManager.SavegameCount() > 0)
{ {
if (Selected > savegameManager.SavegameCount()) Selected = 0;
FString text = (Selected == -1 || !savegameManager.GetSavegame(Selected)->bOldVersion) ? GStrings("MNU_NOPICTURE") : GStrings("MNU_DIFFVERSION"); FString text = (Selected == -1 || !savegameManager.GetSavegame(Selected)->bOldVersion) ? GStrings("MNU_NOPICTURE") : GStrings("MNU_DIFFVERSION");
int textlen = NewSmallFont->StringWidth(text) * CleanXfac; int textlen = NewSmallFont->StringWidth(text) * CleanXfac;

View file

@ -151,6 +151,7 @@ static void Menu_DrawTopBar(const DVector2 &origin)
static void Menu_DrawTopBarCaption(const char* caption, const DVector2& origin) static void Menu_DrawTopBarCaption(const char* caption, const DVector2& origin)
{ {
static char t[64]; static char t[64];
if (*caption == '$') caption = GStrings(caption + 1);
size_t const srclen = strlen(caption); size_t const srclen = strlen(caption);
size_t const dstlen = min(srclen, ARRAY_SIZE(t) - 1); size_t const dstlen = min(srclen, ARRAY_SIZE(t) - 1);
memcpy(t, caption, dstlen); memcpy(t, caption, dstlen);

View file

@ -74,7 +74,7 @@ LISTMENU "MainMenu"
LISTMENU "IngameMenu" LISTMENU "IngameMenu"
{ {
ScriptId 50 ScriptId 50
ifgame(Duke, Nam, WW2GI, Fury) ifgame(Duke, Nam, WW2GI, Fury, Redneck, RedneckRides)
{ {
ifgame(fury) ifgame(fury)
{ {
@ -121,7 +121,7 @@ LISTMENU "IngameMenu"
NativeTextItem "$MNU_LOADGAME", "l", "LoadGameMenu" NativeTextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
NativeTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu" NativeTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
NativeTextItem "$MNU_OPTIONS", "o", "OptionsMenu" NativeTextItem "$MNU_OPTIONS", "o", "OptionsMenu"
NativeTextItem "$MNU_COOLSTUFF", "h", "HelpMenu" NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu" NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
} }
} }