Removed the scripted numerical health hud in the Full Template and added the new GuiHealthTextHud control to the playGui.

This commit is contained in:
thecelloman 2012-10-04 16:13:34 -04:00
parent d762ccd248
commit 00f72f1325
5 changed files with 23 additions and 123 deletions

View file

@ -53,12 +53,6 @@ function Armor::onAdd(%this, %obj)
// Default dynamic armor stats
%obj.setRechargeRate(%this.rechargeRate);
%obj.setRepairRate(0);
// Set the numerical Health HUD
//%obj.updateHealth();
// Calling updateHealth() must be delayed now... for some reason
%obj.schedule(50, "updateHealth");
}
function Armor::onRemove(%this, %obj)
@ -227,9 +221,6 @@ function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageTy
%location = "Body";
// Update the numerical Health HUD
%obj.updateHealth();
// Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods
%client = %obj.client;
@ -435,23 +426,6 @@ function Player::playPain(%this)
}
// ----------------------------------------------------------------------------
// Numerical Health Counter
// ----------------------------------------------------------------------------
function Player::updateHealth(%player)
{
//echo("\c4Player::updateHealth() -> Player Health changed, updating HUD!");
// Calcualte player health
%maxDamage = %player.getDatablock().maxDamage;
%damageLevel = %player.getDamageLevel();
%curHealth = %maxDamage - %damageLevel;
%curHealth = mceil(%curHealth);
// Send the player object's current health level to the client, where it
// will Update the numericalHealth HUD.
commandToClient(%player.client, 'setNumericalHealthHUD', %curHealth);
}
function Player::setDamageDirection(%player, %sourceObject, %damagePos)
{