Added new release, updated nodes to contain tooltip text.
This commit is contained in:
@@ -7,6 +7,7 @@ public class CraftNode : ProgramNode
|
||||
public CraftNode()
|
||||
{
|
||||
DisplayText = "Craft";
|
||||
TooltipText = "Crafts the selected item the selected amount of times by consuming the required ingredients from the shared inventory.";
|
||||
}
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ public class ExploreNode : ProgramNode
|
||||
public ExploreNode()
|
||||
{
|
||||
DisplayText = "Explore";
|
||||
TooltipText = "Explores nearby unknown tiles around the robot and reveals them for future navigation. \rContinues exploration until no unvisited tile is left.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ForNode : ProgramNode
|
||||
public ForNode()
|
||||
{
|
||||
DisplayText = "For";
|
||||
TooltipText = "Repeats the connected branch (Top slot) for the configured amount of executions before continuing through the negative output. (Bottom slot)";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -5,6 +5,7 @@ public class HarvestNode : ProgramNode
|
||||
public HarvestNode()
|
||||
{
|
||||
DisplayText = "Harvest";
|
||||
TooltipText = "Harvests one unit from the resource on the robot's current tile and adds the result to the shared inventory.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -9,6 +9,7 @@ public class IfNode : ProgramNode
|
||||
public IfNode()
|
||||
{
|
||||
DisplayText = "If";
|
||||
TooltipText = "Checks an inventory condition once. If the condition is true, execution follows the main output (Top slot); otherwise it follows the negative output. (Bottom slot)";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -7,6 +7,7 @@ public class MaintainNode : ProgramNode
|
||||
public MaintainNode()
|
||||
{
|
||||
DisplayText = "Maintain";
|
||||
TooltipText = "Repairs the robot by consuming one matching gear and restoring a small amount of maintenance.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -10,6 +10,7 @@ public class MoveNode : ProgramNode
|
||||
public MoveNode()
|
||||
{
|
||||
DisplayText = "Move";
|
||||
TooltipText = "Moves the robot to the selected map coordinate. The path must be reachable from the robot's current position.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -6,6 +6,7 @@ public abstract class ProgramNode
|
||||
public ProgramNode nextNode;
|
||||
public ProgramNode NegativeNode;
|
||||
public string DisplayText;
|
||||
public string TooltipText;
|
||||
public string lastExecutionMessage;
|
||||
|
||||
public abstract NodeResult Execute(Robot robot, double delta);
|
||||
|
||||
@@ -5,6 +5,7 @@ public class SacrificeNode : ProgramNode
|
||||
public SacrificeNode()
|
||||
{
|
||||
DisplayText = "Sacrifice";
|
||||
TooltipText = "Sacrifices the robot on its current tile to turn that tile's resource into an endless resource.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -3,6 +3,7 @@ public class StartNode : ProgramNode
|
||||
public StartNode()
|
||||
{
|
||||
DisplayText = "Start";
|
||||
TooltipText = "Marks where the robot begins executing the script. Every valid script needs exactly one Start node.";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -9,6 +9,7 @@ public class WhileNode : ProgramNode
|
||||
public WhileNode()
|
||||
{
|
||||
DisplayText = "While";
|
||||
TooltipText = "Repeats the connected branch (Top slot) while the configured inventory condition remains true, then continues through the negative output. (Bottom slot)";
|
||||
}
|
||||
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
|
||||
@@ -618,15 +618,21 @@ public partial class TestRunner : Node
|
||||
|
||||
Dictionary<ProgramNode, PackedScene> dslNodes = ResourceLoader.LoadDSLNodes();
|
||||
bool hasStartNode = false;
|
||||
bool allNodesHaveTooltips = true;
|
||||
foreach (ProgramNode node in dslNodes.Keys)
|
||||
{
|
||||
if (node is StartNode)
|
||||
{
|
||||
hasStartNode = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (node.TooltipText == null || node.TooltipText.Length <= 0)
|
||||
{
|
||||
allNodesHaveTooltips = false;
|
||||
}
|
||||
}
|
||||
AssertTrue(hasStartNode, "start node prefab loaded");
|
||||
AssertTrue(allNodesHaveTooltips, "dsl nodes have tooltip text");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public partial class CodingWindow : PanelContainer
|
||||
};
|
||||
nodeListButton.MouseEntered += () =>
|
||||
{
|
||||
nodeTooltip.ShowTooltip(nodeTemplate.DisplayText, nodeTemplate.DisplayText, nodeListButton);
|
||||
nodeTooltip.ShowTooltip(nodeTemplate.DisplayText, nodeTemplate.TooltipText, nodeListButton);
|
||||
};
|
||||
nodeListButton.MouseExited += () =>
|
||||
{
|
||||
|
||||
@@ -10,10 +10,10 @@ public partial class NodeTooltip : PanelContainer
|
||||
|
||||
public void ShowTooltip(string titleText, string descriptionText, Button button)
|
||||
{
|
||||
Show();
|
||||
title.Text = titleText;
|
||||
image.Texture = ResourceLoader.LoadDSLTooltip(titleText);
|
||||
description.Text = descriptionText;
|
||||
Show();
|
||||
Position = button.GlobalPosition - spacing - new Vector2(Size.X, Size.Y/2);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public partial class TutorialBubble : PanelContainer
|
||||
"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.",
|
||||
"The necessary resources will be auto-consumed during your time here.",
|
||||
"For energy: steam, battery v1 and battery v2. For thirst: water. For food: mushrooms.",
|
||||
"For energy: coal, steam, battery v1 and battery v2. For thirst: water. For food: mushrooms.",
|
||||
"Try to keep a stock of those items to avoid dying in this ruin.",
|
||||
"Open the robot panel (Default: [R]) to inspect your robots. A robot can overheat, lose maintenance and slow down if ignored.",
|
||||
"An overheated robot has to cool down for a while and cannot execute scripts.",
|
||||
|
||||
Reference in New Issue
Block a user