Пример #1
0
        public static EquipItem createItem(byte code, byte type)
        {
            string codeType = getItemCodeType(code, type);

            EquipItem item = null;

            for (Int32 i = 0; i < EquipItemInfo.g_ItemInfo.m_ItemInfo.Count; i++)
            {
                if (getItemCodeType(EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number) == codeType)
                {
                    item = new EquipItem(Int32.Parse(EquipItem.getItemCodeType(EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number)),
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Name,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].HandFlag,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Width,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Height, 0);
                    item.Img = EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Photo;
                    break;
                }
            }

            // EquipItem item = EquipImageCache.Instance.getItemByCodeType(codeType);
            return(new EquipItem(item));
            // return null;
        }
Пример #2
0
        public static EquipItem createItem(byte[] codes, int offset, int len)
        {
            if (offset < 0 || len <= 0 || (offset + len > codes.Length) || codes[offset] == 0xFF)
            {
                return(null);
            }

            string codeType = getItemCodeType(codes, offset, len);

            EquipItem item = null;

            for (Int32 i = 0; i < EquipItemInfo.g_ItemInfo.m_ItemInfo.Count; i++)
            {
                if (getItemCodeType(EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number) == codeType)
                {
                    item = new EquipItem(Int32.Parse(EquipItem.getItemCodeType(EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number)),
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Name,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].HandFlag,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Width,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Height, 0);
                    item.Img = EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Photo;
                    break;
                }
            }

            //EquipItem item = EquipImageCache.Instance.getItemByCodeType(codeType);
            return(new EquipItem(item, codes, offset, len));
        }
Пример #3
0
        private void cboEquipName_TextChanged(object sender, EventArgs e)
        {
            string itemName = cboEquipName.Text;

            if (null == itemName || "" == itemName.Trim())
            {
                return;
            }

            EquipItem item = null;

            for (Int32 i = 0; i < EquipItemInfo.g_ItemInfo.m_ItemInfo.Count; i++)
            {
                if (EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category == (cboEquipType.Items[cboEquipType.SelectedIndex] as EquipItemType).TypeId &&
                    EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number == (cboEquipName.Items[cboEquipName.SelectedIndex] as Character.ComboboxItem).Value)
                {
                    item = new EquipItem(Int32.Parse(EquipItem.getItemCodeType(EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Number)), itemName,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].HandFlag, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Category,
                                         EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Width, EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Height, 0);
                    item.Img = EquipItemInfo.g_ItemInfo.m_ItemInfo[i].Photo;
                    break;
                }
            }



            //     EquipImageCache.Instance.getItem(cboEquipName.Text);

            if (null != item)
            {
                if (editItem == null)
                {
                    editItem = new EquipItem();
                }

                editItem.assign(item);
            }
        }