Exemplo n.º 1
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, 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;
        }