示例#1
0
    public void createQuote()
    {
        List <Control> prevSelected = new List <Control>(selectedNodes);

        deselectAll();
        prevSelected.ForEach(
            c =>
        {
            DialoguePath path = (c is NodeDialogue)
                    ? path    = ((NodeDialogue)c).path
                    : path    = ((Node)c).data.path;
            int index         = (c is NodeQuote)
                    ? ((NodeQuote)c).quote.Index
                    : -1;
            NodeQuote node = Managers.Node.createNodeQuote(path, index);
            node.Editing   = true;
            select(node, true);
        }
            );
        if (prevSelected.Count == 0)
        {
            //If nothing is selected, make a new dialogue path
            //(which will auto-create a new quote too)
            createDialoguePath();
        }
    }
示例#2
0
    public void receiveInfoDump(DialoguePath path, string[] textArray)
    {
        NodeQuote lastNode = Managers.Node.createNodes(path, textArray);

        lastNode.Editing = true;
        select(lastNode);
    }
示例#3
0
    public DialoguePath createDialoguePath()
    {
        //Create a new quote with no path,
        //which will auto-create a new path with a new quote
        NodeQuote node = Managers.Node.createNodeQuote();

        node.Editing = true;
        select(node);
        return(node.quote.path);
    }
示例#4
0
    public void enterPressed()
    {
        NodeQuote activeNode = (NodeQuote)selectedNodes.FirstOrDefault(
            c => c is NodeQuote
            );

        if (activeNode != null)
        {
            activeNode.Editing = false;
            //If it's the last in the path,
            DialoguePath path = activeNode.quote.path;
            if (activeNode.quote.Index == path.quotes.Count - 1)
            {
                //Add new node at the end
                NodeQuote newNode = Managers.Node.createNodeQuote(path);
                newNode.Editing = true;
                select(newNode);
            }
        }
    }
示例#5
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     Managers.File.saveFile();
     Managers.File.savePropertiesBeforeClose();
     NodeQuote.disposeDialogs();
 }