KF2-Server-Extension/ServerExt/Classes/ExtHUD_SpectatorInfo.uc
Josh 68a6a8e67c Spectator HUD Fix
When spectating a player and spawning back in the spectator HUD still shows, the following code fixes this. The old fix was to go into 3rd Person and back to 1st Person Mode.
2017-10-21 11:20:49 -05:00

48 lines
1.4 KiB
Ucode

class ExtHUD_SpectatorInfo extends KFGFxHUD_SpectatorInfo;
var class<Ext_PerkBase> ExtLastPerkClass;
var bool bUnsetInfo;
function LocalizeText()
{
local GFxObject TempObject;
TempObject = CreateObject("Object");
TempObject.SetString("prevPlayer", "FREE CAMERA");
TempObject.SetString("nextPlayer", PrevPlayerString);
TempObject.SetString("changeCamera", ChangeCameraString);
SetObject("localizedText", TempObject);
}
function UpdatePlayerInfo( optional bool bForceUpdate )
{
local GFxObject TempObject;
local ExtPlayerReplicationInfo E;
if( SpectatedKFPRI == None )
return;
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
if( LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate )
{
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 );
}
}
defaultproperties
{
}