コード例 #1
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
        private void button4_Click(object sender, EventArgs e)
        {
            //load_Item_List
            string allItemDefines    = CItemCtrl.load_Item_Defines("");
            var    allItemDefinesArr = allItemDefines.Split(';');

            this.listView1.Items.Clear();
            foreach (var _def in allItemDefinesArr)
            {
                var _nameWithIdarr = _def.Split(',');
                if (_nameWithIdarr.Length > 1)
                {
                    string       _name = _nameWithIdarr[0];
                    string       _id   = _nameWithIdarr[1];
                    ListViewItem lvi   = new ListViewItem();

                    //lvi.ImageIndex = i;     //通过与imageList绑定,显示imageList中第i项图标

                    lvi.Text = _id;

                    lvi.SubItems.Add(_name);

                    this.listView1.Items.Add(lvi);
                }
            }
            this.listView1.EndUpdate();  //结束数据处理,UI界面一次性绘制
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedIndices != null && listView1.SelectedIndices.Count > 0)
            {
                string name = this.listView1.FocusedItem.SubItems[1].Text;

                bool done = false;
                CItemCtrl.item_attr attr = CItemCtrl.Get_Attr_ByName(name, out done);
                //MessageBox.Show(attr.code);
                Fill_Item_Attr(attr);
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
        private void button5_Click(object sender, EventArgs e)
        {
            ListViewItem foundItem = this.listView1.FindItemWithText(this.txt_ItemSearch.Text, true, cur_select_index + 1);    //参数1:要查找的文本;参数2:是否子项也要查找;参数3:开始查找位置

            if (foundItem != null)
            {
                this.listView1.TopItem = foundItem;  //定位到该项
                cur_select_index       = foundItem.Index;

                //foundItem.Selected = true; ;
                string name = foundItem.SubItems[1].Text;

                bool done = false;
                CItemCtrl.item_attr attr = CItemCtrl.Get_Attr_ByName(name, out done);
                //MessageBox.Show(attr.code);
                Fill_Item_Attr(attr);
            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
        private string Build_Item_Attr()
        {
            //define
            string new_itemH = "#define " + txt_itemCode.Text + "\t";
            //get last id
            string curId = "";

            int n = int.Parse(CItemCtrl.m_lastId);

            n++;
            curId      = n.ToString();
            new_itemH += curId;
            MessageBox.Show(new_itemH);

            //txt
            string newItemData = "";


            //name
            string newItemName = "item = ";

            n            = CItemCtrl.Get_Item_LastNameId();
            n           += 2;
            curId        = n.ToString();
            newItemName += curId + ",";
            newItemName += txt_itemNameStr.Text;

            CItemCtrl.Set_Item_LastNameId(n);

            //name
            string newItemHelper = "";

            n            = CItemCtrl.Get_Item_LastHelpId();
            n           += 2;
            curId        = n.ToString();
            newItemName += curId + ",";
            newItemName += txt_itemNameStr.Text;

            CItemCtrl.Set_Item_LastHelpId(n);

            return("");
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
        private void Fill_Item_Attr(CItemCtrl.item_attr attr)
        {
            //基本屬性
            txt_itemCode.Text = attr.code;
            txt_itemName.Text = attr.name;
            string nameStr = CItemCtrl.Get_Item_NameStr(attr.name);

            txt_itemNameStr.Text = nameStr;
            txt_itemHelp.Text    = attr.help_string;
            string itemHelpStr = CItemCtrl.Get_Item_itemHelpStr(attr.help_string);

            txt_itemHelpStr.Text    = itemHelpStr;
            txt_itemLight.Text      = attr.light;
            txt_itemWeight.Text     = attr.weight;
            txt_itemCost.Text       = attr.cost;
            txt_itemSell.Text       = attr.sell;
            txt_itemCost_level.Text = attr.cost_level;
            txt_itemIcon.Text       = attr.icon;

            txt_itemType.Text = attr.type;
            Fill_Item_Types(attr.type, attr.wait_type, attr.super_type);

            txt_itemType2.Text = attr.type2;
            Fill_Item_Types2(attr.type2);

            //增加属性
            txt_itemAddattack_range.Text       = attr.attack_range;
            txt_itemAddeffect_range.Text       = attr.effect_range;
            txt_itemAddadd_attack_power.Text   = attr.add_attack_power;
            txt_itemAddattack_speed.Text       = attr.attack_speed;
            txt_itemAddadd_weapon_hit.Text     = attr.add_weapon_hit;
            txt_itemAddadd_attr_mind.Text      = attr.add_attr_mind;
            txt_itemAddadd_magic_power.Text    = attr.add_magic_power;
            txt_itemAddadd_attr_con.Text       = attr.add_attr_con;
            txt_itemAddadd_attackx2_ratio.Text = attr.add_attackx2_ratio;
            txt_itemAddadd_attr_int.Text       = attr.add_attr_int;
            txt_itemAddadd_attr_str.Text       = attr.add_attr_str;
            txt_itemAddadd_attr_dex.Text       = attr.add_attr_dex;
            txt_itemAddadd_hp.Text             = attr.add_hp;
            txt_itemAddadd_mp.Text             = attr.add_mp;
            txt_itemAddadd_attr_leader.Text    = attr.add_attr_leader;
            txt_itemAddadd_defense.Text        = attr.add_defense;
            txt_itemAddadd_weapon_misshit.Text = attr.add_weapon_misshit;
            txt_itemAddmove.Text        = attr.move;
            txt_itemAddadd_st.Text      = attr.add_st;
            txt_itemAddadd_loyalty.Text = attr.add_loyalty;
            //属性攻
            Fill_Item_AtkSkillAttr(attr.eq_magic_attack_type);
            //属性防
            Fill_Item_ReSkillAttr(attr.eq_magic_resist);
            //function
            Fill_Item_FuncAnti(attr.function, attr.anti_status_ratio);

            //limit
            txt_itemlimit_level.Text  = attr.limit_level;
            txt_itemlimit_str.Text    = attr.limit_str;
            txt_itemlimit_mind.Text   = attr.limit_mind;
            txt_itemlimit_dex.Text    = attr.limit_dex;
            txt_itemlimit_int.Text    = attr.limit_int;
            txt_itemlimit_leader.Text = attr.limit_leader;

            rdb_sexMALE.Checked   = false;
            rdb_sexFEMALE.Checked = false;
            if (attr.limit_sex != null || attr.limit_sex != "")
            {
                if (attr.limit_sex == "sexMALE")
                {
                    rdb_sexMALE.Checked   = true;
                    rdb_sexFEMALE.Checked = false;
                }
                else if (attr.limit_sex == "sexFEMALE")
                {
                    rdb_sexMALE.Checked   = false;
                    rdb_sexFEMALE.Checked = true;
                }
                else
                {
                    rdb_sexMALE.Checked   = false;
                    rdb_sexFEMALE.Checked = false;
                }
            }

            ckb_jobASSASSIN.Checked = false;
            ckb_jobENGINEER.Checked = false;
            ckb_jobWIZARD.Checked   = false;
            ckb_jobADVISOR.Checked  = false;
            ckb_jobLEADER.Checked   = false;
            ckb_jobWARLORD.Checked  = false;
            if (attr.limit_job != null && attr.limit_job != "")
            {
                var _limit_job = attr.limit_job.Split(',');
                foreach (var _job in _limit_job)
                {
                    if (_job == "jobWARLORD")
                    {
                        ckb_jobWARLORD.Checked = true;
                    }
                    else if (_job == "jobLEADER")
                    {
                        ckb_jobLEADER.Checked = true;
                    }
                    else if (_job == "jobADVISOR")
                    {
                        ckb_jobADVISOR.Checked = true;
                    }
                    else if (_job == "jobWIZARD")
                    {
                        ckb_jobWIZARD.Checked = true;
                    }
                    else if (_job == "jobENGINEER")
                    {
                        ckb_jobENGINEER.Checked = true;
                    }
                    else if (_job == "jobASSASSIN")
                    {
                        ckb_jobASSASSIN.Checked = true;
                    }
                }
            }
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
 private void button2_Click(object sender, EventArgs e)
 {
     CItemCtrl.AnalyzerItemAttr(txt_MainFolder.Text);
     MessageBox.Show("Done");
 }
コード例 #7
0
ファイル: Form1.cs プロジェクト: napatkung/qysg
 private void load_Data_All()
 {
     //load_item_data
     CItemCtrl.load_Item_Data("asd");
 }