コード例 #1
0
        //刷新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;
        }
コード例 #2
0
 //刷新角色原型数据状态
 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;
 }
コード例 #3
0
 private void button10_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < ListBox_AnteType.Items.Count; i++)
     {
         ListBox_AnteType.SetItemChecked(i, true);
     }
     updateAnimsItems();
 }
コード例 #4
0
        //刷新数据显示========================================================
        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();
        }