示例#1
0
            public AddRemoveConversationNodeTool(int nodeType, ConversationNodeDataControl parent, int index)
            {
                this.parent = parent;

                ConversationNode child = null;

                if (nodeType == DIALOG_NODE)
                {
                    child = new DialogueConversationNode();
                }
                else if (nodeType == OPTION_NODE)
                {
                    child = new OptionConversationNode();
                }

                if (child != null)
                {
                    var parentRect = parent.getEditorRect();
                    child.setEditorX(parentRect.x + parentRect.width + 35);
                    child.setEditorY(parentRect.y);

                    this.childDataControl = parent.conversation.getNodeDataControl(child);
                    this.index            = index; // Insert at last
                    this.add = true;
                }
            }
示例#2
0
            public InsertNodeTool(ConversationDataControl content, ConversationNodeDataControl parent, int nodeType, int index)
            {
                this.content    = content;
                this.isRootNode = parent == null;
                this.parent     = isRootNode ? content.getRootNode() : parent;
                ConversationNode node = null;

                switch (nodeType)
                {
                case DIALOG_NODE: node = new DialogueConversationNode(); break;

                case OPTION_NODE: node = new OptionConversationNode(); break;
                }


                this.index = index;
                var parentRect = isRootNode ? new RectInt(0, 25, 0, 0) : parent.getEditorRect();
                var childRect  = isRootNode ? content.getRootNode().getEditorRect() : parent.getChilds()[index].getEditorRect();

                var center = (parentRect.center + childRect.center) / 2f;

                node.setEditorX((int)(center.x - node.getEditorWidth() / 2f));
                node.setEditorY((int)(center.y - node.getEditorHeight() / 2f));

                this.newNode  = ConversationNodeDataControlFactory.Instance.CreateDataControlFor(content, node);
                this.subTools = CreateTools();
            }
示例#3
0
 public ChangeNodeRectTool(ConversationNodeDataControl nodeDataControl, RectInt newPos)
 {
     this.nodeDataControl = nodeDataControl;
     this.oldPos          = nodeDataControl.getEditorRect();
     this.newPos          = newPos;
 }