Пример #1
0
        public void bindAll()
        {
            this.gundamFile = new GundamFile();
            tslblFile.Text  = gundamFile.FileName;

            head = ZipHelper.ZipDeCompressToDic(GGCRStaticConfig.PATH + "\\images\\schips.txd");

            cboE1.DataSource    = GGCRUtil.ListGundamEarth();
            cboE1.DisplayMember = "Value";
            cboE1.ValueMember   = "Key";
            cboE2.DataSource    = GGCRUtil.ListGundamEarth();
            cboE2.DisplayMember = "Value";
            cboE2.ValueMember   = "Key";
            cboE3.DataSource    = GGCRUtil.ListGundamEarth();
            cboE3.DisplayMember = "Value";
            cboE3.ValueMember   = "Key";
            cboE4.DataSource    = GGCRUtil.ListGundamEarth();
            cboE4.DisplayMember = "Value";
            cboE4.ValueMember   = "Key";
            cboE5.DataSource    = GGCRUtil.ListGundamEarth();
            cboE5.DisplayMember = "Value";
            cboE5.ValueMember   = "Key";

            cboSize.DataSource    = GGCRUtil.ListGundamSize();
            cboSize.DisplayMember = "Value";
            cboSize.ValueMember   = "Key";

            cboEarthSize.DataSource    = GGCRUtil.ListEarthSize();
            cboEarthSize.DisplayMember = "Value";
            cboEarthSize.ValueMember   = "Key";

            cboSkill1.DataSource = GGCRUtil.ListGundamAbility();
            cboSkill2.DataSource = GGCRUtil.ListGundamAbility();
            cboSkill3.DataSource = GGCRUtil.ListGundamAbility();
            cboSkill4.DataSource = GGCRUtil.ListGundamAbility();
            cboSkill5.DataSource = GGCRUtil.ListGundamAbility();

            cboSkill1.DisplayMember = "Value";
            cboSkill2.DisplayMember = "Value";
            cboSkill3.DisplayMember = "Value";
            cboSkill4.DisplayMember = "Value";
            cboSkill5.DisplayMember = "Value";

            cboSkill1.ValueMember = "Key";
            cboSkill2.ValueMember = "Key";
            cboSkill3.ValueMember = "Key";
            cboSkill4.ValueMember = "Key";
            cboSkill5.ValueMember = "Key";
        }
Пример #2
0
        private void btnExportAll_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            //dialog.RestoreDirectory = true;
            dialog.Filter   = "文本文件|*.txt";
            dialog.FileName = "全部机体数据";

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                using (StreamWriter sw = new StreamWriter(dialog.FileName, false, Encoding.UTF8))
                {
                    sw.Write("地址\t系列\t机体名\tHP\tEN\t攻击\t防御\t机动\t移动\tSize\t占地图面积\t适性宇");
                    sw.Write("\t适性空\t适性地\t适性水上\t适性水中\t能力1\t能力2\t能力3\t能力4\t能力5\t");
                    sw.WriteLine();

                    foreach (GundamInfo gundam in gundamFile.ListMachines())
                    {
                        sw.Write(gundam.Address + "\t");
                        sw.Write(gundam.GroupName + "\t");
                        sw.Write(gundam.UnitName + "\t");
                        sw.Write(gundam.HP + "\t");
                        sw.Write(gundam.EN + "\t");
                        sw.Write(gundam.ACT + "\t");
                        sw.Write(gundam.DEF + "\t");
                        sw.Write(gundam.SPD + "\t");
                        sw.Write(gundam.Move + "\t");
                        sw.Write(GGCRUtil.Transform(cboSize.DataSource as List <KeyValuePair <string, string> >, gundam.Size.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboEarthSize.DataSource as List <KeyValuePair <string, string> >, gundam.EarchSize.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboE1.DataSource as List <KeyValuePair <string, string> >, gundam.Earch[0].ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboE1.DataSource as List <KeyValuePair <string, string> >, gundam.Earch[1].ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboE1.DataSource as List <KeyValuePair <string, string> >, gundam.Earch[2].ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboE1.DataSource as List <KeyValuePair <string, string> >, gundam.Earch[3].ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboE1.DataSource as List <KeyValuePair <string, string> >, gundam.Earch[4].ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboSkill1.DataSource as List <KeyValuePair <string, string> >, gundam.Skill1.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboSkill1.DataSource as List <KeyValuePair <string, string> >, gundam.Skill2.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboSkill1.DataSource as List <KeyValuePair <string, string> >, gundam.Skill3.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboSkill1.DataSource as List <KeyValuePair <string, string> >, gundam.Skill4.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboSkill1.DataSource as List <KeyValuePair <string, string> >, gundam.Skill5.ToString()) + "\t");

                        sw.WriteLine();
                    }
                }
            }
        }
Пример #3
0
        private void btnExportAll_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            //dialog.RestoreDirectory = true;
            dialog.Filter   = "文本文件|*.txt";
            dialog.FileName = "全部人物数据";

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                using (StreamWriter sw = new StreamWriter(dialog.FileName, false, Encoding.UTF8))
                {
                    sw.Write("地址\t系列\t姓名\t射击\t格斗\t守备\t反应\t觉醒\t经验值\t指挥\t辅佐\t通讯\t操舵\t维修\t魅力");
                    sw.Write("\t成长\t技能1\t技能2\t技能3\t招聘可能");
                    sw.WriteLine();

                    foreach (MasterInfo master in masterFile.ListMasters())
                    {
                        sw.Write(master.Address + "\t");
                        sw.Write(master.GroupName + "\t");
                        sw.Write(master.UnitName + "\t");
                        sw.Write(master.SheJi + "\t");
                        sw.Write(master.GeDou + "\t");
                        sw.Write(master.ShouBei + "\t");
                        sw.Write(master.FanYin + "\t");
                        sw.Write(master.JueXin + "\t");
                        sw.Write(master.JinYan + "\t");
                        sw.Write(master.ZhiHui + "\t");
                        sw.Write(master.FuZuo + "\t");
                        sw.Write(master.TongXun + "\t");
                        sw.Write(master.CaoDuo + "\t");
                        sw.Write(master.WeiXiu + "\t");
                        sw.Write(master.MeiLi + "\t");
                        sw.Write(GGCRUtil.Transform(cboGrown.DataSource as List <KeyValuePair <string, string> >, master.ChengZhang.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboGuYou1.DataSource as List <KeyValuePair <string, string> >, master.GuYou1.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboGuYou2.DataSource as List <KeyValuePair <string, string> >, master.GuYou1.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboGuYou3.DataSource as List <KeyValuePair <string, string> >, master.GuYou1.ToString()) + "\t");
                        sw.Write(GGCRUtil.Transform(cboLast4.DataSource as List <KeyValuePair <string, string> >, master.Last4.ToString()) + "\t");

                        sw.WriteLine();
                    }
                }
            }
        }
Пример #4
0
        private void bindAll()
        {
            #region 绑定元素

            cboAE1.DataSource = GGCRUtil.ListActEarch();
            cboAE2.DataSource = GGCRUtil.ListActEarch();
            cboAE3.DataSource = GGCRUtil.ListActEarch();
            cboAE4.DataSource = GGCRUtil.ListActEarch();
            cboAE5.DataSource = GGCRUtil.ListActEarch();

            cboAE1.DisplayMember = "Value";
            cboAE2.DisplayMember = "Value";
            cboAE3.DisplayMember = "Value";
            cboAE4.DisplayMember = "Value";
            cboAE5.DisplayMember = "Value";

            cboAE1.ValueMember = "Key";
            cboAE2.ValueMember = "Key";
            cboAE3.ValueMember = "Key";
            cboAE4.ValueMember = "Key";
            cboAE5.ValueMember = "Key";

            cboMpLimit.DataSource    = GGCRUtil.ListWeaponMPLimit();
            cboMpLimit.DisplayMember = "Value";
            cboMpLimit.ValueMember   = "Key";

            List <KeyValuePair <string, string> > specList = gundamFile.ListWeaponSpec();
            specList.Insert(0, new KeyValuePair <string, string>("0", "无"));

            cboSpec.DataSource    = specList;
            cboSpec.DisplayMember = "Value";
            cboSpec.ValueMember   = "Key";

            cboRange.DataSource    = GGCRUtil.ListWeaponRange();
            cboRange.DisplayMember = "Value";
            cboRange.ValueMember   = "Key";

            cboWeaponType.DataSource    = GGCRUtil.ListWeaponType();
            cboWeaponType.DisplayMember = "Value";
            cboWeaponType.ValueMember   = "Key";
            #endregion
        }
Пример #5
0
        private void LoadData(GundamInfo gundam)
        {
            if (gundam != null)
            {
                string name = gundam.PicName;

                txtPic.Text = name;

                if (head.ContainsKey(name))
                {
                    DDSImage image = new DDSImage(head[name]);
                    pic1.Image = Image.FromHbitmap(image.images[0].GetHbitmap());
                }
                else
                {
                    if (pic1.Image != null)
                    {
                        pic1.Image.Dispose();
                        pic1.Image = null;
                    }
                }

                txtUUID.Text = gundam.UUID;

                txtGroup.Text = gundam.GroupName;
                txtPrice.Text = gundam.Price.ToString();

                txtName.Text        = gundam.UnitName;
                txtAddress.Text     = gundam.Address;
                txtHP.Text          = gundam.HP.ToString();
                txtEN.Text          = gundam.EN.ToString();
                txtAct.Text         = gundam.ACT.ToString();
                txtDef.Text         = gundam.DEF.ToString();
                txtSpd.Text         = gundam.SPD.ToString();
                txtMove.Text        = gundam.Move.ToString();
                txtWeapon1ID.Text   = gundam.WeaponId.ToString();
                txtWeaponCount.Text = gundam.WeaponCount.ToString();
                txtFirstMap.Text    = gundam.WeaponMapID.ToString();
                txtMapCount.Text    = gundam.WeaponMapCount.ToString();

                cboEarthSize.SelectedValue = gundam.EarchSize.ToString();
                if (cboEarthSize.SelectedValue == null)
                {
                    GGCRUtil.AddEarthSize(gundam.EarchSize, "未知" + gundam.EarchSize.ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }

                cboSize.SelectedValue = gundam.Size.ToString();
                if (cboSize.SelectedValue == null)
                {
                    GGCRUtil.AddGundamSize(gundam.Size, "未知" + gundam.Size);
                    bindAll();
                    LoadData(gundam);
                    return;
                }

                string shiyin = gundam.Earch;

                cboE1.SelectedValue = shiyin[0].ToString();
                if (cboE1.SelectedValue == null)
                {
                    GGCRUtil.AddGundamSize(short.Parse(shiyin[0].ToString()), "未知" + shiyin[0].ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboE2.SelectedValue = shiyin[1].ToString();
                if (cboE2.SelectedValue == null)
                {
                    GGCRUtil.AddGundamEarth(short.Parse(shiyin[1].ToString()), "未知" + shiyin[1].ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboE3.SelectedValue = shiyin[2].ToString();
                if (cboE3.SelectedValue == null)
                {
                    GGCRUtil.AddGundamEarth(short.Parse(shiyin[2].ToString()), "未知" + shiyin[2].ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboE4.SelectedValue = shiyin[3].ToString();
                if (cboE4.SelectedValue == null)
                {
                    GGCRUtil.AddGundamEarth(short.Parse(shiyin[3].ToString()), "未知" + shiyin[3].ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboE5.SelectedValue = shiyin[4].ToString();
                if (cboE5.SelectedValue == null)
                {
                    GGCRUtil.AddGundamEarth(short.Parse(shiyin[4].ToString()), "未知" + shiyin[4].ToString());
                    bindAll();
                    LoadData(gundam);
                    return;
                }

                cboSkill1.SelectedValue = gundam.Skill1.ToString();
                if (cboSkill1.SelectedValue == null)
                {
                    GGCRUtil.AddGundamAbility(gundam.Skill1, "未知" + gundam.Skill1);
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboSkill2.SelectedValue = gundam.Skill2.ToString();
                if (cboSkill2.SelectedValue == null)
                {
                    GGCRUtil.AddGundamAbility(gundam.Skill2, "未知" + gundam.Skill2);
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboSkill3.SelectedValue = gundam.Skill3.ToString();
                if (cboSkill3.SelectedValue == null)
                {
                    GGCRUtil.AddGundamAbility(gundam.Skill3, "未知" + gundam.Skill3);
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboSkill4.SelectedValue = gundam.Skill4.ToString();
                if (cboSkill4.SelectedValue == null)
                {
                    GGCRUtil.AddGundamAbility(gundam.Skill4, "未知" + gundam.Skill4);
                    bindAll();
                    LoadData(gundam);
                    return;
                }
                cboSkill5.SelectedValue = gundam.Skill5.ToString();
                if (cboSkill5.SelectedValue == null)
                {
                    GGCRUtil.AddGundamAbility(gundam.Skill5, "未知" + gundam.Skill5);
                    bindAll();
                    LoadData(gundam);
                    return;
                }

                btnSave.Enabled = true;
            }
            else
            {
                txtUUID.Text = null;

                txtPrice.Text   = null;
                txtGroup.Text   = null;
                txtName.Text    = null;
                txtAddress.Text = null;
                txtHP.Text      = null;
                txtEN.Text      = null;
                txtAct.Text     = null;
                txtDef.Text     = null;
                txtSpd.Text     = null;
                txtMove.Text    = null;

                cboSize.SelectedValue = "-1";

                cboEarthSize.SelectedValue = "-1";

                cboE1.SelectedValue = "-1";
                cboE2.SelectedValue = "-1";
                cboE3.SelectedValue = "-1";
                cboE4.SelectedValue = "-1";
                cboE5.SelectedValue = "-1";

                cboSkill1.SelectedValue = "-1";
                cboSkill2.SelectedValue = "-1";
                cboSkill3.SelectedValue = "-1";
                cboSkill4.SelectedValue = "-1";
                cboSkill5.SelectedValue = "-1";

                txtWeapon1ID.Text   = null;
                txtWeaponCount.Text = null;

                btnSave.Enabled = false;
            }
        }
Пример #6
0
        private void FrmEditGundam_Load(object sender, EventArgs e)
        {
            List <short> limit = null;

            if (gundamInfo != null)
            {
                limit = new List <short>();
                short wid = gundamInfo.WeaponId;
                if (wid >= 0 && gundamInfo.WeaponCount > 0)
                {
                    for (short i = 0; i < gundamInfo.WeaponCount; i++)
                    {
                        limit.Add((short)(wid + i));
                    }
                }
                short map = gundamInfo.WeaponMapID;
                if (map >= 0 && gundamInfo.WeaponMapCount > 0)
                {
                    for (short i = 0; i < gundamInfo.WeaponMapCount; i++)
                    {
                        limit.Add((short)(map + i + gundamFile.WeaponNormalCount));
                    }
                }
            }

            bindAll();

            weapons = new List <WeaponInfo>();

            List <WeaponInfo> allWeapons = gundamFile.ListWeapons();

            List <KeyValuePair <string, string> > ranges = GGCRUtil.ListWeaponRange();

            Dictionary <short, WeaponInfo> noranges = new Dictionary <short, WeaponInfo>();

            foreach (WeaponInfo w in allWeapons)
            {
                if (limit == null || limit.Contains(w.ID))
                {
                    weapons.Add(w);
                }

                bool find = false;
                foreach (KeyValuePair <string, string> rngs in ranges)
                {
                    if (rngs.Key == w.Range.ToString())
                    {
                        find = true;
                        break;
                    }
                }
                if (!find)
                {
                    if (!noranges.ContainsKey(w.Range))
                    {
                        noranges.Add(w.Range, w);
                    }
                }
            }

            foreach (KeyValuePair <short, WeaponInfo> kv in noranges)
            {
                GGCRUtil.AddWeaponRange(kv.Key, kv.Key + " " + (kv.Value.IsMap ? ("MAP " + kv.Value.UnitName) : ("普通 " + kv.Value.UnitName)));
            }

            bindAll();

            lsGundam.DataSource    = weapons;
            lsGundam.DisplayMember = "UnitName";
            lsGundam.ValueMember   = "Address";
        }
Пример #7
0
        private void LoadData(WeaponInfo weapon)
        {
            if (weapon != null)
            {
                txtId.Text = weapon.ID.ToString();

                txtName.Text    = weapon.UnitName;
                txtAddress.Text = weapon.Address;
                txtPower.Text   = weapon.POWER.ToString();
                txtEN.Text      = weapon.EN.ToString();
                txtMP.Text      = weapon.MP.ToString();
                txtMoveAct.Text = weapon.MoveACT.ToString();

                string useEarth = weapon.UseEarth;
                chkUse1.Checked = useEarth[4] == '1';
                chkUse2.Checked = useEarth[3] == '1';
                chkUse3.Checked = useEarth[2] == '1';
                chkUse4.Checked = useEarth[1] == '1';
                chkUse5.Checked = useEarth[0] == '1';

                string actEarch = weapon.ActEarth;

                cboAE1.SelectedValue = "" + actEarch[8] + actEarch[9];
                cboAE2.SelectedValue = "" + actEarch[6] + actEarch[7];
                cboAE3.SelectedValue = "" + actEarch[4] + actEarch[5];
                cboAE4.SelectedValue = "" + actEarch[2] + actEarch[3];
                cboAE5.SelectedValue = "" + actEarch[0] + actEarch[1];

                cboMpLimit.SelectedValue = weapon.MPLimit.ToString();
                if (cboMpLimit.SelectedValue == null)
                {
                    GGCRUtil.AddWeaponMPLimit(weapon.MPLimit, "未知" + weapon.MPLimit);
                    bindAll();
                    LoadData(weapon);
                    return;
                }


                if (weapon is WeaponNormalInfo)
                {
                    panNormal.Enabled = true;
                    panMap.Enabled    = false;

                    cboProp.DataSource    = this.gundamFile.ListWeaponProp();
                    cboProp.DisplayMember = "Value";
                    cboProp.ValueMember   = "Key";
                    cboIco.DataSource     = this.gundamFile.ListWeaponProp();
                    cboIco.DisplayMember  = "Value";
                    cboIco.ValueMember    = "Key";

                    txtHitRate.Text  = (weapon as WeaponNormalInfo).HitRate.ToString();
                    txtCT.Text       = (weapon as WeaponNormalInfo).CT.ToString();
                    txtHitCount.Text = (weapon as WeaponNormalInfo).HitCount.ToString();

                    txtMapTurn.Text     = null;
                    txtAttMaxCount.Text = null;

                    cboWeaponType.SelectedValue = -1;
                }
                else
                {
                    panNormal.Enabled = false;
                    panMap.Enabled    = true;

                    cboProp.DataSource    = this.gundamFile.ListWeaponProp();
                    cboProp.DisplayMember = "Value";
                    cboProp.ValueMember   = "Key";
                    cboIco.DataSource     = this.gundamFile.ListWeaponProp();
                    cboIco.DisplayMember  = "Value";
                    cboIco.ValueMember    = "Key";

                    txtHitRate.Text  = null;
                    txtCT.Text       = null;
                    txtHitCount.Text = null;

                    txtMapTurn.Text     = (weapon as WeaponMapInfo).MapTurn.ToString();
                    txtAttMaxCount.Text = (weapon as WeaponMapInfo).AttMaxCount.ToString();

                    cboWeaponType.SelectedValue = (weapon as WeaponMapInfo).WeaponType.ToString();
                    if (cboWeaponType.SelectedValue == null)
                    {
                        GGCRUtil.AddWeaponType((weapon as WeaponMapInfo).WeaponType, "未知" + (weapon as WeaponMapInfo).WeaponType);
                        bindAll();
                        LoadData(weapon);
                        return;
                    }
                }

                cboProp.SelectedValue = weapon.PROPER.ToString();
                cboIco.SelectedValue  = weapon.ICO.ToString();

                cboSpec.SelectedValue = weapon.Spec.ToString();

                cboRange.SelectedValue = weapon.Range.ToString();
                if (cboRange.SelectedValue == null)
                {
                    GGCRUtil.AddWeaponRange(weapon.Range, "未知" + weapon.Range);
                    bindAll();
                    LoadData(weapon);
                    return;
                }

                btnSave.Enabled = true;
            }
            else
            {
                txtId.Text = null;

                txtName.Text    = null;
                txtAddress.Text = null;
                txtPower.Text   = null;
                txtEN.Text      = null;
                txtMP.Text      = null;
                txtMoveAct.Text = null;

                txtHitRate.Text     = null;
                txtCT.Text          = null;
                txtHitCount.Text    = null;
                txtMapTurn.Text     = null;
                txtAttMaxCount.Text = null;

                chkUse1.Checked = false;
                chkUse2.Checked = false;
                chkUse3.Checked = false;
                chkUse4.Checked = false;
                chkUse5.Checked = false;

                cboAE1.SelectedValue = -1;
                cboAE2.SelectedValue = -1;
                cboAE3.SelectedValue = -1;
                cboAE4.SelectedValue = -1;
                cboAE5.SelectedValue = -1;

                cboProp.SelectedValue       = -1;
                cboIco.SelectedValue        = -1;
                cboSpec.SelectedValue       = -1;
                cboWeaponType.SelectedValue = -1;

                btnSave.Enabled = false;
            }
        }
Пример #8
0
        private void LoadData(MasterInfo master)
        {
            if (master != null)
            {
                string name = master.PicName;
                if (head.ContainsKey(name))
                {
                    DDSImage image = new DDSImage(head[name]);
                    pic1.Image = Image.FromHbitmap(image.images[0].GetHbitmap());
                }
                else
                {
                    if (pic1.Image != null)
                    {
                        pic1.Image.Dispose();
                        pic1.Image = null;
                    }
                }

                txtPic.Text     = name;
                txtId.Text      = master.ID.ToString();
                txtUnKnow.Text  = master.Unknow.ToString();
                txtName.Text    = master.UnitName;
                txtAddress.Text = master.Address;
                txtSheJi.Text   = master.SheJi.ToString();
                txtGeDou.Text   = master.GeDou.ToString();
                txtShouBei.Text = master.ShouBei.ToString();
                txtFanYin.Text  = master.FanYin.ToString();
                txtJueXin.Text  = master.JueXin.ToString();
                txtZhiHui.Text  = master.ZhiHui.ToString();
                txtFuZuo.Text   = master.FuZuo.ToString();
                txtTongXun.Text = master.TongXun.ToString();
                txtCaoDuo.Text  = master.CaoDuo.ToString();
                txtWeiXiu.Text  = master.WeiXiu.ToString();
                txtMeiLi.Text   = master.MeiLi.ToString();
                txtJinYan.Text  = master.JinYan.ToString();

                cboGrown.SelectedValue = master.ChengZhang.ToString();
                if (cboGrown.SelectedValue == null)
                {
                    GGCRUtil.AddMasterGrown(master.ChengZhang, "未知" + master.ChengZhang);
                    bindAll();
                    LoadData(master);
                    return;
                }

                cboGuYou1.SelectedValue = master.GuYou1.ToString();
                if (cboGuYou1.SelectedValue == null)
                {
                    GGCRUtil.AddPeopleSkill(master.GuYou1, "未知" + master.GuYou1);
                    bindAll();
                    LoadData(master);
                    return;
                }
                cboGuYou2.SelectedValue = master.GuYou2.ToString();
                if (cboGuYou2.SelectedValue == null)
                {
                    GGCRUtil.AddPeopleSkill(master.GuYou2, "未知" + master.GuYou2);
                    bindAll();
                    LoadData(master);
                    return;
                }
                cboGuYou3.SelectedValue = master.GuYou3.ToString();
                if (cboGuYou3.SelectedValue == null)
                {
                    GGCRUtil.AddPeopleSkill(master.GuYou3, "未知" + master.GuYou3);
                    bindAll();
                    LoadData(master);
                    return;
                }

                cboLast4.SelectedValue = master.Last4.ToString();
                if (cboLast4.SelectedValue == null)
                {
                    GGCRUtil.AddMasterZhaoPin(master.Last4, "未知" + master.Last4);
                    bindAll();
                    LoadData(master);
                    return;
                }

                btnSave.Enabled = true;
            }
            else
            {
                txtId.Text      = null;
                txtUnKnow.Text  = null;
                txtName.Text    = null;
                txtSheJi.Text   = null;
                txtGeDou.Text   = null;
                txtShouBei.Text = null;
                txtFanYin.Text  = null;
                txtJueXin.Text  = null;
                txtZhiHui.Text  = null;
                txtFuZuo.Text   = null;
                txtTongXun.Text = null;
                txtCaoDuo.Text  = null;
                txtWeiXiu.Text  = null;
                txtMeiLi.Text   = null;
                txtJinYan.Text  = null;

                cboGrown.SelectedValue  = -1;
                cboGuYou1.SelectedValue = -1;
                cboGuYou2.SelectedValue = -1;
                cboGuYou3.SelectedValue = -1;

                cboLast4.SelectedValue = -1;

                btnSave.Enabled = false;
            }
        }
Пример #9
0
        private void loadData()
        {
            this.gundamFile = new GundamFile();
            stFile.Text     = this.gundamFile.FileName;


            List <MachineConvertInfo> allConverts = gundamFile.ListConvert();

            this.actions = GGCRUtil.ListConvertAction();

            foreach (MachineConvertInfo c in allConverts)
            {
                bool find = false;
                foreach (KeyValuePair <string, string> kv in actions)
                {
                    if (kv.Key == c.Action.ToString())
                    {
                        find = true;
                        break;
                    }
                }
                if (!find)
                {
                    GGCRUtil.AddConvertAction(c.Action, "未知" + c.Action);
                    this.actions = GGCRUtil.ListConvertAction();
                }
            }
            cboAction.DataSource    = actions;
            cboAction.DisplayMember = "Value";
            cboAction.ValueMember   = "Key";

            this.gundams = gundamFile.ListMachines();

            foreach (GundamInfo g in gundams)
            {
                if (g.UUID == this.fromUuid)
                {
                    this.gundam = g;
                    break;
                }
            }

            fromSource.DataSource = this.gundams;

            toSource.DataSource = this.gundams;

            cboTo.DataSource    = toSource.DataSource;
            cboTo.ValueMember   = "UUID";
            cboTo.DisplayMember = "UnitName";

            cboFrom.DataSource    = fromSource;
            cboFrom.ValueMember   = "UUID";
            cboFrom.DisplayMember = "UnitName";


            if (this.gundam != null)
            {
                this.converts = new List <MachineConvertInfo>();

                foreach (MachineConvertInfo c in allConverts)
                {
                    if (c.From == gundam.UUID || c.To == gundam.UUID)
                    {
                        this.converts.Add(c);
                    }
                }
            }
            else
            {
                this.converts = allConverts;
            }

            lsMain.DataSource = this.converts;
        }