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

48 lines
1.4 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00: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 19:53:57 +00:00
TempObject.SetString("prevPlayer", "FREE CAMERA");
TempObject.SetString("nextPlayer", PrevPlayerString);
TempObject.SetString("changeCamera", ChangeCameraString);
2017-10-20 02:00:49 +00:00
2020-11-28 19:53:57 +00:00
SetObject("localizedText", TempObject);
2017-10-20 02:00:49 +00:00
}
function UpdatePlayerInfo( optional bool bForceUpdate )
2017-10-20 02:00:49 +00:00
{
local GFxObject TempObject;
2017-10-20 02:00:49 +00:00
local ExtPlayerReplicationInfo E;
if( SpectatedKFPRI == None )
return;
2017-10-20 02:00:49 +00:00
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
if( LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate )
2017-10-20 02:00:49 +00:00
{
LastPerkLevel = E.ECurrentPerkLevel;
ExtLastPerkClass = E.ECurrentPerk;
TempObject = CreateObject( "Object" );
TempObject.SetString( "playerName", SpectatedKFPRI.GetHumanReadableName() );
if( ExtLastPerkClass!=None && TempObject !=None )
{
TempObject.SetString( "playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName );
TempObject.SetString( "iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel) );
SetObject( "playerData", TempObject );
}
else TempObject.SetString( "playerPerk","No perk" );
SetVisible( true );
2017-10-20 02:00:49 +00:00
}
}
defaultproperties
{
}