2021-05-16 03:37:39 +00:00
|
|
|
class ScoreboardExtHUD extends KFGFxHudWrapper
|
2021-05-16 09:40:02 +00:00
|
|
|
config(ScoreboardExtMut);
|
2020-01-10 13:14:11 +00:00
|
|
|
|
|
|
|
const HUDBorderSize = 3;
|
|
|
|
|
|
|
|
var float ScaledBorderSize;
|
|
|
|
var array<KFGUI_Base> HUDWidgets;
|
|
|
|
|
|
|
|
var class<KFScoreBoard> ScoreboardClass;
|
|
|
|
var KFScoreBoard Scoreboard;
|
|
|
|
|
2021-05-16 06:16:12 +00:00
|
|
|
var transient KF2GUIController GUIController;
|
|
|
|
var transient GUIStyleBase GUIStyle;
|
2020-01-17 18:46:21 +00:00
|
|
|
|
2020-01-10 13:14:11 +00:00
|
|
|
simulated function PostBeginPlay()
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
Super.PostBeginPlay();
|
|
|
|
|
|
|
|
PlayerOwner.PlayerInput.OnReceivedNativeInputKey = NotifyInputKey;
|
|
|
|
PlayerOwner.PlayerInput.OnReceivedNativeInputAxis = NotifyInputAxis;
|
|
|
|
PlayerOwner.PlayerInput.OnReceivedNativeInputChar = NotifyInputChar;
|
|
|
|
|
|
|
|
RemoveMovies();
|
|
|
|
CreateHUDMovie();
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function PostRender()
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
if( KFGRI == None )
|
|
|
|
KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
|
|
|
|
|
|
|
|
if( GUIController!=None && PlayerOwner.PlayerInput==None )
|
|
|
|
GUIController.NotifyLevelChange();
|
|
|
|
|
|
|
|
if( GUIController==None || GUIController.bIsInvalid )
|
|
|
|
{
|
|
|
|
GUIController = Class'ScoreboardExt.KF2GUIController'.Static.GetGUIController(PlayerOwner);
|
|
|
|
if( GUIController!=None )
|
|
|
|
{
|
|
|
|
GUIStyle = GUIController.CurrentStyle;
|
|
|
|
GUIStyle.HUDOwner = self;
|
|
|
|
LaunchHUDMenus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GUIStyle.Canvas = Canvas;
|
|
|
|
GUIStyle.PickDefaultFontSize(Canvas.ClipY);
|
|
|
|
|
|
|
|
if( !GUIController.bIsInMenuState )
|
|
|
|
GUIController.HandleDrawMenu();
|
|
|
|
|
2021-05-16 06:16:12 +00:00
|
|
|
ScaledBorderSize = FMax(GUIStyle.ScreenScale(HUDBorderSize), 1.f);
|
2021-05-16 09:40:02 +00:00
|
|
|
|
|
|
|
Super.PostRender();
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function LaunchHUDMenus()
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
Scoreboard = KFScoreBoard(GUIController.InitializeHUDWidget(ScoreboardClass));
|
|
|
|
Scoreboard.SetVisibility(false);
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function bool NotifyInputKey(int ControllerId, Name Key, EInputEvent Event, float AmountDepressed, bool bGamepad)
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
local int i;
|
|
|
|
|
|
|
|
for( i=(HUDWidgets.Length-1); i>=0; --i )
|
|
|
|
{
|
|
|
|
if( HUDWidgets[i].bVisible && HUDWidgets[i].NotifyInputKey(ControllerId, Key, Event, AmountDepressed, bGamepad) )
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function bool NotifyInputAxis(int ControllerId, name Key, float Delta, float DeltaTime, optional bool bGamepad)
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
local int i;
|
|
|
|
|
|
|
|
for( i=(HUDWidgets.Length-1); i>=0; --i )
|
|
|
|
{
|
|
|
|
if( HUDWidgets[i].bVisible && HUDWidgets[i].NotifyInputAxis(ControllerId, Key, Delta, DeltaTime, bGamepad) )
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function bool NotifyInputChar(int ControllerId, string Unicode)
|
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
local int i;
|
|
|
|
|
|
|
|
for( i=(HUDWidgets.Length-1); i>=0; --i )
|
|
|
|
{
|
|
|
|
if( HUDWidgets[i].bVisible && HUDWidgets[i].NotifyInputChar(ControllerId, Unicode) )
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
2021-05-16 06:16:12 +00:00
|
|
|
exec function SetShowScores(bool bNewValue)
|
2021-05-16 04:40:47 +00:00
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
if (Scoreboard != None)
|
|
|
|
Scoreboard.SetVisibility(bNewValue);
|
2021-05-16 06:16:12 +00:00
|
|
|
else Super.SetShowScores(bNewValue);
|
2021-05-16 04:40:47 +00:00
|
|
|
}
|
|
|
|
|
2021-05-16 06:16:12 +00:00
|
|
|
defaultproperties
|
2021-05-16 04:40:47 +00:00
|
|
|
{
|
2021-05-16 09:40:02 +00:00
|
|
|
ScoreboardClass=class'KFScoreBoard'
|
2020-01-10 13:14:11 +00:00
|
|
|
}
|