- exported Strife's log texts to the string table.

This is dpne as a two-stage approach. TXT_LOGTEXTxxx will always take precedence over the log lumps, and TXT_ILOGxxx will only replace the original IWAD content.
This is so that PWADs replacing these lumps don't get overridden by the default texts.
This commit is contained in:
Christoph Oelckers 2019-02-09 12:52:50 +01:00
commit b1820039d7
3 changed files with 134 additions and 11 deletions

View file

@ -371,18 +371,37 @@ size_t player_t::PropagateMark()
void player_t::SetLogNumber (int num)
{
char lumpname[16];
char lumpname[26];
int lumpnum;
// First look up TXT_LOGTEXT%d in the string table
mysnprintf(lumpname, countof(lumpname), "$TXT_LOGTEXT%d", num);
auto text = GStrings[lumpname+1];
if (text)
{
SetLogText(lumpname); // set the label, not the content, so that a language change can be picked up.
return;
}
mysnprintf (lumpname, countof(lumpname), "LOG%d", num);
lumpnum = Wads.CheckNumForName (lumpname);
if (lumpnum == -1)
{
// Leave the log message alone if this one doesn't exist.
//SetLogText (lumpname);
}
else
if (lumpnum != -1)
{
auto fn = Wads.GetLumpFile(lumpnum);
auto wadname = Wads.GetWadName(fn);
if (!stricmp(wadname, "STRIFE0.WAD") || !stricmp(wadname, "STRIFE1.WAD") || !stricmp(wadname, "SVE.WAD"))
{
// If this is an original IWAD text, try looking up its lower priority string version first.
mysnprintf(lumpname, countof(lumpname), "$TXT_ILOG%d", num);
auto text = GStrings[lumpname + 1];
if (text)
{
SetLogText(lumpname); // set the label, not the content, so that a language change can be picked up.
return;
}
}
auto lump = Wads.ReadLump(lumpnum);
SetLogText (lump.GetString());
}