private void virtualRegion_RegionEntered(int id, int x, int y, int key) { Image image = null; if (id == 1) {//1一定是heroskill image = HeroPowerBook.GetPreview(key); } else { if (key > 0) { var cellType = cellTypeList[id - 2]; if (cellType == PictureRegionCellType.Card) { image = CardAssistant.GetCard(key).GetPreview(CardPreviewType.Normal, new int[] { }); } else if (cellType == PictureRegionCellType.Item) { image = HItemBook.GetPreview(key); } else if (cellType == PictureRegionCellType.Equip) { Equip equip = new Equip(key); image = equip.GetPreview(); } } } if (image != null) { tooltip.Show(image, this, x, y); } }
private void virtualRegion_RegionEntered(int info, int mx, int my, int key) { if (info == 1 && product.Id > 0) { Image image = CardAssistant.GetCard(product.Cid).GetPreview(CardPreviewType.Shop, product.Price.ToArray()); tooltip.Show(image, parent, mx, my, product.Id); } }
public Image ShowTip() { var card = CardAssistant.GetCard(CardId); DeckCard dc = new DeckCard(CardId, (byte)Level, 0); card.SetData(dc); return(card.GetPreview(CardPreviewType.Normal, new int[0])); }
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(); } }
private void virtualRegion_RegionEntered(int info, int mx, int my, int key) { if (info == 1 && card1 != -1) { Image image = CardAssistant.GetCard(card1).GetPreview(CardPreviewType.Normal, new int[] { }); tooltip.Show(image, parent, mx, my, card1); } else if (info == 2 && card2 != -1) { Image image = CardAssistant.GetCard(card2).GetPreview(CardPreviewType.Normal, new int[] { }); tooltip.Show(image, parent, mx, my, card2); } }
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)); }
private void Region_RegionEntered(int id, int x, int y, int key) { if (cards.Count <= id - 1) { return; } var card = CardAssistant.GetCard(cards[id - 1].ACard.CardId); DeckCard dc = new DeckCard(card.CardId, (byte)cards[id - 1].ACard.Level, 0); card.SetData(dc); var img = card.GetPreview(CardPreviewType.Normal, new int[0]); tooltip.Show(img, this, x, y); }
private void OnVRegionEntered(int id, int x, int y, int key) { if (id > 0 && id < 10) { var pickCardId = cardOpenArray[id - 1]; if (pickCardId > 0) { Image image = CardAssistant.GetCard(pickCardId).GetPreview(CardPreviewType.Normal, new int[] { }); tooltip.Show(image, this, x, y); } else { tooltip.Hide(this); } } else { tooltip.Hide(this); } }
private void CardsArray_MouseMove(object sender, MouseEventArgs e) { if (!Enabled) { return; } savedMousePos = e.Location; ResizeElements(); int newIndex = -1; for (int i = 0; i < 10; i++) { var targetCard = cards[i]; targetCard.MouseOn = false; if (savedMousePos.X > targetCard.Location.X && savedMousePos.X < targetCard.Location.X + targetCard.Size.Width) { newIndex = i + 1; targetCard.MouseOn = true; } } if (newIndex != mouseIndex) { mouseIndex = newIndex; tooltip.Hide(this); if (mouseIndex != -1 && cards[mouseIndex - 1].ACard.CardId != 0) { var targetCard = cards[mouseIndex - 1]; var card = CardAssistant.GetCard(targetCard.ACard.CardId); card.SetData(targetCard.ACard); var image = card.GetPreview(CardPreviewType.Normal, new int[0]); tooltip.Show(image, this, targetCard.Location.X, targetCard.Location.Y - image.Height - 5); } Invalidate(); } }
private void buttonOk_Click(object sender, EventArgs e) { var deck = UserProfile.InfoCard.Decks[selectPage]; if (deck.Count < GameConstants.DeckCardCount) { MessageBoxEx2.Show("卡组内卡片数不足"); return; } foreach (var cardId in deck.CardIds) { var card = CardAssistant.GetCard(cardId); if (card.JobId > 0 && card.JobId != UserProfile.InfoBasic.Job) { MessageBoxEx2.Show("部分卡牌职业不匹配"); return; } } comfirm = true; UserProfile.InfoCard.DeckId = selectPage; Close(); }
public void SetSlotCard(ActiveCard tcard) { ACard = tcard; Card = CardAssistant.GetCard(tcard.CardId); Card.SetData(ACard); }