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.
This commit is contained in:
parent
3d88b2edf2
commit
68a6a8e67c
@ -15,47 +15,33 @@ function LocalizeText()
|
|||||||
SetObject("localizedText", TempObject);
|
SetObject("localizedText", TempObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateSpectateeInfo(optional bool bForceUpdate)
|
function UpdatePlayerInfo( optional bool bForceUpdate )
|
||||||
{
|
|
||||||
local ExtPlayerReplicationInfo E;
|
|
||||||
|
|
||||||
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
|
|
||||||
if( !GetPC().IsSpectating() || E==None )
|
|
||||||
{
|
|
||||||
if( !bUnsetInfo )
|
|
||||||
{
|
|
||||||
SetVisible(false);
|
|
||||||
bUnsetInfo = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the perk class.
|
|
||||||
if( ExtLastPerkClass!=E.ECurrentPerk || LastPerkLevel!=E.ECurrentPerkLevel || bForceUpdate || bUnsetInfo )
|
|
||||||
{
|
|
||||||
LastPerkLevel = E.ECurrentPerkLevel;
|
|
||||||
ExtLastPerkClass = E.ECurrentPerk;
|
|
||||||
UpdatePlayerInfo(bForceUpdate);
|
|
||||||
bUnsetInfo = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function UpdatePlayerInfo(optional bool bForceUpdate)
|
|
||||||
{
|
{
|
||||||
local GFxObject TempObject;
|
local GFxObject TempObject;
|
||||||
|
local ExtPlayerReplicationInfo E;
|
||||||
|
|
||||||
|
if( SpectatedKFPRI == None )
|
||||||
|
return;
|
||||||
|
|
||||||
|
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
|
||||||
|
|
||||||
TempObject = CreateObject("Object");
|
if( LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate )
|
||||||
TempObject.SetString("playerName", SpectatedKFPRI.GetHumanReadableName());
|
|
||||||
if( ExtLastPerkClass!=None )
|
|
||||||
{
|
{
|
||||||
TempObject.SetString("playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName );
|
LastPerkLevel = E.ECurrentPerkLevel;
|
||||||
TempObject.SetString("iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel));
|
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 );
|
||||||
}
|
}
|
||||||
else TempObject.SetString("playerPerk","No perk");
|
|
||||||
SetObject("playerData", TempObject);
|
|
||||||
SetVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user