From 263842169e259430b25af527d305ad551b373b7c Mon Sep 17 00:00:00 2001 From: Christopher Bruns Date: Sun, 7 Apr 2019 10:30:46 -0700 Subject: [PATCH 1/3] Fix typo: add missing dollar sign in new stereo 3D submenu. --- wadsrc/static/menudef.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 6ab81ffa55..330f52783d 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2529,7 +2529,7 @@ OptionMenu "OpenGLOptions" protected OptionMenu "VR3DMenu" protected { - Title "GLPREFMNU_VRMODE" + Title "$GLPREFMNU_VRMODE" Option "$GLMNU_3DMODE", vr_mode, "VRMode" IfOption(Windows) { From d308a1223b1c6e2bec94d8ba214b96f48fc54b13 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Apr 2019 22:04:47 +0200 Subject: [PATCH 2/3] - fixed the calculations which decide whether to use an options menu for skills and episodes. --- src/menu/menudef.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 0ae8cb99df..9932b9d1dc 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -1120,9 +1120,9 @@ void M_StartupEpisodeMenu(FGameStartup *gs) // center the menu on the screen if the top space is larger than the bottom space int totalheight = posy + AllEpisodes.Size() * ld->mLinespacing - topy; - if (totalheight < 190 || AllEpisodes.Size() == 1) + if (totalheight < CleanHeight-10 || AllEpisodes.Size() == 1) { - int newtop = (200 - totalheight + topy) / 2; + int newtop = (CleanHeight - totalheight + topy) / 2; int topdelta = newtop - topy; if (topdelta < 0) { @@ -1631,9 +1631,9 @@ void M_StartupSkillMenu(FGameStartup *gs) // center the menu on the screen if the top space is larger than the bottom space int totalheight = posy + MenuSkills.Size() * ld->mLinespacing - topy; - if (totalheight < 190 || MenuSkills.Size() == 1) + if (totalheight < CleanHeight-10 || MenuSkills.Size() == 1) { - int newtop = (200 - totalheight + topy) / 2; + int newtop = (CleanHeight - totalheight + topy) / 2; int topdelta = newtop - topy; if (topdelta < 0) { From c788da46fb63ef95331fc57e1f9f41973a72d26d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Apr 2019 22:07:09 +0200 Subject: [PATCH 3/3] - Localization helper code for level names that haven't been exported to the string table. --- src/gamedata/g_mapinfo.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 6f7d88694c..5757703d2e 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1930,20 +1930,32 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo) } else { - levelinfo->LevelName = sc.String; - - if (HexenHack) + // Workaround to allow localizazion of IWADs which do not have a string label here (e.g. HACX.WAD) + // This checks for a string labelled with the MapName and if that is identical to what got parsed here + // the string table entry will be used. + auto c = GStrings.GetLanguageString(levelinfo->MapName, FStringTable::default_table); + if (c && !strcmp(c, sc.String)) { - // Try to localize Hexen's map names. - int fileno = Wads.GetLumpFile(sc.LumpNum); - auto fn = Wads.GetWadName(fileno); - if (fn && (!stricmp(fn, "HEXEN.WAD") || !stricmp(fn, "HEXDD.WAD"))) + levelinfo->flags |= LEVEL_LOOKUPLEVELNAME; + levelinfo->LevelName = levelinfo->MapName; + } + else + { + levelinfo->LevelName = sc.String; + + if (HexenHack) { - FStringf key("TXT_%.5s_%s", fn, levelinfo->MapName.GetChars()); - if (GStrings.exists(key)) + // Try to localize Hexen's map names. This does not use the above feature to allow these names to be unique. + int fileno = Wads.GetLumpFile(sc.LumpNum); + auto fn = Wads.GetWadName(fileno); + if (fn && (!stricmp(fn, "HEXEN.WAD") || !stricmp(fn, "HEXDD.WAD"))) { - levelinfo->flags |= LEVEL_LOOKUPLEVELNAME; - levelinfo->LevelName = key; + FStringf key("TXT_%.5s_%s", fn, levelinfo->MapName.GetChars()); + if (GStrings.exists(key)) + { + levelinfo->flags |= LEVEL_LOOKUPLEVELNAME; + levelinfo->LevelName = key; + } } } }