mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed string prioritization when a mod replaces the default language for a given string.
In this case it must override all localized content from previously loaded WADs because that is no longer matching the original text.
This commit is contained in:
parent
5b6bae409e
commit
68c33a6e43
1 changed files with 5 additions and 2 deletions
|
@ -277,6 +277,8 @@ void FStringTable::LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer)
|
|||
bool errordone = false;
|
||||
TArray<uint32_t> activeMaps;
|
||||
FScanner sc;
|
||||
bool hasDefaultEntry = false;
|
||||
|
||||
sc.OpenMem("LANGUAGE", buffer);
|
||||
sc.SetCMode (true);
|
||||
while (sc.GetString ())
|
||||
|
@ -306,6 +308,7 @@ void FStringTable::LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer)
|
|||
{
|
||||
activeMaps.Clear();
|
||||
activeMaps.Push(default_table);
|
||||
hasDefaultEntry = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -369,7 +372,7 @@ void FStringTable::LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer)
|
|||
}
|
||||
if (!skip)
|
||||
{
|
||||
if (activeMaps[0] == default_table)
|
||||
if (hasDefaultEntry)
|
||||
{
|
||||
DeleteForLabel(lumpnum, strName);
|
||||
}
|
||||
|
@ -427,7 +430,7 @@ void FStringTable::DeleteForLabel(int lumpnum, FName label)
|
|||
void FStringTable::InsertString(int lumpnum, int langid, FName label, const FString &string)
|
||||
{
|
||||
const char *strlangid = (const char *)&langid;
|
||||
TableElement te = { lumpnum, { string, string, string, string } };
|
||||
TableElement te = { Wads.GetLumpFile(lumpnum), { string, string, string, string } };
|
||||
long index;
|
||||
while ((index = te.strings[0].IndexOf("@[")) >= 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue