示例#1
0
        public void ShowDialogueNodeProperties(DocumentDialogue document, TreeNode treeNode, DialogueNode dialogueNode)
        {
            //SetDoubleBuffered(LayoutPanel);

            WIN32.StopRedraw(this);
            //SuspendLayout();

            Clear();

            foreach (CustomPropertiesSlot slot in EditorCore.CustomPropertiesSlots)
            {
                if (slot.FormType != null && slot.DialogueNodeType.IsAssignableFrom(dialogueNode.GetType()))
                {
                    IFormProperties form = Activator.CreateInstance(slot.FormType) as IFormProperties;
                    form.Init(document, treeNode, dialogueNode);
                    layoutPanel.Controls.Add(form as UserControl);
                }
            }

            layoutPanel.VerticalScroll.Value = 0;

            //ResumeLayout();

            WIN32.ResumeRedraw(this);
            this.Refresh();
        }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNodeGoto inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            ready = true;
        }
示例#3
0
 public bool CloseDocumentDialogue(DocumentDialogue document, bool force)
 {
     if (document != null)
     {
         document.ForceClose = force;
         document.Close();
         return(true);
     }
     return(false);
 }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNode inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode as DialogueNodeChoice;

            textBoxWorkstring.Text = dialogueNode.Choice;

            ready = true;
        }
示例#5
0
        public void Init(DocumentDialogue indocument, TreeNode inTreeNode, DialogueNode inDialogueNode)
        {
            document     = indocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode as DialogueNodeRoot;
            dialogue     = document.Dialogue;

            textBoxVoiceBank.Text = dialogue.VoiceBank;
            textBoxContext.Text   = dialogue.Context;
            textBoxComment.Text   = dialogue.Comment;

            comboBoxPackage.DataSource    = new BindingSource(ResourcesHandler.Project.ListPackages, null);
            comboBoxPackage.DisplayMember = "Name";
            comboBoxPackage.SelectedItem  = dialogue.Package;

            comboBoxSceneType.DataSource    = new BindingSource(EditorCore.CustomLists["SceneTypes"], null);
            comboBoxSceneType.ValueMember   = "Key";
            comboBoxSceneType.DisplayMember = "Value";
            comboBoxSceneType.SelectedValue = dialogue.SceneType;

            foreach (var actorID in dialogue.ListAdditionalActors)
            {
                Actor actor = ResourcesHandler.Project.GetActorFromID(actorID);
                if (actor != null)
                {
                    additionalActors.Add(actor.Name);
                }
                else
                {
                    additionalActors.Add("<Undefined>");
                }
            }

            listBoxAdditionalActors.DataSource = new BindingSource(additionalActors, null);

            var actors = new Dictionary <string, string>();

            actors.Add("", "");
            foreach (Actor actor in ResourcesHandler.Project.ListActors)
            {
                actors.Add(actor.ID, actor.Name);
            }

            comboBoxAdditionalActors.DataSource    = new BindingSource(actors, null);
            comboBoxAdditionalActors.ValueMember   = "Key";
            comboBoxAdditionalActors.DisplayMember = "Value";

            RefreshAdditionalActorView();

            ready = true;
        }
示例#6
0
        //--------------------------------------------------------------------------------------------------------------
        // Events from other forms

        public bool OnDocumentDialogueClosed(DocumentDialogue document, bool force)
        {
            if (force || !ResourcesHandler.IsDirty(document.Dialogue) || ShowPopupCloseDocuments(null, new List<Dialogue>() { document.Dialogue }))
            {
                if (document == dockPanel.ActiveContent)
                {
                    if (EditorCore.Properties != null)
                        EditorCore.Properties.Clear();
                }

                lastClosedDialogue = document.Dialogue.GetName();
                documentDialogues.Remove(document);
                return true;
            }
            return false;
        }
示例#7
0
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNode inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode as DialogueNodeReply;

            Project project = ResourcesHandler.Project;

            textBoxWorkstring.Text = dialogueNode.Reply;
            RefreshWordCount();

            //AutoComplete
            autoComplete            = new AutoComplete(this, new BindingSource(project.ListConstants, null));
            autoComplete.OnValidate = ValidateAutoComplete;
            autoComplete.OnClose    = CloseAutoComplete;
            autoComplete.OnDrawItem = DrawItemAutoComplete;

            ready = true;
        }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNodeChoice inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            textBoxWorkstring.Text = dialogueNode.Choice;
            textBoxTimer.Text      = dialogueNode.Timer.ToString();

            //TODO: Unreal Specific
            if (EditorCore.CustomLists.ContainsKey("DialogueChoices"))
            {
                comboBoxBlueprint.DataSource    = new BindingSource(EditorCore.CustomLists["DialogueChoices"], null);
                comboBoxBlueprint.ValueMember   = "Key";
                comboBoxBlueprint.DisplayMember = "Value";
                comboBoxBlueprint.SelectedValue = dialogueNode.Blueprint;
            }

            Project project = ResourcesHandler.Project;

            //Actors
            if (ResourcesHandler.Project.ListActors.Count > 0)
            {
                var actors = new Dictionary <string, string>();
                actors.Add("", "");

                foreach (Actor actor in project.ListActors)
                {
                    actors.Add(actor.ID, actor.Name);
                }

                comboBoxCharacter.DataSource    = new BindingSource(actors, null);
                comboBoxCharacter.ValueMember   = "Key";
                comboBoxCharacter.DisplayMember = "Value";
                comboBoxCharacter.SelectedValue = dialogueNode.CharacterID;
            }

            checkBoxTimer.Checked = dialogueNode.HideTimer;

            ready = true;
        }
示例#9
0
        public void OpenDocumentDialogue(Dialogue dialogue, int node)
        {
            foreach (DocumentDialogue document in documentDialogues)
            {
                if (document.Dialogue == dialogue)
                {
                    document.Activate();   //OnActiveDocumentChanged will handle the refresh

                    document.SelectNode(node);
                    return;
                }
            }

            DocumentDialogue newDocument = new DocumentDialogue(dialogue);
            newDocument.Show(dockPanel, DockState.Document);
            documentDialogues.Add(newDocument);

            newDocument.SelectNode(node);

            EditorHelper.CheckDialogueErrors(dialogue);
        }
示例#10
0
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNodeChoice inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            textBoxWorkstring.Text = dialogueNode.Choice;
            textBoxTimer.Text      = dialogueNode.Timer.ToString();

            //TODO: Unreal Specific
            if (EditorCore.CustomLists.ContainsKey("DialogueChoices"))
            {
                comboBoxBlueprint.DataSource    = new BindingSource(EditorCore.CustomLists["DialogueChoices"], null);
                comboBoxBlueprint.ValueMember   = "Key";
                comboBoxBlueprint.DisplayMember = "Value";
                comboBoxBlueprint.SelectedValue = dialogueNode.Blueprint;
            }

            checkBoxTimer.Checked = dialogueNode.HideTimer;

            ready = true;
        }
示例#11
0
        //--------------------------------------------------------------------------------------------------------------
        // Class Methods

        public WindowViewer(Dialogue dialogue, DialogueNode nodeFrom, DocumentDialogue document)
        {
            InitializeComponent();

            comboBoxOptionConditions.DataSource = new BindingSource(Enum.GetValues(typeof(EOptionConditions)), null);

            groupBoxGoto.Location = groupBoxChoice.Location;

            fontReplies              = listBoxReplies.Font;
            listBoxReplies.DrawMode  = DrawMode.OwnerDrawFixed;
            listBoxReplies.DrawItem += OnListBoxReplies_DrawItem;

            fontConditions              = listBoxConditions.Font;
            listBoxConditions.DrawMode  = DrawMode.OwnerDrawFixed;
            listBoxConditions.DrawItem += OnListBoxConditions_DrawItem;

            checkBoxOptionConstants.Checked = true; // EditorCore.Settings.UseConstants;

            currentDocument = document;
            currentDialogue = dialogue;

            Play(nodeFrom);
        }
示例#12
0
        public void ShowDialogueNodeProperties(DocumentDialogue document, TreeNode treeNode, DialogueNode dialogueNode)
        {
            //SetDoubleBuffered(LayoutPanel);

            WIN32.StopRedraw(this);
            //SuspendLayout();

            Clear();

            if (dialogueNode is DialogueNodeRoot)
            {
                DialogueNodeRoot castNode = dialogueNode as DialogueNodeRoot;

                FormPropertiesRoot properties = new FormPropertiesRoot();
                properties.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }
            else if (dialogueNode is DialogueNodeSentence)
            {
                DialogueNodeSentence castNode = dialogueNode as DialogueNodeSentence;

                FormPropertiesSentence properties = new FormPropertiesSentence();
                properties.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }
            else if (dialogueNode is DialogueNodeChoice)
            {
                DialogueNodeChoice castNode = dialogueNode as DialogueNodeChoice;

                FormPropertiesChoice properties = new FormPropertiesChoice();
                properties.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }
            else if (dialogueNode is DialogueNodeReply)
            {
                DialogueNodeReply castNode = dialogueNode as DialogueNodeReply;

                FormPropertiesReply properties = new FormPropertiesReply();
                properties.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }
            else if (dialogueNode is DialogueNodeGoto)
            {
                DialogueNodeGoto castNode = dialogueNode as DialogueNodeGoto;

                //FormPropertiesGoto properties = new FormPropertiesGoto();
                //properties.Init(document, treeNode, castNode);
                //layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }
            else if (dialogueNode is DialogueNodeBranch)
            {
                DialogueNodeBranch castNode = dialogueNode as DialogueNodeBranch;

                FormPropertiesBranch properties = new FormPropertiesBranch();
                properties.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(properties);

                FormPropertiesCommon propertiesCommon = new FormPropertiesCommon();
                propertiesCommon.Init(document, treeNode, castNode);
                layoutPanel.Controls.Add(propertiesCommon);
            }

            layoutPanel.VerticalScroll.Value = 0;

            //ResumeLayout();

            WIN32.ResumeRedraw(this);
            this.Refresh();
        }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNodeSentence inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            Project project = ResourcesHandler.Project;

            //Text
            textBoxWorkstring.Text = dialogueNode.Sentence;
            RefreshWordCount();

            //Actors
            if (ResourcesHandler.Project.ListActors.Count > 0)
            {
                var actors = new Dictionary <string, string>();
                actors.Add("", "");
                foreach (Actor actor in project.ListActors)
                {
                    actors.Add(actor.ID, actor.Name);
                }

                comboBoxSpeaker.DataSource    = new BindingSource(actors, null);
                comboBoxSpeaker.ValueMember   = "Key";
                comboBoxSpeaker.DisplayMember = "Value";

                comboBoxListener.DataSource    = new BindingSource(actors, null);
                comboBoxListener.ValueMember   = "Key";
                comboBoxListener.DisplayMember = "Value";

                comboBoxSpeaker.SelectedValue  = dialogueNode.SpeakerID;
                comboBoxListener.SelectedValue = dialogueNode.ListenerID;
            }

            //Anims
            RefreshAnimSetList(comboBoxAnimsetSpeaker, dialogueNode.SpeakerID);
            RefreshAnimSetList(comboBoxAnimsetListener, dialogueNode.ListenerID);

            comboBoxAnimsetSpeaker.SelectedItem  = dialogueNode.SpeakerAnimset;
            comboBoxAnimsetListener.SelectedItem = dialogueNode.ListenerAnimset;

            RefreshAnimList(comboBoxAnimsetSpeaker, comboBoxAnimSpeaker);
            RefreshAnimList(comboBoxAnimsetListener, comboBoxAnimListener);

            comboBoxAnimSpeaker.SelectedValue  = dialogueNode.SpeakerAnim;
            comboBoxAnimListener.SelectedValue = dialogueNode.ListenerAnim;

            //Voicing
            checkBoxHideSubtitle.Checked = dialogueNode.HideSubtitle;
            textBoxComment.Text          = dialogueNode.Comment;
            textBoxContext.Text          = dialogueNode.Context;

            //Delays
            textBoxPreDelay.Text  = dialogueNode.PreDelay.ToString();
            textBoxPostDelay.Text = dialogueNode.PostDelay.ToString();

            comboBoxIntensity.DataSource    = new BindingSource(EditorCore.CustomLists["Intensities"], null);
            comboBoxIntensity.ValueMember   = "Key";
            comboBoxIntensity.DisplayMember = "Value";
            comboBoxIntensity.SelectedValue = dialogueNode.VoiceIntensity;

            //Portraits
            RefreshPortraits();

            //AutoComplete
            autoComplete            = new AutoComplete(this, new BindingSource(project.ListConstants, null));
            autoComplete.OnValidate = ValidateAutoComplete;
            autoComplete.OnClose    = CloseAutoComplete;
            autoComplete.OnDrawItem = DrawItemAutoComplete;

            comboBoxCamera.DataSource    = new BindingSource(EditorCore.CustomLists["Cameras"], null);
            comboBoxCamera.ValueMember   = "Key";
            comboBoxCamera.DisplayMember = "Value";
            comboBoxCamera.SelectedValue = dialogueNode.Camera;
            textBoxCameraBlendTime.Text  = dialogueNode.CameraBlendTime.ToString();

            //Ready !
            ready = true;
        }
        public void Init(DocumentDialogue inDocument, TreeNode inTreeNode, DialogueNode inDialogueNode)
        {
            document     = inDocument;
            treeNode     = inTreeNode;
            dialogueNode = inDialogueNode;

            treeAttributes.ImageList = EditorCore.DefaultImageList;

            //Roots
            treeNodeRootConditions = treeAttributes.Nodes.Add("Root", "Conditions");
            treeNodeRootConditions.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootConditions, ENodeIcon.ListRootConditions);

            treeNodeRootActions = treeAttributes.Nodes.Add("Root", "Actions");
            treeNodeRootActions.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootActions, ENodeIcon.ListRootActions);

            treeNodeRootFlags = treeAttributes.Nodes.Add("Root", "Flags");
            treeNodeRootFlags.ContextMenuStrip = menuAttributes;
            EditorHelper.SetNodeIcon(treeNodeRootFlags, ENodeIcon.ListRootFlags);

            //Sync Conditions
            foreach (NodeCondition condition in dialogueNode.Conditions)
            {
                AddTreeNodeCondition(condition, treeNodeRootConditions);
            }

            //Sync Actions
            foreach (NodeAction action in dialogueNode.Actions)
            {
                AddTreeNodeAction(action);
            }

            //Sync Flags
            foreach (NodeFlag flag in dialogueNode.Flags)
            {
                AddTreeNodeFlag(flag);
            }

            //Fill Menu Conditions
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = "AND";
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(typeof(NodeConditionAnd)) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = "OR";
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(typeof(NodeConditionOr)) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            menuItemAddCondition.DropDownItems.Add(new ToolStripSeparator());

            foreach (ConditionSlot slot in EditorCore.ConditionSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeCondition(Activator.CreateInstance(slot.ConditionType) as NodeCondition);
                };
                menuItemAddCondition.DropDownItems.Add(menuItem);
            }

            //Fill Menu Actions
            foreach (ActionSlot slot in EditorCore.ActionSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeAction(Activator.CreateInstance(slot.ActionType) as NodeAction);
                };
                menuItemAddAction.DropDownItems.Add(menuItem);
            }

            //Fill Menu Flags
            foreach (FlagSlot slot in EditorCore.FlagSlots)
            {
                ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem();
                menuItem.Text   = slot.Text;
                menuItem.Click += delegate
                {
                    AddNodeFlag(Activator.CreateInstance(slot.FlagType) as NodeFlag);
                };
                menuItemAddFlag.DropDownItems.Add(menuItem);
            }

            ready = true;
        }