private void OnVRegionClick(int id, int x, int y, MouseButtons button) { if (id > 0)//说明是button { var hasOpen = cardOpenArray[id - 1]; if (hasOpen == 0) { int cardId = UseScard(); vRegion.SetRegionKey(id, cardId); var card = UserProfile.InfoCard.AddCard(cardId); if (card.Exp != 0) //不是新卡 { IRegionDecorator decorator = new RegionCoverDecorator(Color.FromArgb(150, Color.Black)); vRegion.SetRegionDecorator(id, 0, decorator); decorator = new RegionTextDecorator(18, 50, 16, Color.White, true); decorator.SetState("EXP+1"); vRegion.SetRegionDecorator(id, 1, decorator); } cardOpenArray[id - 1] = cardId; coverEffect[id - 1] = new CoverEffect(EffectBook.GetEffect("transmit"), new Point(cardPos[(id - 1) * 2], cardPos[(id - 1) * 2 + 1]), new Size(120, 150)); coverEffect[id - 1].PlayOnce = true; Invalidate(); var pos = vRegion.GetRegionPosition(id); OnVRegionEntered(id, pos.X, pos.Y, cardId); } } }
public void SetInfo(DeckCard dcard) { cid = dcard.BaseId; level = dcard.Level; lastCell = -1; skills = new List <MonsterSkill>(); string effectName = ""; if (cid > 0) { card = CardAssistant.GetCard(cid); virtualRegion.SetRegionKey(3, CardConfigManager.GetCardConfig(cid).Quality + 1); var jobId = CardConfigManager.GetCardConfig(cid).JobId; if (jobId > 0) { jobId = ConfigData.GetJobConfig(jobId).JobIndex; } virtualRegion.SetRegionKey(4, jobId); card.SetData(dcard); if (card.GetCardType() == CardTypes.Monster) { MonsterCard monsterCard = card as MonsterCard; if (monsterCard != null) { CheckMonster(monsterCard, ref effectName); } } } string nowEffectName = ""; if (coverEffect != null) { nowEffectName = coverEffect.Name; } if (effectName != nowEffectName) { if (effectName == "") { coverEffect = null; } else { coverEffect = new CoverEffect(EffectBook.GetEffect(effectName), new Point(X + 20, Y + 20), new Size(160, 180)); } } tooltip.Hide(parent); if (Invalidate != null) { Invalidate(); } }
public void RefreshData(DbCardProduct pro) { show = pro.Id != 0; product = pro; if (product.Id != 0) { virtualRegion.SetRegionKey(1, product.Cid); } string effectName = ""; var card = CardAssistant.GetCard(product.Cid); if (card.GetCardType() == CardTypes.Monster) { MonsterConfig monsterConfig = ConfigData.GetMonsterConfig(product.Cid); foreach (var skill in MonsterBook.GetSkillList(monsterConfig.Id)) { int skillId = skill.Id; SkillConfig skillConfig = ConfigData.GetSkillConfig(skillId); if (skillConfig.Cover != null) { effectName = skillConfig.Cover; } } if (monsterConfig.Cover != "") { effectName = monsterConfig.Cover; } } string nowEffectName = ""; if (coverEffect != null) { nowEffectName = coverEffect.Name; } if (effectName != nowEffectName) { if (effectName == "") { coverEffect = null; } else { coverEffect = new CoverEffect(EffectBook.GetEffect(effectName), new Point(x + 12, y + 14), new Size(64, 84)); } } parent.Invalidate(new Rectangle(x + 12, y + 14, 64, 84)); }