Overhaul the "swap weapon" prompt display.

This commit is contained in:
Mari the Deer 2025-01-15 16:49:55 +01:00
commit 67d8235459
7 changed files with 240 additions and 12 deletions

View file

@ -136,6 +136,31 @@ extend Class SWWMHandler
}
}
}
else if ( e.Name.Left(15) ~== "swwmwpnswaptip." )
{
let bar = SWWMStatusBar(StatusBar);
if ( !bar ) return;
// network IDs finally becoming useful here
uint ida = e.Name.Mid(15,8).ToInt(16);
uint idb = e.Name.Mid(23,8).ToInt(16);
let wa = Inventory(Object.GetNetworkEntity(ida));
let wb = Inventory(Object.GetNetworkEntity(idb));
if ( !wa || !wb ) return;
if ( e.Args[0] )
{
// force to expire
if ( bar.cstip ) bar.cstip.Expire(wa,wb);
return;
}
if ( bar.cstip )
{
bar.cstip.Poke(wa,wb);
return;
}
let tt = new("SWWMWeaponSwapTip").Init(wa,wb);
bar.cstip = tt;
bar.AttachMessage(tt,-2911);
}
else if ( e.Name.Left(12) ~== "swwmnametag." )
{
let bar = SWWMStatusBar(StatusBar);