示例#1
0
        private void virtualRegion_RegionEntered(int id, int x, int y, int key)
        {
            if (cid == -1 || !Enabled)
            {
                return;
            }

            if (id == 3)
            {
                Image image = DrawTool.GetImageByString("品质:" + HSTypes.I2Quality(key - 1), 100);
                tooltip.Show(image, parent, x, y);
                return;
            }
            else if (id == 4)
            {
                if (key > 0)
                {
                    Image image = DrawTool.GetImageByString("职业限定:" + ConfigData.GetJobConfig(key + JobConfig.Indexer.NewBie).Name, 100);
                    tooltip.Show(image, parent, x, y);
                }
                return;
            }

            var cardType = card.GetCardType();

            if (cardType == CardTypes.Monster)
            {
                MonsterConfig monsterConfig = ConfigData.GetMonsterConfig(cid);
                if (id == 1)
                {
                    Image image = DrawTool.GetImageByString("种族:" + HSTypes.I2CardTypeSub(monsterConfig.Type), 100);
                    tooltip.Show(image, parent, x, y);
                }
                else
                {
                    Image image = GetTerrainImage(monsterConfig.Attr, monsterConfig.BuffImmune, monsterConfig.AttrDef);
                    tooltip.Show(image, parent, x, y);
                }
            }
            else if (cardType == CardTypes.Weapon)
            {
                WeaponConfig weaponConfig = ConfigData.GetWeaponConfig(cid);
                if (id == 1)
                {
                    Image image = DrawTool.GetImageByString("类型:" + HSTypes.I2CardTypeSub(weaponConfig.Type) + HSTypes.I2CardTypeDesSub(weaponConfig.Type), 150);
                    tooltip.Show(image, parent, x, y);
                }
                else
                {
                    Image image = DrawTool.GetImageByString("属性:" + HSTypes.I2Attr(weaponConfig.Attr), 100);
                    tooltip.Show(image, parent, x, y);
                }
            }
            else if (cardType == CardTypes.Spell)
            {
                SpellConfig spellConfig = ConfigData.GetSpellConfig(cid);
                if (id == 1)
                {
                    Image image = DrawTool.GetImageByString("类型:" + HSTypes.I2CardTypeSub(spellConfig.Type), 100);
                    tooltip.Show(image, parent, x, y);
                }
                else
                {
                    Image image = DrawTool.GetImageByString("属性:" + HSTypes.I2Attr(spellConfig.Attr), 100);
                    tooltip.Show(image, parent, x, y);
                }
            }
        }
示例#2
0
        private void ChangeCards()
        {
            page = 0;
            cards.Clear();
            tar = -1;
            cardDetail.SetInfo(-1);

            List <CardConfigData> configData = new List <CardConfigData>();

            #region 数据装载

            if (filterType == -1 || filterType == 0)
            {
                foreach (var monsterConfig in ConfigData.MonsterDict.Values)
                {
                    if (monsterConfig.IsSpecial > 0)
                    {
                        continue;
                    }
                    if (filterJob != -1 && monsterConfig.JobId != filterJob)
                    {
                        continue;
                    }
                    if (filterLevel != 0 && monsterConfig.Star != filterLevel)
                    {
                        continue;
                    }
                    if (filterQual != -1 && monsterConfig.Quality != filterQual)
                    {
                        continue;
                    }
                    if (filterEle != -1 && monsterConfig.Attr != filterEle)
                    {
                        continue;
                    }
                    if (filterRemark != "全部" && (string.IsNullOrEmpty(monsterConfig.Remark) || !monsterConfig.Remark.Contains(filterRemark)))
                    {
                        continue;
                    }
                    if (filterTypeSub != "全部" && HSTypes.I2CardTypeSub(monsterConfig.Type) != filterTypeSub)
                    {
                        continue;
                    }
                    var cardData = CardConfigManager.GetCardConfig(monsterConfig.Id);
                    configData.Add(cardData);
                }
            }
            if (filterType == -1 || filterType == 1)
            {
                foreach (var weaponConfig in ConfigData.WeaponDict.Values)
                {
                    if (weaponConfig.IsSpecial > 0)
                    {
                        continue;
                    }
                    if (filterJob != -1 && weaponConfig.JobId != filterJob)
                    {
                        continue;
                    }
                    if (filterLevel != 0 && weaponConfig.Star != filterLevel)
                    {
                        continue;
                    }
                    if (filterQual != -1 && weaponConfig.Quality != filterQual)
                    {
                        continue;
                    }
                    if (filterEle != -1 && weaponConfig.Attr != filterEle)
                    {
                        continue;
                    }
                    if (filterRemark != "全部" && (string.IsNullOrEmpty(weaponConfig.Remark) || !weaponConfig.Remark.Contains(filterRemark)))
                    {
                        continue;
                    }
                    if (filterTypeSub != "全部" && HSTypes.I2CardTypeSub(weaponConfig.Type) != filterTypeSub)
                    {
                        continue;
                    }
                    var cardData = CardConfigManager.GetCardConfig(weaponConfig.Id);
                    configData.Add(cardData);
                }
            }
            if (filterType == -1 || filterType == 2)
            {
                foreach (var spellConfig in ConfigData.SpellDict.Values)
                {
                    if (spellConfig.IsSpecial > 0)
                    {
                        continue;
                    }
                    if (filterJob != -1 && spellConfig.JobId != filterJob)
                    {
                        continue;
                    }
                    if (filterLevel != 0 && spellConfig.Star != filterLevel)
                    {
                        continue;
                    }
                    if (filterQual != -1 && spellConfig.Quality != filterQual)
                    {
                        continue;
                    }
                    if (filterEle != -1 && spellConfig.Attr != filterEle)
                    {
                        continue;
                    }
                    if (filterRemark != "全部" && (string.IsNullOrEmpty(spellConfig.Remark) || !spellConfig.Remark.Contains(filterRemark)))
                    {
                        continue;
                    }
                    if (filterTypeSub != "全部" && HSTypes.I2CardTypeSub(spellConfig.Type) != filterTypeSub)
                    {
                        continue;
                    }
                    var cardData = CardConfigManager.GetCardConfig(spellConfig.Id);
                    configData.Add(cardData);
                }
            }

            #endregion

            configData.Sort(new CompareByCard());
            cards = configData.ConvertAll(card => card.Id);

            UpdateButtonState();

            if (cards.Count > 0)
            {
                cardDetail.SetInfo(cards[0]);
            }
            isDirty = true;
            Invalidate(new Rectangle(65, 110, cardWidth * xCount, cardHeight * yCount));
        }