KF2-Server-Extension/ServerExt/Classes/ExtHUD_PlayerBackpack.uc

35 lines
820 B
Ucode
Raw Permalink Normal View History

2017-10-20 02:00:49 +00:00
class ExtHUD_PlayerBackpack extends KFGFxHUD_PlayerBackpack;
var class<Ext_PerkBase> EPerkClass;
function UpdateGrenades()
{
local int CurrentGrenades;
local ExtPerkManager PM;
2020-11-28 20:12:58 +00:00
if (MyKFInvManager != none)
2017-10-20 02:00:49 +00:00
CurrentGrenades = MyKFInvManager.GrenadeCount;
//Update the icon the for grenade type.
2020-11-28 20:12:58 +00:00
if (ExtPlayerController(MyKFPC)!=None)
2017-10-20 02:00:49 +00:00
{
PM = ExtPlayerController(MyKFPC).ActivePerkManager;
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (PM!=None && PM.CurrentPerk!=None && EPerkClass!=PM.CurrentPerk.Class)
2017-10-20 02:00:49 +00:00
{
SetString("backpackGrenadeType", "img://"$PM.CurrentPerk.GrenadeWeaponDef.Static.GetImagePath());
EPerkClass = PM.CurrentPerk.Class;
}
}
// Update the grenades count value
2020-11-28 20:12:58 +00:00
if (CurrentGrenades != LastGrenades)
2017-10-20 02:00:49 +00:00
{
SetInt("backpackGrenades" , Min(CurrentGrenades,9));
LastGrenades = CurrentGrenades;
}
}
2022-09-02 13:08:18 +00:00
defaultproperties
2017-10-20 02:00:49 +00:00
{
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
}