Beispiel #1
0
        //--------------------------------------------------------------------------------------------------------------
        // Class Methods

        public DialogAbout()
        {
            InitializeComponent();

            labelVersion.Text        += EditorVersion.GetVersion();
            labelVersionProject.Text += EditorCore.VersionProject;

            labelVersionNet.Text += System.Environment.Version.ToString();
        }
Beispiel #2
0
        public void PreSave(Project project)
        {
            //Prepare File
            VersionProject = EditorCore.VersionProject;
            VersionEditor  = EditorVersion.GetVersion();

            if (Package == null)
            {
                EditorCore.LogError("Saving a Dialogue without Package (forcing default) : " + GetName(), this);
                Package = project.GetDefaultPackage();
            }

            if (Package != null)
            {
                PackageName = Package.Name;
            }

            //Sanitize texts
            //dialogue.Comment = EditorCore.SanitizeText(dialogue.Comment);

            //Prepare nodes links
            RootNodeID = (RootNode != null) ? RootNode.ID : DialogueNode.ID_NULL;

            foreach (DialogueNode node in ListNodes)
            {
                node.NextID = (node.Next != null) ? node.Next.ID : DialogueNode.ID_NULL;

                if (node is DialogueNodeSentence)
                {
                    //Generate ID
                    DialogueNodeSentence nodeSentence = node as DialogueNodeSentence;
                    nodeSentence.VoicingID = EditorHelper.GetPrettyNodeVoicingID(this, nodeSentence);

                    //Sanitize texts
                    nodeSentence.Sentence = EditorHelper.SanitizeText(nodeSentence.Sentence);
                    //nodeSentence.Comment = EditorHelper.SanitizeText(nodeSentence.Comment);
                }
                else if (node is DialogueNodeChoice)
                {
                    DialogueNodeChoice nodeChoice = node as DialogueNodeChoice;

                    //Sanitize texts
                    nodeChoice.Choice = EditorHelper.SanitizeText(nodeChoice.Choice);

                    nodeChoice.RepliesIDs.Clear();
                    foreach (DialogueNodeReply nodeReply in nodeChoice.Replies)
                    {
                        //Sanitize texts
                        nodeReply.Reply = EditorHelper.SanitizeText(nodeReply.Reply);

                        nodeChoice.RepliesIDs.Add(nodeReply.ID);
                    }
                }
                else if (node is DialogueNodeGoto)
                {
                    DialogueNodeGoto nodeGoto = node as DialogueNodeGoto;
                    nodeGoto.GotoID = (nodeGoto.Goto != null) ? nodeGoto.Goto.ID : DialogueNode.ID_NULL;
                }
                else if (node is DialogueNodeBranch)
                {
                    DialogueNodeBranch nodeBranch = node as DialogueNodeBranch;
                    nodeBranch.BranchID = (nodeBranch.Branch != null) ? nodeBranch.Branch.ID : DialogueNode.ID_NULL;
                }
            }
        }
Beispiel #3
0
 public void PreSave()
 {
     VersionProject = EditorCore.VersionProject;
     VersionEditor  = EditorVersion.GetVersion();
 }