This commit is contained in:
2026-03-15 21:26:59 +01:00
parent 95616f61fc
commit 50de6abb5d
9 changed files with 52 additions and 15 deletions

View File

@@ -4,8 +4,10 @@ using System;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_heart.png")]
public partial class Healthbar : ProgressBar
{
private Timer _damageCatchUpTimer;
private ProgressBar _damagedHealth;
private Timer _damageCatchUpTimer = null!;
private ProgressBar _damagedHealth = null!;
[Export] public StyleBox? BarStyle;
private float _currentHealth;
public float CurrentHealth
@@ -21,6 +23,9 @@ public partial class Healthbar : ProgressBar
_damageCatchUpTimer.Timeout += OnDamageCatchUp;
Visible = false;
if (BarStyle != null)
AddThemeStyleboxOverride("fill", BarStyle);
}
public void Initialize(float initialHealth)

View File

@@ -5,7 +5,7 @@
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0sgot"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0k5hr"]
bg_color = Color(0.698864, 0.047356047, 0, 1)
bg_color = Color(0.69803923, 0.047058824, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0sgot"]
bg_color = Color(0.14767182, 0.14767182, 0.14767176, 1)