Finished new node approach
This commit is contained in:
@@ -25,13 +25,17 @@ public partial class NodeDisplay : GraphNode
|
||||
EmitSignal(SignalName.OnDeleteNode);
|
||||
}
|
||||
|
||||
public static NodeDisplay Load(string content, Dictionary<ProgramNode, PackedScene> DSLNodes)
|
||||
public static NodeDisplay Load(
|
||||
string nodeName,
|
||||
string content,
|
||||
Dictionary<ProgramNode, PackedScene> DSLNodes
|
||||
)
|
||||
{
|
||||
string nodeSanitized = content.Replace("\r\n", "").Trim();
|
||||
if (nodeSanitized.Length <= 0) return null;
|
||||
string normalizedNodeName = nodeName.Trim().ToLower();
|
||||
|
||||
string nodeName = nodeSanitized.Split(",")[0].Replace("Name: ", "").ToLower();
|
||||
PackedScene prefab = GetPrefab(nodeName, DSLNodes);
|
||||
PackedScene prefab = GetPrefab(normalizedNodeName, DSLNodes);
|
||||
if (prefab == null) return null;
|
||||
|
||||
NodeDisplay result = prefab.Instantiate<NodeDisplay>();
|
||||
|
||||
Reference in New Issue
Block a user