diff --git a/src/g_level.cpp b/src/g_level.cpp index 9f0239a1da..fc556c5d43 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -834,13 +834,13 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) // [RH] Mark this level as having been visited if (!(flags & LEVEL_CHANGEMAPCHEAT)) - FindLevelInfo (MapName)->flags |= LEVEL_VISITED; + info->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.thisauthor = info->AuthorName; + if (!wminfo.LName0.isValid() || !(info->flags3 & LEVEL3_HIDEAUTHORNAME)) wminfo.thisauthor = info->AuthorName; wminfo.current = MapName; if (deathmatch && @@ -867,7 +867,7 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) wminfo.next = nextinfo->MapName; wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, ETextureType::MiscPatch); wminfo.nextname = nextinfo->LookupLevelName(&langtable[1]); - wminfo.nextauthor = nextinfo->AuthorName; + if (!wminfo.LName1.isValid() || !(nextinfo->flags3 & LEVEL3_HIDEAUTHORNAME)) wminfo.nextauthor = nextinfo->AuthorName; } } diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 93ac043bc0..4389d28bf8 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1020,6 +1020,15 @@ DEFINE_MAP_OPTION(titlepatch, true) { parse.ParseAssign(); parse.ParseLumpOrTextureName(info->PName); + if (parse.format_type == FMapInfoParser::FMT_New) + { + if (parse.sc.CheckString(",")) + { + parse.sc.MustGetNumber(); + if (parse.sc.Number) info->flags3 |= LEVEL3_HIDEAUTHORNAME; + else info->flags3 &= ~LEVEL3_HIDEAUTHORNAME; + } + } } DEFINE_MAP_OPTION(partime, true) diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index 116e235292..e3f387f8f8 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -248,6 +248,7 @@ enum ELevelFlags : unsigned int LEVEL3_EXITNORMALUSED = 0x00000020, LEVEL3_EXITSECRETUSED = 0x00000040, LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set. + LEVEL3_HIDEAUTHORNAME = 0x00000100, }; diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 9bf2a82412..1339cad728 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -206,7 +206,7 @@ class StatusScreen abstract play version("2.5") } return y + h; } - return 0; + return y; } //==================================================================== @@ -278,18 +278,27 @@ class StatusScreen abstract play version("2.5") // If the displayed info is made of patches we need some additional offsetting here. if (ispatch) { - int h1 = BigFont.GetHeight() - BigFont.GetDisplacement(); - int h2 = (y - oldy) / CleanYfac / 4; - let disp = min(h1, h2); + int disp = 0; // The offset getting applied here must at least be as tall as the largest ascender in the following text to avoid overlaps. - if (!TexMan.OkForLocalization(finishedPatch, "$WI_FINISHED")) + if (authortexts[0].length() == 0) { - disp += finished.mFont.GetMaxAscender("$WI_FINISHED"); - } + int h1 = BigFont.GetHeight() - BigFont.GetDisplacement(); + int h2 = (y - oldy) / CleanYfac / 4; + disp = min(h1, h2); + + if (!TexMan.OkForLocalization(finishedPatch, "$WI_FINISHED")) + { + disp += finished.mFont.GetMaxAscender("$WI_FINISHED"); + } + } + else + { + disp += author.mFont.GetMaxAscender(authortexts[0]); + } y += disp * CleanYfac; } - if (!ispatch) y = DrawAuthor(y, authortexts[0]); + y = DrawAuthor(y, authortexts[0]); // draw "Finished!" @@ -345,8 +354,14 @@ class StatusScreen abstract play version("2.5") } y = DrawName(y, wbs.LName1, lnametexts[1]); - ispatch = wbs.LName1.isValid(); - if (!ispatch) DrawAuthor(y, authortexts[1]); + + if (wbs.LName1.isValid() && authortexts[1].length() > 0) + { + // Consdider the ascender height of the following text. + y += author.mFont.GetMaxAscender(authortexts[1]) * CleanYfac; + } + + DrawAuthor(y, authortexts[1]); }