mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +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;
|
bool errordone = false;
|
||||||
TArray<uint32_t> activeMaps;
|
TArray<uint32_t> activeMaps;
|
||||||
FScanner sc;
|
FScanner sc;
|
||||||
|
bool hasDefaultEntry = false;
|
||||||
|
|
||||||
sc.OpenMem("LANGUAGE", buffer);
|
sc.OpenMem("LANGUAGE", buffer);
|
||||||
sc.SetCMode (true);
|
sc.SetCMode (true);
|
||||||
while (sc.GetString ())
|
while (sc.GetString ())
|
||||||
|
@ -306,6 +308,7 @@ void FStringTable::LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer)
|
||||||
{
|
{
|
||||||
activeMaps.Clear();
|
activeMaps.Clear();
|
||||||
activeMaps.Push(default_table);
|
activeMaps.Push(default_table);
|
||||||
|
hasDefaultEntry = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -369,7 +372,7 @@ void FStringTable::LoadLanguage (int lumpnum, const TArray<uint8_t> &buffer)
|
||||||
}
|
}
|
||||||
if (!skip)
|
if (!skip)
|
||||||
{
|
{
|
||||||
if (activeMaps[0] == default_table)
|
if (hasDefaultEntry)
|
||||||
{
|
{
|
||||||
DeleteForLabel(lumpnum, strName);
|
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)
|
void FStringTable::InsertString(int lumpnum, int langid, FName label, const FString &string)
|
||||||
{
|
{
|
||||||
const char *strlangid = (const char *)&langid;
|
const char *strlangid = (const char *)&langid;
|
||||||
TableElement te = { lumpnum, { string, string, string, string } };
|
TableElement te = { Wads.GetLumpFile(lumpnum), { string, string, string, string } };
|
||||||
long index;
|
long index;
|
||||||
while ((index = te.strings[0].IndexOf("@[")) >= 0)
|
while ((index = te.strings[0].IndexOf("@[")) >= 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue