mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- Localization helper code for level names that haven't been exported to the string table.
This commit is contained in:
parent
d308a1223b
commit
c788da46fb
1 changed files with 23 additions and 11 deletions
|
@ -1929,12 +1929,23 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo)
|
|||
levelinfo->LevelName = sc.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
levelinfo->flags |= LEVEL_LOOKUPLEVELNAME;
|
||||
levelinfo->LevelName = levelinfo->MapName;
|
||||
}
|
||||
else
|
||||
{
|
||||
levelinfo->LevelName = sc.String;
|
||||
|
||||
if (HexenHack)
|
||||
{
|
||||
// Try to localize Hexen's map names.
|
||||
// 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")))
|
||||
|
@ -1949,6 +1960,7 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set up levelnum now so that you can use Teleport_NewMap specials
|
||||
// to teleport to maps with standard names without needing a levelnum.
|
||||
|
|
Loading…
Reference in a new issue