Beispiel #1
0
        public void RefreshData(int eid)
        {
            blessId = eid;
            if (eid > 0)
            {
                bitmapButtonBuy.Visible = true;
                virtualRegion.SetRegionKey(1, eid);
                show = true;
            }
            else
            {
                virtualRegion.SetRegionKey(1, 0);
                bitmapButtonBuy.Visible = false;
                show = false;
            }

            var config = ConfigData.GetBlessConfig(eid);

            if (config.Type == 1)
            {
                bitmapButtonBuy.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("oth9");
                this.bitmapButtonBuy.Text = @"购买";
            }
            else
            {
                bitmapButtonBuy.IconImage = TaleofMonsters.Core.HSIcons.GetIconsByEName("hatt8");
                this.bitmapButtonBuy.Text = @"移除";
            }

            parent.Invalidate(new Rectangle(x, y, width, height));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        public void RefreshData(int id)
        {
            bitmapButtonBuy.Visible = id != 0;
            show   = id != 0;
            itemId = id;
            if (id != 0)
            {
                var isEquip = ConfigIdManager.IsEquip(id);
                virtualRegion.SetRegionKey(1, id);
                virtualRegion.SetRegionType(1, !isEquip ? PictureRegionCellType.Item : PictureRegionCellType.Equip);
                if (!isEquip)
                {
                    var itmConfig = ConfigData.GetHItemConfig(itemId);
                    price = (int)GameResourceBook.OutGoldSellItem(itmConfig.Rare, itmConfig.ValueFactor);
                }
                else
                {
                    price = ConfigData.GetEquipConfig(itemId).Value;
                }
            }

            if (priceType > 0) //非金币购买
            {
                price = price / 10 + 1;
            }

            parent.Invalidate(new Rectangle(x, y, width, height));
        }
        public void RefreshData(int eid)
        {
            equipId = eid;
            if (eid > 0)
            {
                bitmapButtonBuy.Visible = true;
                virtualRegion.SetRegionKey(1, eid);
                show = true;
            }
            else
            {
                virtualRegion.SetRegionKey(1, 0);
                bitmapButtonBuy.Visible = false;
                show = false;
            }

            parent.Invalidate(new Rectangle(x, y, width, height));
        }
Beispiel #5
0
        public void RefreshData(object data)//商品id
        {
            var id = (int)data;

            productId = id;
            GameShopConfig gameShopConfig = ConfigData.GetGameShopConfig(id);

            bitmapButtonBuy.Visible = id != 0;
            show = id != 0;

            if (id != 0)
            {
                var eid = HItemBook.GetItemId(gameShopConfig.Item);
                vRegion.SetRegionKey(1, eid);
                vRegion.SetRegionType(1, PictureRegionCellType.Item);
            }

            parent.Invalidate(new Rectangle(X, Y, Width, Height));
        }
Beispiel #6
0
        public void RefreshData()
        {
            var piece = (parent as BuyPieceForm).GetPieceData(index);

            if (!piece.IsEmpty())
            {
                itemId    = piece.Id;
                itemCount = piece.Count;
                bitmapButtonBuy.Visible = !piece.Used;
                virtualRegion.SetRegionKey(1, itemId);
                var itmConfig = ConfigData.GetHItemConfig(itemId);
                price = (int)GameResourceBook.OutGoldSellItem(itmConfig.Rare, itmConfig.ValueFactor) * piece.Count * 2;//素材价格x2
                show  = true;
            }
            else
            {
                itemId = 0;
                virtualRegion.SetRegionKey(1, 0);
                bitmapButtonBuy.Visible = false;
                show = false;
            }

            parent.Invalidate(new Rectangle(x, y, width, height));
        }