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
+78
View File
@@ -0,0 +1,78 @@
using Godot;
using System.Collections.Generic;
public partial class TutorialBubble : PanelContainer
{
[Export] RichTextLabel speakerLabel;
[Export] RichTextLabel contentLabel;
[Export] RichTextLabel progressLabel;
[Export] Button nextButton;
[Export] Button skipButton;
private List<string> messages = new List<string>();
private int currentIndex = 0;
public override void _Ready()
{
UIStyle.Apply(this);
CreateMessages();
nextButton.Pressed += ShowNext;
skipButton.Pressed += SkipTutorial;
if (!GameData.showTutorial)
{
Hide();
return;
}
ShowMessage(0);
}
private void CreateMessages()
{
messages = new List<string>
{
"Welcome to the ruin. I am B.O.B.",
"B.O.B. means Building Operation Buddy. I will keep the lamps on while you teach the robots what to do.",
"The last remaining unit in this ruin saved you from your fall and brought you here. If you want to leave, you have to explore the ruin",
"You do not walk through the ruin yourself. Your robots explore, harvest, craft and carry progress for you.",
"The top bar shows survival pressure: energy, water and food. If those run out, the expedition ends.",
"Open the robot panel (Default: [R]) to inspect your robots. A robot can overheat, lose maintenance and slow down if ignored.",
"Use the script editor (Clicking 'Jump to' from the robot panel) to give robots commands. Start simple: move, explore, harvest, then craft.",
"Research unlocks better tools, buildings, robot upgrades and deeper progression. The graph is your technology map (Default: [T]).",
"The inventory (Default: [I]) stores everything your robots collect. Gates and research both consume items from it.",
"Each gate blocks the next layer. When you have the required items, use Open Gate in the top bar.",
"The map (Default: [M]) shows what your robots have discovered. Exploration matters because resources are hidden in the ruin.",
"That is enough briefing. Build a loop, keep the robots alive, and open the lower gates. B.O.B. believes in organized chaos."
};
}
private void ShowNext()
{
currentIndex++;
if (currentIndex >= messages.Count)
{
SkipTutorial();
return;
}
ShowMessage(currentIndex);
}
private void SkipTutorial()
{
GameData.showTutorial = false;
Hide();
}
private void ShowMessage(int index)
{
currentIndex = index;
speakerLabel.Text = "B.O.B.";
contentLabel.Text = messages[index];
progressLabel.Text = $"{index + 1}/{messages.Count}";
nextButton.Text = index == messages.Count - 1 ? "Done" : "Next";
Show();
}
}