- allow the language table to supersede the title patches, if appropriate
For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font. This also required removing the 'en' label from the default table, because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen. Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
This commit is contained in:
parent
44c8c2a79c
commit
aa550310f6
20 changed files with 114 additions and 58 deletions
|
|
@ -81,6 +81,7 @@
|
|||
#include "a_dynlight.h"
|
||||
#include "p_conversation.h"
|
||||
#include "p_effect.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
#include "gi.h"
|
||||
|
||||
|
|
@ -779,6 +780,8 @@ void G_DoCompleted (void)
|
|||
// Close the conversation menu if open.
|
||||
P_FreeStrifeConversations ();
|
||||
|
||||
wbstartstruct_t wminfo; // parms for world map / intermission
|
||||
|
||||
if (primaryLevel->DoCompleted(nextlevel, wminfo))
|
||||
{
|
||||
gamestate = GS_INTERMISSION;
|
||||
|
|
@ -802,12 +805,14 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo)
|
|||
if (!(flags & LEVEL_CHANGEMAPCHEAT))
|
||||
FindLevelInfo (MapName)->flags |= LEVEL_VISITED;
|
||||
|
||||
uint32_t langtable[2] = {};
|
||||
wminfo.finished_ep = cluster - 1;
|
||||
wminfo.LName0 = TexMan.CheckForTexture(info->PName, ETextureType::MiscPatch);
|
||||
wminfo.thisname = info->LookupLevelName(&langtable[0]); // re-get the name so we have more info about its origin.
|
||||
wminfo.current = MapName;
|
||||
|
||||
if (deathmatch &&
|
||||
(dmflags & DF_SAME_LEVEL) &&
|
||||
(*dmflags & DF_SAME_LEVEL) &&
|
||||
!(flags & LEVEL_CHANGEMAPCHEAT))
|
||||
{
|
||||
wminfo.next = MapName;
|
||||
|
|
@ -818,13 +823,37 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo)
|
|||
level_info_t *nextinfo = FindLevelInfo (nextlevel, false);
|
||||
if (nextinfo == NULL || strncmp (nextlevel, "enDSeQ", 6) == 0)
|
||||
{
|
||||
wminfo.next = nextlevel;
|
||||
wminfo.next = "";
|
||||
wminfo.LName1.SetInvalid();
|
||||
wminfo.nextname = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
wminfo.next = nextinfo->MapName;
|
||||
wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, ETextureType::MiscPatch);
|
||||
wminfo.nextname = info->LookupLevelName(&langtable[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore the (C)WILVxx lumps from the original Doom IWADs so that the name can be localized properly, if the retrieved text does not come from the default table.
|
||||
// This is only active for those IWADS where the style of these graphics matches the provided BIGFONT for the respective game.
|
||||
if (gameinfo.flags & GI_IGNORETITLEPATCHES)
|
||||
{
|
||||
FTextureID *texids[] = { &wminfo.LName0, &wminfo.LName1 };
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (texids[i]->isValid() && langtable[i] != FStringTable::default_table)
|
||||
{
|
||||
FTexture *tex = TexMan.GetTexture(*texids[i]);
|
||||
if (tex != nullptr)
|
||||
{
|
||||
int filenum = Wads.GetLumpFile(tex->GetSourceLump());
|
||||
if (filenum >= 0 && filenum <= Wads.GetIwadNum())
|
||||
{
|
||||
texids[i]->SetInvalid();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1296,7 +1325,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, WorldDone)
|
|||
void G_DoWorldDone (void)
|
||||
{
|
||||
gamestate = GS_LEVEL;
|
||||
if (wminfo.next[0] == 0)
|
||||
if (nextlevel.IsEmpty())
|
||||
{
|
||||
// Don't crash if no next map is given. Just repeat the current one.
|
||||
Printf ("No next map specified.\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue