Beispiel #1
0
        //更新MActorFolder级别的节点
        public void updateTreeNode_ActorFolder()
        {
            if (currentActorFolder == null)
            {
                return;
            }
            int      folderID        = currentActorFolder.GetID();
            TreeNode actorFolderNode = treeView_Animation.Nodes[folderID];

            actorFolderNode.Nodes.Clear();
            for (int i = 0; i < currentActorFolder.Count(); i++)
            {
                TreeNode actorNode = new TreeNode();
                MActor   actor     = currentActorFolder[i];
                actorNode.Text               = actor.name;
                actorNode.ImageIndex         = 1;
                actorNode.SelectedImageIndex = 1;
                for (int k = 0; k < actor.Count(); k++)
                {
                    TreeNode actionNode = new TreeNode();
                    MAction  action     = actor[k];
                    actionNode.Text               = action.name;
                    actionNode.ImageIndex         = 2;
                    actionNode.SelectedImageIndex = 2;
                    actorNode.Nodes.Add(actionNode);
                }
                actorFolderNode.Nodes.Add(actorNode);
            }
        }
Beispiel #2
0
 //在treeView中初始化当前结构
 public void updateTreeView_Animation()
 {
     treeView_Animation.Nodes.Clear();
     for (int i = 0; i < actorsManager.Count(); i++)
     {
         TreeNode     actorFolderNode = new TreeNode();
         MActorFolder actorFolder     = actorsManager[i];
         currentActorFolder                 = actorFolder;
         actorFolderNode.Text               = actorFolder.name;
         actorFolderNode.ImageIndex         = 0;
         actorFolderNode.SelectedImageIndex = 0;
         for (int j = 0; j < actorFolder.Count(); j++)
         {
             TreeNode actorNode = new TreeNode();
             MActor   actor     = actorFolder[j];
             currentActorElement          = actor;
             actorNode.Text               = actor.name;
             actorNode.ImageIndex         = 1;
             actorNode.SelectedImageIndex = 1;
             for (int k = 0; k < actor.Count(); k++)
             {
                 TreeNode actionNode = new TreeNode();
                 MAction  action     = actor[k];
                 currentActionElement          = action;
                 actionNode.Text               = action.name;
                 actionNode.ImageIndex         = 2;
                 actionNode.SelectedImageIndex = 2;
                 actorNode.Nodes.Add(actionNode);
             }
             actorFolderNode.Nodes.Add(actorNode);
         }
         treeView_Animation.Nodes.Add(actorFolderNode);
     }
     treeView_Animation.ExpandAll();
 }
        private void showParamsList()
        {
            noEvent = true;
            if (element != null)
            {
                //AT_Name
                if (element.antetype != null)
                {
                    textBox_ATName.Text = element.antetype.name + "[" + element.antetype.getFolderName() + "]";
                }
                //NpcID
                numericUpDown_ID.Value = element.NpcID;
                comboBox_ActionID.Items.Clear();
                comboBox_ActionID.SelectedIndex = -1;
                numericUpDown_FrameID.Value     = 0;
                if (element.antetype != null && element.antetype.Actor != null)
                {
                    //actionID
                    MActor actor = element.antetype.Actor;
                    for (int i = 0; i < actor.Count(); i++)
                    {
                        comboBox_ActionID.Items.Add(actor[i].name);
                    }
                    if (element.actionID >= 0 && element.actionID < comboBox_ActionID.Items.Count)
                    {
                        comboBox_ActionID.SelectedIndex = element.actionID;
                    }
                    else
                    {
                        comboBox_ActionID.SelectedIndex = -1;
                    }
                    if (element.startTime >= numericUpDown_FrameID.Minimum && element.startTime <= numericUpDown_FrameID.Maximum)
                    {
                        numericUpDown_FrameID.Value = element.startTime;
                    }
                }
                //isActive
                checkBox_active.Checked = element.isVisible;
                //keyValue
                panel_SelfLeft.Controls.Clear();
                panel_SelfRight.Controls.Clear();
                for (int i = 0; i < element.keyValueManager.Count(); i++)
                {
                    TileObjKeyValue item        = element.keyValueManager[i];
                    TextBoxEX       textBoxLeft = createNewTextBox(item.strKey);
                    panel_SelfLeft.Controls.Add(textBoxLeft);

                    TextBoxEX textBoxRight = createNewTextBox(item.strValue);
                    panel_SelfRight.Controls.Add(textBoxRight);
                }
            }
            noEvent = false;
        }
Beispiel #4
0
        //动作列表部分=====================================================================================================
        //(动作列表)加入新单元
        public void addActionElement()
        {
            if (currentActorFolder == null || currentActorElement == null)
            {
                return;
            }
            String name = "动作" + currentActorElement.Count();
            SmallDialog_WordEdit txtDialog = new SmallDialog_WordEdit("新建动作", name);

            txtDialog.ShowDialog();
            name = txtDialog.getValue();
            form_MA.historyManager.ReadyHistory(HistoryType.Actor);
            MAction element = new MAction(currentActorElement);

            element.name = name;
            currentActorElement.Add(element);
            currentActionElement = element;
            updateTreeNode_Actor();
            TreeNode actionTreeNode = treeView_Animation.Nodes[currentActorFolder.GetID()].Nodes[currentActorElement.GetID()].Nodes[currentActionElement.GetID()];

            treeView_Animation.SelectedNode = actionTreeNode;
            form_MA.historyManager.AddHistory(HistoryType.Actor);
        }
Beispiel #5
0
        //更新Actor级别的节点
        public void updateTreeNode_Actor()
        {
            if (currentActorFolder == null || currentActorElement == null)
            {
                return;
            }
            TreeNode actorNode = treeView_Animation.Nodes[currentActorFolder.GetID()].Nodes[currentActorFolder.GetSonID(currentActorElement)];
            MActor   actor     = currentActorElement;

            actorNode.Nodes.Clear();
            for (int k = 0; k < actor.Count(); k++)
            {
                TreeNode actionNode = new TreeNode();
                MAction  action     = actor[k];
                actionNode.Text               = action.name;
                actionNode.ImageIndex         = 2;
                actionNode.SelectedImageIndex = 2;
                actorNode.Nodes.Add(actionNode);
            }
        }