//刷新Anims数据状态
        public void updateAnimsItems()
        {
            noEvent = true;

            for (int i = 0; i < listBox_Anims.Items.Count; i++)
            {
                if (listBox_Anims.GetItemCheckState(i) == CheckState.Checked)
                {
                    continue;
                }
                MActorsManager actorsManager = srcForm.form_MAnimation.form_MActorList.actorsManager;
                MActor         actor         = actorsManager.getActorBySumID(i);
                bool           used          = false;
                for (int j = 0; j < ListBox_AnteType.Items.Count; j++)
                {
                    if (ListBox_AnteType.GetItemCheckState(j) == CheckState.Checked)
                    {
                        Antetype anteType = (Antetype)srcForm.mapsManager.antetypesManager.getAntetypeBySumID(j);
                        if (anteType.Actor != null && anteType.Actor.Equals(actor))
                        {
                            used = true;
                            break;
                        }
                    }
                }
                if (used)
                {
                    listBox_Anims.SetItemCheckState(i, CheckState.Checked);
                }
            }
            noEvent = false;
        }
 //刷新角色原型数据状态
 public void updateAnteTypeItems()
 {
     noEvent = true;
     for (int j = 0; j < ListBox_AnteType.Items.Count; j++)
     {
         Antetype anteType = (Antetype)srcForm.mapsManager.antetypesManager.getAntetypeBySumID(j);
         if (ListBox_AnteType.GetItemCheckState(j) == CheckState.Checked)
         {
             continue;
         }
         for (int k = 0; k < listBox_Maps.Items.Count; k++)
         {
             MapElement map = srcForm.mapsManager.getElement(k);
             if (listBox_Maps.GetItemCheckState(k) == CheckState.Unchecked)
             {
                 continue;
             }
             if (map.usingAnteType(anteType))
             {
                 ListBox_AnteType.SetItemCheckState(j, CheckState.Checked);
                 break;
             }
         }
     }
     noEvent = false;
 }
 public static bool configAntetype(Antetype antetypeT)
 {
     antetype = antetypeT;
     Form_ConfigAnteType dialog = new Form_ConfigAnteType();
     dialog.ShowDialog();
     antetype = null;
     return true;
 }
        //private void button_AT_Add_Click(object sender, EventArgs e)
        //{
        //    addElement_AT();
        //}
        //自动增加角色原型
        private void button_AT_import_Click(object sender, EventArgs e)
        {
            //if (mapsManager.antetypesManager.getElementCount() > 0)
            //{
            //    MessageBox.Show("已经存在角色原型,不能自动增加", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    return;
            //}

            List<ActorAndFolder> arrayList = Form_CreateAnteType.getActors(mapsManager.antetypesManager.actorsManager);
            if (arrayList.Count == 0)
            {
                return;
            }
            for (int i = 0; i < arrayList.Count; i++)
            {
                ActorAndFolder doubleName = arrayList[i];
                Antetype antetype = new Antetype(currentAntetypeFolder, arrayList[i].actor);
                currentAntetypeFolder.Add(antetype);
            }
            updateContainer_AT_Buffer();
        }
 private void setCurrentAT(Antetype antetype)
 {
     this.currentAntetype = antetype;
     if (currentAntetype != null)
     {
         String name = currentAntetype.name;
         lable_AT.Text = name;
         showFunction("角色原型ID:" + antetype.GetID() + ",引用自:" + (antetype.Actor != null ? (antetype.Actor.name + ",ID:" + antetype.Actor.GetID()) : "空") + ",被使用次数:" + currentAntetype.getUsedTime());
     }
     else
     {
         lable_AT.Text = "";
         showFunction("");
     }
 }
Exemple #6
0
 public MovieClip(Antetype antetypeT, int xT, int yT)
 {
     antetype = antetypeT;
     setPos(xT, yT);
 }
 public MovieClip(Antetype antetypeT, int xT, int yT)
 {
     antetype = antetypeT;
     setPos(xT, yT);
 }
        //刷新数据显示========================================================
        public void updateRes()
        {
            //载入地图
            listBox_Maps.Items.Clear();
            for (int i = 0; i < srcForm.mapsManager.getElementCount(); i++)
            {
                String text = "" + srcForm.mapsManager.getElement(i).getName();
                listBox_Maps.Items.Add(text);
            }
            listBox_Maps.Refresh();
            //载入角色原型
            ListBox_AnteType.Items.Clear();
            for (int i = 0; i < srcForm.mapsManager.antetypesManager.Count(); i++)
            {
                AntetypeFolder folder = srcForm.mapsManager.antetypesManager[i];
                for (int j = 0; j < folder.Count(); j++)
                {
                    Antetype anteType = folder[i];
                    String   text     = "";
                    if (anteType != null)
                    {
                        text = "[" + anteType.getFolderName() + "]" + anteType.name;
                        if (anteType.Actor == null)
                        {
                            MessageBox.Show("角色原型“" + anteType.name + "”指向的角色为空!", "警告", MessageBoxButtons.OK);
                        }
                    }
                    else
                    {
                        text = "错误的角色原型";
                    }
                    ListBox_AnteType.Items.Add(text);
                }
            }
            ListBox_AnteType.Refresh();
            //载入动画
            listBox_Anims.Items.Clear();
            MActorsManager actorsManager = srcForm.form_MAnimation.form_MActorList.actorsManager;

            for (int i = 0; i < actorsManager.Count(); i++)
            {
                MActorFolder folder = actorsManager[i];
                for (int j = 0; j < folder.Count(); j++)
                {
                    MActor actor = folder[j];
                    String text  = folder.name + "_" + actor.name;
                    listBox_Anims.Items.Add(text);
                }
            }
            listBox_Anims.Refresh();
            //载入触发器
            listBox_Triggers.Items.Clear();
            listBox_Triggers.Refresh();
            //载入属性表
            listBox_Props.Items.Clear();
            for (int i = 0; i < srcForm.propertyTypesManager.getElementCount(); i++)
            {
                String text = "" + ((PropertyTypeElement)srcForm.propertyTypesManager.getElement(i)).name;
                listBox_Props.Items.Add(text);
            }
            listBox_Props.Refresh();
        }