Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

TribesGUI.HUDGrenadesIcon


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
class HUDGrenadesIcon extends HUDEquipmentIcon;

var class previousGrenadeClass;
var int previousGrenadeAmmo;

function UpdateData(ClientSideCharacter c)
{
	super.UpdateData(c);

	if(c.grenades.type == None)
		bVisible = false;
	else
		bVisible = c.grenades.ammo > 0;

	if(bVisible)
	{
		// flashing "updated" indicator
		if(previousGrenadeClass != c.grenades.type || c.grenades.ammo > previousGrenadeAmmo)
			DoUpdateFlash();

		quantityLabel.SetText(""$c.grenades.ammo);
		keyLabel.SetText(c.grenades.hotkey);

		equipmentBar.activeEmptyTexture.material = c.grenades.type.default.hudRefireIcon;
		equipmentBar.activeEmptyTexture.coords = c.grenades.type.default.hudRefireIconCoords;
		equipmentBar.activeFullTexture.material = c.grenades.type.default.hudIcon;
		equipmentBar.activeFullTexture.coords = c.grenades.type.default.hudIconCoords;

		// only show recharge if we can fire
		if(c.grenades.bCanFire)
		{
			equipmentBar.maximumValue = c.grenades.refireTime;
			equipmentBar.value = c.grenades.timeSinceLastFire;
		}
		else
		{
			equipmentBar.maximumValue = 1;
			equipmentBar.value = 1;
		}
	}

	previousGrenadeClass = c.grenades.type;
	previousGrenadeAmmo = c.grenades.ammo;
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: st 16.4.2014 10:20:44.000 - Creation time: st 23.5.2018 00:10:44.295 - Created with UnCodeX