Esempio n. 1
0
        /// <summary>
        /// Edits the selected story node
        /// </summary>
        private void editStoryNode(object sender, EventArgs e)
            {
            StoryNode sNode = (StoryNode)sNodeList.SelectedItem;

            int index = sNodeList.SelectedIndex;

            // I get all story nodes before the selected one
            LinkedList<StoryNode> prevStoryNodes = getPrev(sNodeList.Items, sNode);

            StoryNodeForm form = new StoryNodeForm(sNode, giver, villian, extra, props, prevStoryNodes, triggers, module);
            StoryNode tempStoryNode;
            if (form.ShowDialog() == DialogResult.OK)
                {
           //     int indexOfOldsNode = sNodeList.Items.IndexOf(sNode);
                debug("The number is: " + index);   
                tempStoryNode = form.getStoryNode();
                sNodeList.Items[index] = tempStoryNode;
                }
            }
Esempio n. 2
0
        /// <summary>
        /// Creates a new story node
        /// </summary>
        private void newStoryNode(object sender, EventArgs e)
            {
            LinkedList<StoryNode> prevStoryNodes = getPrev(sNodeList.Items, null);

            StoryNode tempSNode;
            StoryNodeForm form = new StoryNodeForm(giver, villian, extra, props, prevStoryNodes, triggers, module);
            if (form.ShowDialog() == DialogResult.OK)
                {
                tempSNode = form.getStoryNode();
                sNodeList.Items.Add(tempSNode);

                if (tempSNode.convHappens != StoryNode.convType.None)
                    {
                    addTriggerStoryNode(tempSNode);
                    }
                }

            }