56 lines
1.0 KiB
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05:00
class ExtHUD_WaveInfo extends KFGFxHUD_WaveInfo;
function TickHud(float DeltaTime)
{
local int i;
2020-11-28 23:12:58 +03:00
if (KFGRI == none)
2020-11-28 22:53:57 +03:00
KFGRI = KFGameReplicationInfo(GetPC().WorldInfo.GRI);
else
{
2020-11-28 23:12:58 +03:00
if (KFGRI.bTraderIsOpen)
2020-11-28 22:53:57 +03:00
{
2017-10-19 21:00:49 -05:00
i = KFGRI.GetTraderTimeRemaining();
2020-11-28 23:12:58 +03:00
if (LastTraderTimeRemaining != i)
2017-10-19 21:00:49 -05:00
{
SetInt("remainingTraderTime" ,i);
LastTraderTimeRemaining = i;
}
}
2020-11-28 22:53:57 +03:00
else
2017-10-19 21:00:49 -05:00
{
i = KFGRI.IsFinalWave() ? INDEX_NONE : Max(KFGRI.AIRemaining,0);
2020-11-28 23:12:58 +03:00
if (LastZEDCount != i)
2017-10-19 21:00:49 -05:00
{
SetInt("remainingZEDs" ,i);
LastZEDCount = i;
}
}
// Max # of waves.
2020-11-28 23:12:58 +03:00
if (LastWaveMax != KFGRI.WaveMax)
2017-10-19 21:00:49 -05:00
{
LastWaveMax = KFGRI.WaveMax;
SetInt("maxWaves" ,LastWaveMax-1);
}
// Current wave we're on.
2020-11-28 23:12:58 +03:00
if (LastWave!=KFGRI.WaveNum)
2017-10-19 21:00:49 -05:00
{
LastWave = KFGRI.WaveNum;
2020-11-28 23:12:58 +03:00
if (LastWave>LastWaveMax)
2017-10-19 21:00:49 -05:00
{
SetInt("currentWave",0); // Force text to refresh.
SetString("finalText", "END");
}
SetInt("currentWave",Min(LastWave,LastWaveMax));
}
2020-11-28 22:53:57 +03:00
}
2017-10-19 21:00:49 -05:00
}
function UpdateWaveCount();
DefaultProperties
{
LastWave=-1
}