Пример #1
0
        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);
                }
            }
        }
Пример #2
0
        private void LeftPlayerHeroSkillChanged(bool active)
        {
            int index = 0;//初始化英雄技能按钮

            foreach (var skillId in BattleManager.Instance.PlayerManager.LeftPlayer.HeroSkillList)
            {
                if (active)
                {
                    vRegion.SetRegionDecorator(index + 1, 1, null);//移掉黑色遮罩
                }
                else
                {
                    var color    = Color.FromArgb(150, Color.Black); //cd中就加一层黑色遮罩
                    var decorate = new RegionCoverDecorator(color);
                    vRegion.SetRegionDecorator(index + 1, 1, decorate);
                }
                index++;
            }
            Invalidate();
        }