예제 #1
0
        private void DataEditForm_Load(object sender, EventArgs e)
        {
            pack = TriDataPackBook.GetPack(packName);

            refreshList(0);
        }
예제 #2
0
        private void UCGroupItem_Paint(object sender, PaintEventArgs e)
        {
            TriDataPack data = TriDataPackBook.GetPack("drop_group");

            Font font = new Font("宋体", 10, FontStyle.Regular);

            e.Graphics.DrawString(String.Format("掉落组: {0}, 累计{1}件", val, tks.Count), font, Brushes.Black, 0, 0);

            int pos = 0;

            foreach (TriData tk in tks)
            {
                int id   = int.Parse(data.data[tk][1]);
                int type = int.Parse(data.data[tk][2]);
                int pro  = int.Parse(data.data[tk][3]);

                string url  = "";
                string name = "";
                if (type == 1)
                {
                    DataPack itm   = DataPackBook.GetPack("item");
                    int      index = itm.GetPackIndexByName("icon");
                    if (!itm.data.ContainsKey(id))
                    {
                        continue;
                    }
                    url   = string.Format("res/images/icon/item/{0}.png", itm.data[id][index]);
                    index = itm.GetPackIndexByName("name");
                    name  = itm.data[id][index];
                }
                else if (type == 2)
                {
                    DataPack itm   = DataPackBook.GetPack("equip");
                    int      index = itm.GetPackIndexByName("icon");
                    if (!itm.data.ContainsKey(id))
                    {
                        continue;
                    }
                    url   = string.Format("res/images/icon/equip/{0}.png", itm.data[id][index]);
                    index = itm.GetPackIndexByName("name");
                    name  = itm.data[id][index];
                }
                else if (type == 3)
                {
                    DataPack itm   = DataPackBook.GetPack("heji_rune");
                    int      index = itm.GetPackIndexByName("icon");
                    if (!itm.data.ContainsKey(id))
                    {
                        continue;
                    }
                    url   = string.Format("res/images/icon/rune/{0}.png", itm.data[id][index]);
                    index = itm.GetPackIndexByName("name");
                    name  = itm.data[id][index];
                }

                //if (File.Exists(url))
                Image item = MapPainter.GetNetImage(url);
                e.Graphics.DrawImage(item, pos * 45 + 5, 20, 30, 30);

                e.Graphics.DrawString(String.Format("{0}", name.Substring(0, Math.Min(name.Length, 3))), font, Brushes.Black, pos * 45, 52);
                e.Graphics.DrawString(String.Format("{0}%", pro / 10), font, Brushes.Black, pos * 45 + 5, 65);

                pos++;
            }
            font.Dispose();
        }
예제 #3
0
        private void UCGroupItem_Paint(object sender, PaintEventArgs e)
        {
            TriDataPack data = TriDataPackBook.GetPack("drop_group");

            Font font = new Font("宋体", 10, FontStyle.Regular);

            e.Graphics.DrawString(String.Format("物品id: {0}, 物品类型: {1}", val, type), font, Brushes.Black, 0, 0);

            int id = int.Parse(val);

            string url  = "";
            string name = "";

            if (type == 1)
            {
                DataPack itm   = DataPackBook.GetPack("item");
                int      index = itm.GetPackIndexByName("icon");
                if (!itm.data.ContainsKey(id))
                {
                    return;
                }
                url   = string.Format("res/images/icon/item/{0}.png", itm.data[id][index]);
                index = itm.GetPackIndexByName("name");
                name  = itm.data[id][index];
            }
            else if (type == 2)
            {
                DataPack itm   = DataPackBook.GetPack("equip");
                int      index = itm.GetPackIndexByName("icon");
                if (!itm.data.ContainsKey(id))
                {
                    return;
                }
                url   = string.Format("res/images/icon/equip/{0}.png", itm.data[id][index]);
                index = itm.GetPackIndexByName("name");
                name  = itm.data[id][index];
            }
            else if (type == 3)
            {
                DataPack itm   = DataPackBook.GetPack("heji_rune");
                int      index = itm.GetPackIndexByName("icon");
                if (!itm.data.ContainsKey(id))
                {
                    return;
                }
                url   = string.Format("res/images/icon/rune/{0}.png", itm.data[id][index]);
                index = itm.GetPackIndexByName("name");
                name  = itm.data[id][index];
            }

            //if (File.Exists(url))
            Image item = MapPainter.GetNetImage(url);

            if (item != null)
            {
                e.Graphics.DrawImage(item, 5, 20, 30, 30);
            }

            e.Graphics.DrawString(name, font, Brushes.Black, 52, 30);

            font.Dispose();
        }