From 7e3a4a223f91a989268349c83279f39e13742a65 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Mon, 6 Mar 2023 17:02:54 +0100 Subject: [PATCH] HUD fix for level names with trailing whitespace. --- language.version | 4 ++-- zscript/hud/swwm_hud_topstuff.zsc | 3 +++ zscript/hud/swwm_hudextra.zsc | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/language.version b/language.version index 0801bfa61..fcc488d4f 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r757 \cu(Sun 5 Mar 17:03:02 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r757 \cu(2023-03-05 17:03:02)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r758 \cu(Mon 6 Mar 17:06:32 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r758 \cu(2023-03-06 17:06:32)\c-"; diff --git a/zscript/hud/swwm_hud_topstuff.zsc b/zscript/hud/swwm_hud_topstuff.zsc index 65e8f1ade..ea1fbde32 100644 --- a/zscript/hud/swwm_hud_topstuff.zsc +++ b/zscript/hud/swwm_hud_topstuff.zsc @@ -822,6 +822,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); diff --git a/zscript/hud/swwm_hudextra.zsc b/zscript/hud/swwm_hudextra.zsc index 1d4895b21..2be99a86d 100644 --- a/zscript/hud/swwm_hudextra.zsc +++ b/zscript/hud/swwm_hudextra.zsc @@ -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 {