Added resource weights and layer unlock UI to the game.

This commit is contained in:
2026-05-09 13:53:00 +02:00
parent 677d8595db
commit 9fa1909dcb
7 changed files with 101 additions and 29 deletions
+17
View File
@@ -20,6 +20,10 @@ public partial class UIHandler : Control
[Export] RichTextLabel waterLabel;
[Export] RichTextLabel hungerLabel;
[Export] RichTextLabel survivalStatus;
[Export] RichTextLabel currentLayer;
[Export] RichTextLabel deepestLayer;
[Export] Button unlockLayer;
private bool receivedRobotJumpSignal = false;
public override void _Ready()
@@ -94,6 +98,7 @@ public partial class UIHandler : Control
string memoryDisplay = memory > 1024 ? Math.Round(memory / 1024, 2).ToString() + " GB" : memory.ToString() + " MB";
RAM.Text = memoryDisplay;
DisplaySurvivalStats();
DisplayWorldStats();
}
public void ExitGame()
@@ -159,4 +164,16 @@ public partial class UIHandler : Control
hungerLabel.Text = $"Food: {GameData.survival.hunger:0}/{GameData.survival.maxHunger:0}";
survivalStatus.Text = GameData.survival.currentStatus;
}
private void DisplayWorldStats()
{
currentLayer.Text = $"Current layer: {GameData.currentLayer}/{GameData.ruinSize}";
deepestLayer.Text = $"Deepest layer: {GameData.lowestLayer}";
}
public void UnlockLayer()
{
}
}