diff --git a/language.version b/language.version index fe64a7e04..15b105377 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r969 \cu(Sat 30 Sep 20:44:18 CEST 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r969 \cu(2023-09-30 20:44:18)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r970 \cu(Tue 3 Oct 17:37:33 CEST 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r970 \cu(2023-10-03 17:37:33)\c-"; diff --git a/zscript/handler/swwm_handler_process.zsc b/zscript/handler/swwm_handler_process.zsc index ab4ee4a8a..5ff31f1a6 100644 --- a/zscript/handler/swwm_handler_process.zsc +++ b/zscript/handler/swwm_handler_process.zsc @@ -6,7 +6,7 @@ extend Class SWWMHandler // for the compact hud transient int WeaponFlash[10]; // weapon selector - transient ui SWWMWeaponSelect wsel; + ui SWWMWeaponSelect wsel; override void ConsoleProcess( ConsoleEvent e ) { diff --git a/zscript/hud/swwm_hudextra.zsc b/zscript/hud/swwm_hudextra.zsc index 827a53a4d..bff07ce97 100644 --- a/zscript/hud/swwm_hudextra.zsc +++ b/zscript/hud/swwm_hudextra.zsc @@ -884,12 +884,12 @@ Class SWWMWeaponSelect : HUDMessageBase private int CmpWeapon( Weapon a, Weapon b ) { - let [dummya, slota] = mo.player.weapons.LocateWeapon(a.GetClass()); + let [dummya, slota, idxa] = mo.player.weapons.LocateWeapon(a.GetClass()); if ( slota == 0 ) slota = 10; - let [dummyb, slotb] = mo.player.weapons.LocateWeapon(b.GetClass()); + let [dummyb, slotb, idxb] = mo.player.weapons.LocateWeapon(b.GetClass()); if ( slotb == 0 ) slotb = 10; if ( slota == slotb ) - return (a.SlotPriority <= b.SlotPriority); + return idxa > idxb; return slota > slotb; } @@ -933,6 +933,11 @@ Class SWWMWeaponSelect : HUDMessageBase return false; } + private TextureID GetIcon( Weapon w ) + { + return StatusBar.GetInventoryIcon(w,StatusBar.DI_SKIPALTICON|StatusBar.DI_SKIPREADY); + } + private double CalcHeight() { double th = 0.; @@ -941,7 +946,7 @@ Class SWWMWeaponSelect : HUDMessageBase { if ( !weaps[i] ) continue; double h = 16.; // padding - TextureID ico = weaps[i].Icon; + TextureID ico = GetIcon(weaps[i]); if ( ico.IsValid() ) { Vector2 sz = TexMan.GetScaledSize(ico); @@ -1008,9 +1013,10 @@ Class SWWMWeaponSelect : HUDMessageBase double ht = 20.; // extra padding if ( weaps[cursel] ) { - if ( weaps[cursel].Icon.IsValid() ) + TextureID ico = GetIcon(weaps[cursel]); + if ( ico.IsValid() ) { - Vector2 sz = TexMan.GetScaledSize(weaps[cursel].Icon); + Vector2 sz = TexMan.GetScaledSize(ico); if ( weaps[cursel] is 'SWWMWeapon' ) ht += sz.y*.0625; else ht += sz.y*.5; @@ -1178,7 +1184,7 @@ Class SWWMWeaponSelect : HUDMessageBase y += 8.; double fade = clamp(.8-abs(y-hss.y)/hss.y,0.,.8)/.8; bool bHasAmmo = WeaponHasAmmo(w); - TextureID ico = w.Icon; + TextureID ico = GetIcon(w); if ( ico.IsValid() ) { Vector2 sz = TexMan.GetScaledSize(ico);