Some broader support for old map author text handling.

This commit is contained in:
Mari the Deer 2022-12-28 11:44:29 +01:00
commit 4000d095df
4 changed files with 38 additions and 14 deletions

View file

@ -822,8 +822,9 @@ extend Class SWWMStatusBar
{
int label = am_showmaplabel;
String ln = level.levelname;
int iof = ln.IndexOf(" - by: ");
if ( iof != -1 ) ln.Truncate(iof);
int iof;
if ( ((iof = ln.RightIndexOf(" - by: ")) != -1) || ((iof = ln.RightIndexOf(" - by ")) != -1) || ((iof = ln.RightIndexOf(" - ")) != -1) )
ln.Truncate(iof);
if ( !label || ((level.clusterflags&level.CLUSTER_HUB) && (label == 2)) ) str = ln;
else str = String.Format("%s - %s",level.mapname.MakeUpper(),ln);
Screen.DrawText(mSmallFontOutline,tclabel,xx-mSmallFontOutline.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);

View file

@ -701,6 +701,22 @@ Class DSMapTitle : HUDMessageBase
txtsub = level.authorname;
if ( txt.Left(1) == "$" ) txt = StringTable.Localize(txt);
if ( txtsub.Left(1) == "$" ) txtsub = StringTable.Localize(txtsub);
int sep;
if ( (sep = txt.RightIndexOf(" - by: ")) != -1 ) // 20 heretics, spooktober
{
txtsub = txt.Mid(sep+7);
txt.Truncate(sep);
}
else if ( (sep = txt.RightIndexOf(" - by ")) != -1 ) // variation seen in DOOMIUM
{
txtsub = txt.Mid(sep+6);
txt.Truncate(sep);
}
else if ( (sep = txt.RightIndexOf(" - ")) != -1 ) // hexmas and many others (may cause false positives?)
{
txtsub = txt.Mid(sep+3);
txt.Truncate(sep);
}
tics = -10;
holdtics = 140;
fadeintics = 20;

View file

@ -16,17 +16,24 @@ Class SWWMStatScreen : StatusScreen abstract
Super.Start(wbstartstruct);
mSmallFont = Font.GetFont('TewiFont');
// support for old author text style
int iof = lnametexts[0].IndexOf(" - by: ");
if ( iof != -1 )
int iof;
for ( int i=0; i<=1; i++ )
{
authortexts[0] = lnametexts[0].Mid(iof+7);
lnametexts[0].Truncate(iof);
}
iof = lnametexts[1].IndexOf(" - by: ");
if ( iof != -1 )
{
authortexts[1] = lnametexts[1].Mid(iof+7);
lnametexts[1].Truncate(iof);
if ( (iof = lnametexts[i].RightIndexOf(" - by: ")) != -1 ) // 20 heretics, spooktober
{
authortexts[i] = lnametexts[i].Mid(iof+7);
lnametexts[i].Truncate(iof);
}
else if ( (iof = lnametexts[i].RightIndexOf(" - by ")) != -1 ) // variation seen in DOOMIUM
{
authortexts[i] = lnametexts[i].Mid(iof+6);
lnametexts[i].Truncate(iof);
}
else if ( (iof = lnametexts[i].RightIndexOf(" - ")) != -1 ) // hexmas and many others (may cause false positives?)
{
authortexts[i] = lnametexts[i].Mid(iof+3);
lnametexts[i].Truncate(iof);
}
}
}
override void StartMusic()