From 339fd5850787877db4f9b8512e21a7a58df5518c Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Thu, 20 Feb 2025 15:20:31 +0100 Subject: [PATCH] Small tweak to HUD score display: * Accumulators fade out sooner * Score interpolator does not tick until accumulators start fading --- language.version | 4 ++-- zscript/handler/swwm_handler_process.zsc | 4 ++-- zscript/hud/swwm_hud.zsc | 2 +- zscript/hud/swwm_hud_topstuff.zsc | 6 ------ zscript/hud/swwm_hud_weapons.zsc | 8 ++++++++ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/language.version b/language.version index e5f68e4e8..327fe0bb5 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1182 \cu(jue 20 feb 2025 13:45:37 CET)\c-"; -SWWM_SHORTVER="\cw1.3pre r1182 \cu(2025-02-20 13:45:37)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1184 \cu(jue 20 feb 2025 15:20:43 CET)\c-"; +SWWM_SHORTVER="\cw1.3pre r1184 \cu(2025-02-20 15:20:43)\c-"; diff --git a/zscript/handler/swwm_handler_process.zsc b/zscript/handler/swwm_handler_process.zsc index 999b62547..2b64bece3 100644 --- a/zscript/handler/swwm_handler_process.zsc +++ b/zscript/handler/swwm_handler_process.zsc @@ -200,7 +200,7 @@ extend Class SWWMHandler if ( !bar ) return; if ( bar.cummscoreup+e.Args[0] < bar.cummscoreup ) bar.cummscoreup = 999999999; else bar.cummscoreup = min(999999999,bar.cummscoreup+e.Args[0]); - bar.cummspanup = 120+40*int(Log10(clamp(bar.cummscoreup,1,999999999))); + bar.cummspanup = 20+35*int(Log10(clamp(bar.cummscoreup,1,999999999))); bar.cummflashup = 15; } else if ( e.Name ~== "swwmhudtakescore" ) @@ -209,7 +209,7 @@ extend Class SWWMHandler if ( !bar ) return; if ( bar.cummscoredn+e.Args[0] < bar.cummscoredn ) bar.cummscoredn = 999999999; else bar.cummscoredn = min(999999999,bar.cummscoredn+e.Args[0]); - bar.cummspandn = 120+40*int(Log10(clamp(bar.cummscoredn,1,999999999))); + bar.cummspandn = 20+35*int(Log10(clamp(bar.cummscoredn,1,999999999))); bar.cummflashdn = 15; } else if ( e.Name ~== "swwmitemused" ) diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index f0d385ba3..01406cd94 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -208,8 +208,8 @@ Class SWWMStatusBar : BaseStatusBar // forcibly flushes our interpolators void Flush() { - FlushTopStuff(); FlushStatus(); + FlushWeapons(); } // separated so they can be auto-ticked by the demolitionist menu diff --git a/zscript/hud/swwm_hud_topstuff.zsc b/zscript/hud/swwm_hud_topstuff.zsc index 1166755d0..445aafe8b 100644 --- a/zscript/hud/swwm_hud_topstuff.zsc +++ b/zscript/hud/swwm_hud_topstuff.zsc @@ -29,14 +29,8 @@ extend Class SWWMStatusBar qsort_playerscore(a,p+1,h); } - private void FlushTopStuff() - { - ScoreInter.Reset(SWWMCredits.Get(CPlayer)); - } - private void TickTopStuffInterpolators() { - ScoreInter.Update(SWWMCredits.Get(CPlayer)); // stats flashing if ( level.killed_monsters > oldkills ) { diff --git a/zscript/hud/swwm_hud_weapons.zsc b/zscript/hud/swwm_hud_weapons.zsc index fd3692bce..49f9760ff 100644 --- a/zscript/hud/swwm_hud_weapons.zsc +++ b/zscript/hud/swwm_hud_weapons.zsc @@ -1,8 +1,16 @@ // Weapons and ammo extend Class SWWMStatusBar { + private void FlushWeapons() + { + ScoreInter.Reset(SWWMCredits.Get(CPlayer)); + } + private void TickWeaponInterpolators() { + // don't update while cumulative scores are racking up + if ( ((cummspanup < 20) && (cummspandn < 20)) || (CPlayer != players[consoleplayer]) ) + ScoreInter.Update(SWWMCredits.Get(CPlayer)); // ammo updates for ( int i=0; i<18; i++ ) {