Added inventory display and item display.

This commit is contained in:
=
2026-05-05 20:44:06 +02:00
parent abeb8c0902
commit ffe1077abc
14 changed files with 184 additions and 11 deletions
+7 -1
View File
@@ -15,6 +15,7 @@ public partial class UIHandler : Control
[Export] PanelContainer options;
[Export] Control uiContent;
[Export] PanelContainer menu;
[Export] PanelContainer inventory;
bool receivedRobotJumpSignal = false;
public override void _Ready()
@@ -37,6 +38,7 @@ public partial class UIHandler : Control
if (Input.IsActionJustPressed("map")) HandleMapButton();
if (Input.IsActionJustPressed("menu")) HandleMenuButton();
if (Input.IsActionJustPressed("robot_list")) HandleRobotListButton();
if (Input.IsActionJustPressed("inventory")) HandleInventoryButton();
DisplayStats();
}
@@ -56,6 +58,11 @@ public partial class UIHandler : Control
OpenUIElement(robotList);
}
public void HandleInventoryButton()
{
OpenUIElement(inventory);
}
public void DisplayStats()
{
FPS.Text = Engine.GetFramesPerSecond().ToString() + " FPS";
@@ -86,7 +93,6 @@ public partial class UIHandler : Control
{
foreach (PanelContainer child in uiContent.GetChildren())
{
GD.Print(child == element);
if (child == element) continue;
child.Visible = false;
}