diff options
Diffstat (limited to 'scripts/GUI/Hud.cs')
| -rw-r--r-- | scripts/GUI/Hud.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/GUI/Hud.cs b/scripts/GUI/Hud.cs index 1149728..227ca32 100644 --- a/scripts/GUI/Hud.cs +++ b/scripts/GUI/Hud.cs @@ -1,20 +1,29 @@ +using System.Runtime.InteropServices; using Godot; namespace TheLegendOfGustav.GUI; public partial class Hud : Node { - private TextureProgressBar HpBar { get; set; } + private TextureProgressBar hpBar; + private TextureProgressBar mpBar; public override void _Ready() { base._Ready(); - HpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar"); + hpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar"); + mpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer2/MPbar"); } public void OnHealthChanged(int hp, int maxHp) { - HpBar.Value = hp; - HpBar.MaxValue = maxHp; + hpBar.Value = hp; + hpBar.MaxValue = maxHp; + } + + public void OnManaChanged(int mp, int maxMp) + { + mpBar.Value = mp; + mpBar.MaxValue = maxMp; } } |
