Example #1
0
        private void Draw(Graphics g, CardMouseState mouse)
        {
            if (Card is SpecialCard)
            {
             //   Image img2 = Card.GetCardImage(120, 120);
             //   g.DrawImage(img2, new Rectangle(Location.X, 10, 120, 120), 0, 0, img2.Width, img2.Height, GraphicsUnit.Pixel);
                return;
            }

            int x = Location.X;
            int y = 0;
            Color bgColor = IsSelected ? Color.LightGreen : BgColor;
            SolidBrush sb = new SolidBrush(bgColor);
            g.FillRectangle(sb, new Rectangle(x, 0, Size.Width, Size.Height));
            sb.Dispose();
            if (mouse != CardMouseState.MouseOn)
                y = 10;
            CardAssistant.DrawBase(g, Card.CardId, x, y, Size.Width, 120);

            if (mouse == CardMouseState.Disable)
            {
                var sbrush = new SolidBrush(Color.FromArgb(150, Color.Black));
                g.FillRectangle(sbrush, x, y, Size.Width, 120);
                sbrush.Dispose();
            }

            Font font = new Font("Arial", 7*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            for (int i = 0; i < Card.Star; i++)
            {
                g.DrawString("★", font, Brushes.Black, x + Size.Width - 16, y+2+i*10);
                g.DrawString("★", font, Brushes.Yellow, x + Size.Width - 15, y + 1 + i * 10);
            }
            font.Dispose();

            font = new Font("宋体", 9*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            var cardName = string.Format("{0}Lv{1}", Card.Name, ACard.Level);
            var cardQual = Config.CardConfigManager.GetCardConfig(Card.CardId).Quality;
            var cardColor = Color.FromName(HSTypes.I2QualityColor(cardQual));
            var brush = new SolidBrush(cardColor);
            g.DrawString(cardName, font, Brushes.Black, x + 1, mouse != CardMouseState.MouseOn ? 117 : 122);
            g.DrawString(cardName, font,brush, x, mouse != CardMouseState.MouseOn ? 116 : 121);
            font.Dispose();
            brush.Dispose();

            int index = 0;
            foreach (var manaType in ACard.CostList)
            {
                var imgIcon = HSIcons.GetIconsByEName("mix" + (int)manaType);
                g.DrawImage(imgIcon, x + index * 10, y + 1, 16, 16);
                index++;
            }
            if (index == 0)//无消耗
            {
                font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                g.DrawString("无消耗", font, Brushes.White, x + index * 10+2, y + 1+2);
                font.Dispose();
            }
        }
Example #2
0
        public void CardSlot_Paint(PaintEventArgs e)
        {
            if (Card != null)
            {
                CardMouseState state = !Enabled ? CardMouseState.Disable : (MouseOn ? CardMouseState.MouseOn : CardMouseState.Normal);
                Draw(e.Graphics, state);


#if DEBUG
                //      Font font = new Font("Arial", 7*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                //     e.Graphics.DrawString(acard.Id.ToString(), font, Brushes.White, 0, 20);
                //      font.Dispose();
#endif
            }
        }
Example #3
0
        private void Draw(Graphics g, CardMouseState mouse)
        {
            if (Card is SpecialCard)
            {
                //   Image img2 = Card.GetCardImage(120, 120);
                //   g.DrawImage(img2, new Rectangle(Location.X, 10, 120, 120), 0, 0, img2.Width, img2.Height, GraphicsUnit.Pixel);
                return;
            }

            int        x       = Location.X;
            int        y       = Location.Y;
            Color      bgColor = IsSelected ? Color.LightGreen : BgColor;
            SolidBrush sb      = new SolidBrush(bgColor);

            g.FillRectangle(sb, new Rectangle(x, y, Size.Width, Size.Height));
            sb.Dispose();
            if (mouse != CardMouseState.MouseOn)
            {
                y += 10;
            }
            CardAssistant.DrawBase(g, Card.CardId, x, y, Size.Width, 120);

            if (mouse == CardMouseState.Disable)
            {
                var sbrush = new SolidBrush(Color.FromArgb(150, Color.Black));
                g.FillRectangle(sbrush, x, y, Size.Width, 120);
                sbrush.Dispose();
            }
            if (ACard.Combo && CardConfigManager.GetCardConfig(ACard.CardId).Remark.Contains("连击"))
            {
                Image img = PicLoader.Read("System", "CardEff1.PNG");
                g.DrawImage(img, x + 2, y + 2, Size.Width - 4, 120 - 4);
                img.Dispose();
            }

            Font font = new Font("Arial", 7 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            for (int i = 0; i < Card.Star; i++)
            {
                g.DrawString("★", font, Brushes.Black, x + Size.Width - 16, y + 2 + i * 10);
                g.DrawString("★", font, Brushes.Yellow, x + Size.Width - 15, y + 1 + i * 10);
            }
            font.Dispose();

            var cardData = CardConfigManager.GetCardConfig(Card.CardId);

            if (Card.GetCardType() == CardTypes.Monster)
            {
                g.DrawImage(HSIcons.GetIconsByEName("rac" + cardData.TypeSub), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Weapon)
            {
                g.DrawImage(HSIcons.GetIconsByEName("wep" + (cardData.TypeSub - 100 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Spell)
            {
                g.DrawImage(HSIcons.GetIconsByEName("spl" + (cardData.TypeSub - 200 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            g.DrawImage(HSIcons.GetIconsByEName("atr" + cardData.Attr), x + Size.Width / 2 + 2, y + 90, 16, 16);

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            var cardName  = string.Format("{0}Lv{1}", Card.Name, ACard.Level);
            var cardQual  = Config.CardConfigManager.GetCardConfig(Card.CardId).Quality;
            var cardColor = Color.FromName(HSTypes.I2QualityColor(cardQual));
            var brush     = new SolidBrush(cardColor);

            g.DrawString(cardName, font, Brushes.Black, x + 1, mouse != CardMouseState.MouseOn ? y + 107 : y + 112);
            g.DrawString(cardName, font, brush, x, mouse != CardMouseState.MouseOn ? y + 106 :y + 111);
            font.Dispose();
            brush.Dispose();

            int index = 0;

            foreach (var manaType in ACard.CostList)
            {
                var imgIcon = HSIcons.GetIconsByEName("mix" + (int)manaType);
                g.DrawImage(imgIcon, x + index * 10, y + 1, 16, 16);
                index++;
            }
            if (index == 0)//无消耗
            {
                font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                g.DrawString("无消耗", font, Brushes.White, x + index * 10 + 2, y + 1 + 2);
                font.Dispose();
            }
        }