From 63e4f75e9292e1276cc0b5d11ebad010f147aa68 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 4 Nov 2025 12:54:13 -0300 Subject: Display de andar --- scenes/GUI/hud.tscn | 21 ++++++++++++++++----- scripts/GUI/Hud.cs | 23 +++++++++++++++++++++-- scripts/Map/Map.cs | 7 ++----- scripts/Utils/SignalBus.cs | 3 +++ 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/scenes/GUI/hud.tscn b/scenes/GUI/hud.tscn index 034d2d9..eaf687a 100644 --- a/scenes/GUI/hud.tscn +++ b/scenes/GUI/hud.tscn @@ -40,15 +40,19 @@ theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 5 theme_override_constants/margin_bottom = 5 -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer"] layout_mode = 2 -[node name="AspectRatioContainer" type="AspectRatioContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="AspectRatioContainer" type="AspectRatioContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 ratio = 5.0 -[node name="HPbar" type="TextureProgressBar" parent="VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer"] +[node name="HPbar" type="TextureProgressBar" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer/AspectRatioContainer"] custom_minimum_size = Vector2(50, 10) layout_mode = 2 size_flags_horizontal = 3 @@ -58,12 +62,12 @@ texture_under = ExtResource("2_p7vwb") texture_over = ExtResource("3_ktti3") texture_progress = ExtResource("4_cgfq5") -[node name="AspectRatioContainer2" type="AspectRatioContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer"] +[node name="AspectRatioContainer2" type="AspectRatioContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 ratio = 5.0 -[node name="MPbar" type="TextureProgressBar" parent="VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer2"] +[node name="MPbar" type="TextureProgressBar" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer/AspectRatioContainer2"] custom_minimum_size = Vector2(50, 10) layout_mode = 2 size_flags_horizontal = 3 @@ -73,6 +77,13 @@ texture_under = ExtResource("4_8dubc") texture_over = ExtResource("5_p7vwb") texture_progress = ExtResource("6_ktti3") +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="floorLabel" type="Label" parent="VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Andar: X" + [node name="MessagelogContainer" type="PanelContainer" parent="VBoxContainer/InfoBar"] layout_mode = 2 size_flags_horizontal = 3 diff --git a/scripts/GUI/Hud.cs b/scripts/GUI/Hud.cs index a1511b8..60e1e91 100644 --- a/scripts/GUI/Hud.cs +++ b/scripts/GUI/Hud.cs @@ -1,5 +1,6 @@ using System.Runtime.InteropServices; using Godot; +using TheLegendOfGustav.Utils; namespace TheLegendOfGustav.GUI; @@ -7,12 +8,25 @@ public partial class Hud : CanvasLayer { private TextureProgressBar hpBar; private TextureProgressBar mpBar; + private Label floorLabel; public override void _Ready() { base._Ready(); - hpBar = GetNode("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar"); - mpBar = GetNode("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer2/MPbar"); + hpBar = GetNode("VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer/AspectRatioContainer/HPbar"); + mpBar = GetNode("VBoxContainer/InfoBar/Stats/MarginContainer/VBoxContainer/HBoxContainer/AspectRatioContainer/HPbar"); + floorLabel = GetNode