using Godot; public partial class MoveNodeDisplay : NodeDisplay { protected override ProgramNode CreateProgramNode() { return new MoveNode(); } protected override void LoadContent(NodeDisplay display, string content) { HBoxContainer valueContainer = GetValueContainer(display); string[] parts = content.Split(","); string positionValues = parts[1].Replace("Position:", "").Replace("(", "").Replace(")", "").Trim(); int posX = int.Parse(positionValues.Split("|")[0]); int posY = int.Parse(positionValues.Split("|")[1]); int posZ = int.Parse(positionValues.Split("|")[2]); valueContainer.GetNode("./CoordinateX").Value = posX; valueContainer.GetNode("./CoordinateY").Value = posY; valueContainer.GetNode("./CoordinateZ").Value = posZ; MoveNode moveNode = display.node as MoveNode; if (moveNode != null) { moveNode.targetPosition = new Vector3I(posX, posY, posZ); } } public override void ReadParameters() { MoveNode moveNode = node as MoveNode; if (moveNode == null) return; HBoxContainer valueContainer = GetValueContainer(); int posX = (int)valueContainer.GetNode("./CoordinateX").Value; int posY = (int)valueContainer.GetNode("./CoordinateY").Value; int posZ = (int)valueContainer.GetNode("./CoordinateZ").Value; moveNode.targetPosition = new Vector3I(posX, posY, posZ); } public override void SetupDisplay() { HBoxContainer valueContainer = GetValueContainer(); valueContainer.GetNode("./CoordinateX").MaxValue = GameData.layerSize; valueContainer.GetNode("./CoordinateY").MaxValue = GameData.ruinSize; valueContainer.GetNode("./CoordinateZ").MaxValue = GameData.layerSize; } }