From cf17e889d854ef744528629152d3872351354f25 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Thu, 21 Aug 2025 01:31:55 +0200 Subject: [PATCH] Use InterfaceEvents instead of PostUiTick for oneliners, more reliable. Due to some arbitrary change in GZDoom, which was later merged into VKDoom as well, PostUiTick no longer consistently gets called after WorldTick. This is kind of funny and also disappointing and sad because I intentionally designed that feature this way, on purpose, and now it no longer works as intended. Who knows how many other mods are affected by this now. --- language.version | 4 ++-- zscript/handler/swwm_handler.zsc | 1 - zscript/handler/swwm_handler_oneliners.zsc | 19 +------------------ zscript/handler/swwm_handler_process.zsc | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/language.version b/language.version index a359a847b..e35212142 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1238 \cu(jue 21 ago 2025 01:17:09 CEST)\c-"; -SWWM_SHORTVER="\cw1.3pre r1238 \cu(2025-08-21 01:17:09)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1239 \cu(jue 21 ago 2025 01:31:55 CEST)\c-"; +SWWM_SHORTVER="\cw1.3pre r1239 \cu(2025-08-21 01:31:55)\c-"; diff --git a/zscript/handler/swwm_handler.zsc b/zscript/handler/swwm_handler.zsc index a74158a8e..49e73150a 100644 --- a/zscript/handler/swwm_handler.zsc +++ b/zscript/handler/swwm_handler.zsc @@ -268,7 +268,6 @@ Class SWWMHandler : EventHandler override void PostUiTick() { - OnelinerUITick(); VanillaBossUITick(); // corruption cards dialogue if ( ccloaded && !gdat.ccstartonce && !cardmessaged && (gamestate == GS_LEVEL) ) diff --git a/zscript/handler/swwm_handler_oneliners.zsc b/zscript/handler/swwm_handler_oneliners.zsc index f99dc3dbf..f59bf22f5 100644 --- a/zscript/handler/swwm_handler_oneliners.zsc +++ b/zscript/handler/swwm_handler_oneliners.zsc @@ -134,6 +134,7 @@ extend Class SWWMHandler if ( loudlv > 2 ) players[consoleplayer].mo.A_StartSound(onelinersnd,CHAN_DEMOVOICEAUX2,CHANF_DEFAULT,1.,ATTN_NONE); if ( loudlv > 3 ) players[consoleplayer].mo.A_StartSound(onelinersnd,CHAN_DEMOVOICEAUX3,CHANF_DEFAULT,1.,ATTN_NONE); } + SendInterfaceEvent(consoleplayer,"swwmmessageliner."..oneliner,onelinerlevel,onelinerspan); SendNetworkEvent("swwmremoteliner."..onelinersnd,consoleplayer,onelinerlevel); // hack due to the fact this one can be cancelled early if ( onelinertype == "falling" ) Demolitionist(players[consoleplayer].mo).facegrin = true; @@ -141,22 +142,4 @@ extend Class SWWMHandler onelinertic = 0; onelinerspan = 0; } - - private ui void OnelinerUITick() - { - if ( (gametic != onelinertic) || (oneliner == "") || (players[consoleplayer].health <= 0) ) - return; - if ( onelinerlevel > swwm_mutevoice ) - { - let l = SWWMOneLiner.Make(oneliner,onelinerspan); - StatusBar.AttachMessage(l,-3473); - if ( swwm_voicelog ) - { - String txt = StringTable.Localize(oneliner); - txt.Replace("\c-","\c*"); // fix color reset escapes - Console.PrintfEx(PRINT_CHAT|PRINT_NONOTIFY,"\cd"..(multiplayer?players[consoleplayer].GetUserName():"Demo").."\c*: "..txt.."\c*"); - } - } - SendNetworkEvent("swwmremotelinertxt."..oneliner,consoleplayer,onelinerlevel); - } } diff --git a/zscript/handler/swwm_handler_process.zsc b/zscript/handler/swwm_handler_process.zsc index 58b2b7d03..4137fa304 100644 --- a/zscript/handler/swwm_handler_process.zsc +++ b/zscript/handler/swwm_handler_process.zsc @@ -96,6 +96,25 @@ extend Class SWWMHandler if ( e.IsManual ) return; if ( e.Name.Left(16) ~== "swwmsetdialogue." ) SWWMDialogues.StartSeq(e.Name.Mid(16)); + if ( e.Name.Left(17) ~== "swwmmessageliner." ) + { + String theline = e.Name.Mid(17); + int linelevel = e.Args[0]; + int linespan = e.Args[1]; + if ( (theline == "") || (players[consoleplayer].health <= 0) ) return; + if ( linelevel > swwm_mutevoice ) + { + let l = SWWMOneLiner.Make(theline,linespan); + StatusBar.AttachMessage(l,-3473); + if ( swwm_voicelog ) + { + String txt = StringTable.Localize(theline); + txt.Replace("\c-","\c*"); // fix color reset escapes + Console.PrintfEx(PRINT_CHAT|PRINT_NONOTIFY,"\cd"..(multiplayer?players[consoleplayer].GetUserName():"Demo").."\c*: "..txt.."\c*"); + } + } + SendNetworkEvent("swwmremotelinertxt."..theline,consoleplayer,linelevel); + } else if ( e.Name.Left(11) ~== "swwmkeyget." ) { let bar = SWWMStatusBar(StatusBar);