HUD fix for level names with trailing whitespace.

This commit is contained in:
Mari the Deer 2023-03-06 17:02:54 +01:00
commit e51068adc0
3 changed files with 7 additions and 2 deletions

View file

@ -867,6 +867,9 @@ extend Class SWWMStatusBar
{
int label = am_showmaplabel;
String ln = level.levelname;
if ( ln.Left(1) == "$" ) ln = StringTable.Localize(ln);
// level name may contain trailing whitespace due to DEHACKED fuckery, so strip it
ln.StripRight();
int iof;
if ( ((iof = ln.RightIndexOf(" - by: ")) != -1) || ((iof = ln.RightIndexOf(" - by ")) != -1) || ((iof = ln.RightIndexOf(" - ")) != -1) )
ln.Truncate(iof);

View file

@ -702,6 +702,8 @@ Class DSMapTitle : HUDMessageBase
txtsub = level.authorname;
if ( txt.Left(1) == "$" ) txt = StringTable.Localize(txt);
if ( txtsub.Left(1) == "$" ) txtsub = StringTable.Localize(txtsub);
// level name may contain trailing whitespace due to DEHACKED fuckery, so strip it
txt.StripRight();
int sep;
if ( (sep = txt.RightIndexOf(" - by: ")) != -1 ) // 20 heretics, spooktober
{