forked from Mirrors/openclonk
HUD fix
parent
fc69b49f50
commit
352dd93c8f
|
@ -173,6 +173,8 @@ global func UpdateHUDHealthBar(player)
|
|||
var o = FindObject(Find_ID(GUI_Controller), Find_Owner(player));
|
||||
if(!o) return;
|
||||
o.updated_health_tube->Update();
|
||||
if(!GetEffect("Update", o.updated_health_tube))
|
||||
AddEffect("Update", o.updated_health_tube, 1, 1, o.updated_health_tube);
|
||||
}
|
||||
|
||||
global func UpdateBackpack(player)
|
||||
|
|
|
@ -17,7 +17,10 @@ protected func Construction()
|
|||
this["Visibility"] = VIS_Owner;
|
||||
}
|
||||
|
||||
public func FxUpdateTimer() { Update(); }
|
||||
public func FxUpdateTimer(target, effect, time)
|
||||
{
|
||||
if(!Update()) return -1;
|
||||
}
|
||||
public func FxUpdateNumberTimer() { UpdateNumber(); }
|
||||
public func UpdateNumber()
|
||||
{
|
||||
|
@ -31,7 +34,7 @@ public func UpdateNumber()
|
|||
}
|
||||
public func Update()
|
||||
{
|
||||
if(!GetCursor(GetOwner())) return 1;
|
||||
if(!GetCursor(GetOwner())) return 0;
|
||||
if(GetCursor(GetOwner()) != crew)
|
||||
{
|
||||
crew = GetCursor(GetOwner());
|
||||
|
@ -50,7 +53,7 @@ public func Update()
|
|||
//if(!crew) return 1;
|
||||
CustomMessage(Format("@<c dd0000>%v</c>",current),this,crew->GetOwner(),16,-72);
|
||||
|
||||
if(! crew->GetMaxEnergy()) return;
|
||||
if(! crew->GetMaxEnergy()) return 0;
|
||||
if(Abs(current - crew->GetEnergy()))
|
||||
{
|
||||
if(Abs(current - crew->GetEnergy()) > 6 )
|
||||
|
@ -64,7 +67,7 @@ public func Update()
|
|||
else
|
||||
current+=1;
|
||||
}
|
||||
else return 1;
|
||||
else return 0;
|
||||
|
||||
var r = - 210 - ((( current * 1000) / crew->GetMaxEnergy()) * 69) / 100;
|
||||
var fsin=Sin(r, 1000,10), fcos=Cos(r, 1000,10);
|
||||
|
@ -77,6 +80,7 @@ public func Update()
|
|||
|
||||
|
||||
//SetR(r);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ func FxHUDBarUpdaterDamage(target, effect, int damage, int cause)
|
|||
|
||||
private func ScheduleUpdateHUDHealthBar()
|
||||
{
|
||||
Schedule(Format("UpdateHUDHealthBar(%d)", GetOwner()), 1, 0);
|
||||
Schedule(nil, Format("UpdateHUDHealthBar(%d)", GetOwner()), 1, 0);
|
||||
}
|
||||
|
||||
private func ScheduleUpdateBackpack()
|
||||
{
|
||||
Schedule(Format("UpdateBackpack(%d)", GetOwner()), 1, 0);
|
||||
Schedule(nil, Format("UpdateBackpack(%d)", GetOwner()), 1, 0);
|
||||
}
|
||||
|
||||
func Collection2()
|
||||
|
|
Loading…
Reference in New Issue