Added random seed and ability to enter a seed. Also added a simple/small tutorial screen and unified the UI with UIStyle.cs

This commit is contained in:
2026-05-09 22:09:15 +02:00
parent 7e70471227
commit fc21c7c8d3
12 changed files with 493 additions and 22 deletions
+12 -6
View File
@@ -29,6 +29,7 @@ public partial class UIHandler : Control
private bool receivedRobotJumpSignal = false;
public override void _Ready()
{
UIStyle.Apply(this);
robotList.OnRobotJumpTo += OnRobotJumpTo;
}
@@ -177,6 +178,10 @@ public partial class UIHandler : Control
waterLabel.Text = $"Water: {GameData.survival.thirst:0}/{GameData.survival.maxThirst:0}";
hungerLabel.Text = $"Food: {GameData.survival.hunger:0}/{GameData.survival.maxHunger:0}";
survivalStatus.Text = GameData.survival.currentStatus;
survivalStatus.Modulate = GameData.survival.currentStatus.Contains("critical")
? UIStyle.GetWarningColor()
: Colors.White;
if (GameData.survival.isDead)
{
ShowGameOver();
@@ -185,13 +190,14 @@ public partial class UIHandler : Control
private void DisplayWorldStats()
{
currentLayer.Text = $"Current layer: {GameData.currentLayer}/{GameData.ruinSize}";
deepestLayer.Text = $"Deepest layer: {GameData.lowestLayer}";
if(GameData.lowestLayer == GameData.ruinSize){
currentLayer.Text = $"Layer: {GameData.currentLayer + 1}/{GameData.ruinSize}";
deepestLayer.Text = $"Gate depth: {GameData.lowestLayer}";
if (GameData.lowestLayer == GameData.ruinSize)
{
unlockLayer.Visible = false;
return;
}
unlockLayer.TooltipText = "Needed items: \r" + GameData.map[GameData.lowestLayer].DisplayGateIngredients();
unlockLayer.TooltipText = "Gate requirements:\r" + GameData.map[GameData.lowestLayer].DisplayGateIngredients();
unlockLayer.Disabled = !GameData.inventory.CanCraft(GameData.map[GameData.lowestLayer].gateIngredients, 1);
}
@@ -213,8 +219,8 @@ public partial class UIHandler : Control
public void ShowGameOver()
{
if(gameOver.Visible) return;
gameOver.GetNode<RichTextLabel>("./VBoxContainer/Content").Text = $"[font_size=32]You died! \r Reason: {GameData.survival.deathReason} \r Better luck next time \r";
if (gameOver.Visible) return;
gameOver.GetNode<RichTextLabel>("./VBoxContainer/Content").Text = $"[font_size=32]You died!\rReason: {GameData.survival.deathReason}\rBetter luck next time.\r";
gameOver.Show();
}