Added Inventory space display and robot alert if not working currently. Added inventory live update.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user