(WIP) switched from previous DSL System (UI order based) to a new DSL System (node connection based)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
|
||||
public partial class ForNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new ForNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string amountExecuted = parts[1].Replace("AmountExecuted:", "").Trim();
|
||||
ForNode forNode = display.node as ForNode;
|
||||
if (forNode != null)
|
||||
{
|
||||
forNode.amountExecuted = int.Parse(amountExecuted);
|
||||
}
|
||||
string amountString = parts[2].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
ForNode forNode = node as ForNode;
|
||||
if (forNode == null) return;
|
||||
|
||||
forNode.amount = (int)GetValueContainer().GetNode<SpinBox>("./Amount").Value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user