mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Removed the scripted numerical health hud in the Full Template and added the new GuiHealthTextHud control to the playGui.
This commit is contained in:
parent
d762ccd248
commit
00f72f1325
5 changed files with 23 additions and 123 deletions
|
|
@ -36,9 +36,6 @@ function HealthPatch::onCollision(%this, %obj, %col)
|
|||
{
|
||||
%col.applyRepair(%this.repairAmount);
|
||||
|
||||
// Update the Health GUI while repairing
|
||||
%this.doHealthUpdate(%col);
|
||||
|
||||
%obj.respawn();
|
||||
if (%col.client)
|
||||
messageClient(%col.client, 'MsgHealthPatchUsed', '\c2Health Patch Applied');
|
||||
|
|
@ -46,28 +43,6 @@ function HealthPatch::onCollision(%this, %obj, %col)
|
|||
}
|
||||
}
|
||||
|
||||
function HealthPatch::doHealthUpdate(%this, %obj)
|
||||
{
|
||||
// Would be better to add a onRepair() callback to shapeBase.cpp in order to
|
||||
// prevent any excess/unneccesary schedules from this. But for the time
|
||||
// being....
|
||||
|
||||
// This is just a rough timer to update the Health HUD every 250 ms. From
|
||||
// my tests a large health pack will fully heal a player from 10 health in
|
||||
// 36 iterations (ie. 9 seconds). If either the scheduling time, the repair
|
||||
// amount, or the repair rate is changed then the healthTimer counter should
|
||||
// be changed also.
|
||||
|
||||
if (%obj.healthTimer < 40) // 40 = 10 seconds at 1 iteration per 250 ms.
|
||||
{
|
||||
%obj.UpdateHealth();
|
||||
%this.schedule(250, doHealthUpdate, %obj);
|
||||
%obj.healthTimer++;
|
||||
}
|
||||
else
|
||||
%obj.healthTimer = 0;
|
||||
}
|
||||
|
||||
function ShapeBase::tossPatch(%this)
|
||||
{
|
||||
//error("ShapeBase::tossPatch(" SPC %this.client.nameBase SPC ")");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue