class SGFxHud extends GFxMoviePlayer;
var GFxObject XPBar_mc, xptxt_mc;
var float LastHealthpc, Lastxppc;
var WorldInfo ThisWorld;
function Init(optional LocalPlayer player)
{
super.Init(player);
lastxppc = -1337;
LastHealthpc = -1337;
LastOxygen = -1337;
Breaths = 20;
XPBar_mc = GetVariableObject("_root.XPBar_mc");
xptxt_mc = GetVariableObject("_root.XPBar_mc.leveltxt");
xptxt_mc.SetText("PC.Level");
}
function int roundNum(float NumIn)
{
local int iNum;
local float fNum;
fNum = NumIn;
iNum = int( fNum );
fNum -= iNum;
if ( fNum >= 0.5f )
return ( iNum + 1 );
else
return iNum;
}
function int GetPercentage( int Value, int MaxValue )
{
return roundNum( ( float( Value ) / float( MaxValue ) ) * 100.0f);
}
function TickHud()
{
local MyPlayerController PC;
PC = MyPlayerController(PlayerOwner);
if(lastxppc != GetPercentage( PC.Level, PC.MAX_LEVEL ))
{
lastxppc = GetPercentage( PC.Level, PC.MAX_LEVEL );
XPBar_mc.SetFloat( "_xscale", (lastxppc > 100) ? 100.0f : lastxppc );
}
if (LastHealthpc != GetPercentage( UTP.Health, UTP.HealthMax ))
{
LastHealthpc = GetPercentage( UTP.Health, UTP.HealthMax );
}
}
DefaultProperties
{
bDisplayWithHudOff=false
MovieInfo=SwfMovie'SensitivityFLASH.XPTest'
bEnableGammaCorrection=false
bDrawWeaponCrosshairs=false
bAutoPlay=true;
bAllowInput=false;
bAllowFocus=false;
}
Bookmarks