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

48 lines
1.3 KiB
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05:00
class ExtHUD_SpectatorInfo extends KFGFxHUD_SpectatorInfo;
var class<Ext_PerkBase> ExtLastPerkClass;
var bool bUnsetInfo;
function LocalizeText()
{
local GFxObject TempObject;
TempObject = CreateObject("Object");
2020-11-28 22:53:57 +03:00
TempObject.SetString("prevPlayer", "FREE CAMERA");
TempObject.SetString("nextPlayer", PrevPlayerString);
TempObject.SetString("changeCamera", ChangeCameraString);
2017-10-19 21:00:49 -05:00
2020-11-28 22:53:57 +03:00
SetObject("localizedText", TempObject);
2017-10-19 21:00:49 -05:00
}
2020-11-28 23:04:55 +03:00
function UpdatePlayerInfo(optional bool bForceUpdate)
2017-10-19 21:00:49 -05:00
{
local GFxObject TempObject;
2017-10-19 21:00:49 -05:00
local ExtPlayerReplicationInfo E;
2020-11-28 23:12:58 +03:00
if (SpectatedKFPRI == None)
return;
2017-10-19 21:00:49 -05:00
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
2020-11-28 23:12:58 +03:00
if (LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate)
2017-10-19 21:00:49 -05:00
{
LastPerkLevel = E.ECurrentPerkLevel;
ExtLastPerkClass = E.ECurrentPerk;
2020-11-28 23:04:55 +03:00
TempObject = CreateObject("Object");
TempObject.SetString("playerName", SpectatedKFPRI.GetHumanReadableName());
2020-11-28 23:12:58 +03:00
if (ExtLastPerkClass!=None && TempObject !=None)
{
2020-11-28 23:04:55 +03:00
TempObject.SetString("playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName);
TempObject.SetString("iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel));
SetObject("playerData", TempObject);
}
2020-11-28 23:04:55 +03:00
else TempObject.SetString("playerPerk","No perk");
SetVisible(true);
2017-10-19 21:00:49 -05:00
}
}
defaultproperties
{
}