From 1e17a31e3eeed8ccf76982534002513cee6593f1 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 14 Sep 2025 10:41:08 -0300 Subject: Magicas --- scripts/GUI/Hud.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'scripts/GUI/Hud.cs') 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("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar"); + hpBar = GetNode("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar"); + mpBar = GetNode("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; } } -- cgit v1.2.3