Added resource weights and layer unlock UI to the game.
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user