mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-17 17:11:19 +00:00
- added the final missing piece of localization support, i.e. forcing text based menus.
Now a localization mod can disable the graphics patches containing text entirely so that it can properly localize the text based menu variant. If this flag gets set in MAPINFO, it will override all user settings.
This commit is contained in:
parent
add10029b9
commit
2874a36fbe
5 changed files with 24 additions and 14 deletions
|
@ -396,6 +396,7 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_BOOL(swapmenu, "swapmenu")
|
||||
GAMEINFOKEY_BOOL(dontcrunchcorpses, "dontcrunchcorpses")
|
||||
GAMEINFOKEY_BOOL(correctprintbold, "correctprintbold")
|
||||
GAMEINFOKEY_BOOL(forcetextinmenus, "forcetextinmenus")
|
||||
GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter")
|
||||
GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast")
|
||||
GAMEINFOKEY_COLOR(dimcolor, "dimcolor")
|
||||
|
|
|
@ -119,6 +119,7 @@ struct gameinfo_t
|
|||
bool swapmenu;
|
||||
bool dontcrunchcorpses;
|
||||
bool correctprintbold;
|
||||
bool forcetextinmenus;
|
||||
TArray<FName> creditPages;
|
||||
TArray<FName> finalePages;
|
||||
TArray<FName> infoPages;
|
||||
|
|
|
@ -421,8 +421,8 @@ bool FTextureManager::OkForLocalization(FTextureID texnum, const char *substitut
|
|||
if (!texnum.isValid()) return false;
|
||||
|
||||
// First the unconditional settings, 0='never' and 1='always'.
|
||||
if (cl_localizationmode == 1 || gameinfo.forcetextinmenus) return false;
|
||||
if (cl_localizationmode == 0) return true;
|
||||
if (cl_localizationmode == 1) return false;
|
||||
|
||||
uint32_t langtable = 0;
|
||||
if (*substitute == '$') substitute = GStrings.GetString(substitute+1, &langtable);
|
||||
|
|
|
@ -414,10 +414,16 @@ void M_SetMenu(FName menu, int param)
|
|||
switch (menu)
|
||||
{
|
||||
case NAME_Mainmenu:
|
||||
if (gameinfo.gametype & GAME_DoomStrifeChex)
|
||||
if (gameinfo.gametype & GAME_DoomStrifeChex) // Raven's games always used text based menus
|
||||
{
|
||||
if (gameinfo.forcetextinmenus) // If text is forced, this overrides any check.
|
||||
{
|
||||
menu = NAME_MainmenuTextOnly;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For these games we must check up-front if they get localized because in that case another template must be used.
|
||||
DMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_Playerclassmenu);
|
||||
DMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_Mainmenu);
|
||||
if (desc != nullptr)
|
||||
{
|
||||
if ((*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor)))
|
||||
|
@ -436,6 +442,7 @@ void M_SetMenu(FName menu, int param)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NAME_Episodemenu:
|
||||
// sent from the player class menu
|
||||
|
|
|
@ -128,7 +128,8 @@ LISTMENU "MainMenuTextOnly"
|
|||
|
||||
TextItem "$MNU_NEWGAME", "n", "PlayerclassMenu"
|
||||
TextItem "$MNU_OPTIONS", "o", "OptionsMenu"
|
||||
TextItem "$MNU_GAMEFILES", "g", "GameFilesMenu"
|
||||
TextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
|
||||
TextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
|
||||
IfOption(ReadThis)
|
||||
{
|
||||
TextItem "$MNU_INFO", "i", "ReadThisMenu"
|
||||
|
|
Loading…
Reference in a new issue