Added Inventory space display and robot alert if not working currently. Added inventory live update.

This commit is contained in:
2026-05-09 10:36:38 +02:00
parent 892365ff79
commit 053b91a736
5 changed files with 69 additions and 7 deletions
+19
View File
@@ -17,6 +17,7 @@ public partial class UIHandler : Control
[Export] PanelContainer menu;
[Export] PanelContainer inventory;
[Export] ResearchList researchList;
[Export] TextureRect robotAlarm;
bool receivedRobotJumpSignal = false;
public override void _Ready()
@@ -28,6 +29,7 @@ public partial class UIHandler : Control
public override void _Process(double delta)
{
DisplayStats();
DisplayRobotAlarm();
robotList.OnRobotJumpTo += (robot) =>
{
if(receivedRobotJumpSignal) return;
@@ -113,4 +115,21 @@ public partial class UIHandler : Control
child.Visible = false;
}
}
private void DisplayRobotAlarm()
{
string messages = "";
foreach (Robot robot in GameData.robots)
{
if(robot.currentMessage.Length > 0)
{
messages += $"{robot.Name}: {robot.currentMessage}";
}
}
robotAlarm.Visible = messages.Length > 0;
if (messages.Length >= 0)
{
robotAlarm.TooltipText = messages;
}
}
}