Beispiel #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();
        }
Beispiel #2
0
        protected void GenerateCustomProperties(DialogueNode node)
        {
            foreach (CustomPropertiesSlot slot in EditorCore.CustomPropertiesSlots)
            {
                if (slot.AddOnEveryNode && slot.CustomPropertiesType != null && slot.DialogueNodeType.IsAssignableFrom(node.GetType()))
                {
                    bool hasProperties = false;

                    foreach (NodeCustomProperties properties in node.CustomProperties)
                    {
                        hasProperties |= slot.CustomPropertiesType.Equals(properties.GetType());
                    }

                    if (!hasProperties)
                    {
                        NodeCustomProperties newProperties = Activator.CreateInstance(slot.CustomPropertiesType) as NodeCustomProperties;
                        node.CustomProperties.Add(newProperties);
                    }
                }
            }
        }