Only replace Strife dialogue content if the default strings from zd_extra.pk3 are present.
If not, use the dialogue file's content directly.
This commit is contained in:
parent
3a440a5fa7
commit
6d19374ae8
3 changed files with 36 additions and 4 deletions
|
|
@ -208,6 +208,32 @@ size_t FStringTable::ProcessEscapes (char *iptr)
|
|||
return optr - sptr;
|
||||
}
|
||||
|
||||
bool FStringTable::exists(const char *name)
|
||||
{
|
||||
// Checks if the given key exists in any one of the default string tables that are valid for all languages.
|
||||
// To replace IWAD content this condition must be true.
|
||||
if (name == nullptr || *name == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
FName nm(name, true);
|
||||
if (nm != NAME_None)
|
||||
{
|
||||
uint32_t defaultStrings[] = { MAKE_ID('*', '*', '*', 0), MAKE_ID('*', 0, 0, 0), MAKE_ID('*', '*', 0, 0) };
|
||||
|
||||
for (auto mapid : defaultStrings)
|
||||
{
|
||||
auto map = allStrings.CheckKey(mapid);
|
||||
if (map)
|
||||
{
|
||||
auto item = map->CheckKey(nm);
|
||||
if (item) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Finds a string by name and returns its value
|
||||
const char *FStringTable::operator[] (const char *name) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue