private void listViewMethods_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listViewMatchs.SelectedIndices.Count > 0)
     {
         tid = int.Parse(listViewMatchs.SelectedItems[0].Tag.ToString());
         if (tid == 0)
         {
             viewStack1.SelectedIndex = 3;
             tourRankList1.Init();
             buttonEngage.Visible = false;
             pictureBox1.Visible  = false;
         }
         else
         {
             TournamentConfig tournamentConfig = ConfigData.GetTournamentConfig(tid);
             if (tournamentConfig.Type == TournamentTypes.Cup8)
             {
                 viewStack1.SelectedIndex = 0;
                 tourCup81.Init(tid);
             }
             else if (tournamentConfig.Type == TournamentTypes.League4)
             {
                 viewStack1.SelectedIndex = 1;
                 tourLeague41.Init(tid);
             }
             else if (tournamentConfig.Type == TournamentTypes.Cup16)
             {
                 viewStack1.SelectedIndex = 2;
                 tourCup161.Init(tid);
             }
             else
             {
                 return;
             }
             //if (tour.apply_date != UserProfile.Profile.time.Date)
             //    buttonEngage.Visible = false;
             //else if (UserProfile.MemData.GetTournamentData(tid).engage)
             //    buttonEngage.Visible = false;
             //else if (UserProfile.Profile.level < tour.min_level || UserProfile.Profile.level > tour.max_level)
             //    buttonEngage.Visible = false;
             //else
             //    buttonEngage.Visible = true;
             pictureBox1.Image   = HSIcons.GetIconsByEName(tournamentConfig.Icon);
             pictureBox1.Visible = true;
         }
         Invalidate();
     }
 }
Beispiel #2
0
        internal override void Draw(Graphics g)
        {
            int xOff = position.X - 10;

            if (damage.Dtype == DamageTypes.Magic)
            {
                xOff -= 16;
                g.DrawImage(HSIcons.GetIconsByEName("atr" + damage.Element), xOff, position.Y + 8, 18, 18);
                xOff += 16;
                color = PaintTool.GetColorByAttribute(damage.Element);
            }

            Brush brush = new SolidBrush(color);

            g.DrawString(word, font, brush, xOff, position.Y);
            brush.Dispose();
        }
Beispiel #3
0
        public void DrawAll(System.Drawing.Graphics g)
        {
            foreach (var flowData in flowList)
            {
                var xoff = 0;
                if (!string.IsNullOrEmpty(flowData.IconName))
                {
                    var icon = HSIcons.GetIconsByEName(flowData.IconName);
                    g.DrawImage(icon, flowData.X, flowData.Y, 20, 20);
                    xoff += 22;
                }

                var brush = new SolidBrush(flowData.Color);
                g.DrawString(flowData.Text, font, Brushes.Black, flowData.X + xoff + 1, flowData.Y + 1);
                g.DrawString(flowData.Text, font, brush, flowData.X+ xoff, flowData.Y);
                brush.Dispose();
            }
        }
Beispiel #4
0
        public MGTwentyOne()
        {
            InitializeComponent();
            this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC1.ForeColor        = Color.White;
            bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("oth9");
            bitmapButtonC1.IconSize         = new Size(16, 16);
            bitmapButtonC1.IconXY           = new Point(4, 5);
            bitmapButtonC1.TextOffX         = 8;

            this.bitmapButtonC2.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC2.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC2.ForeColor        = Color.White;
            bitmapButtonC2.IconImage        = HSIcons.GetIconsByEName("oth11");
            bitmapButtonC2.IconSize         = new Size(16, 16);
            bitmapButtonC2.IconXY           = new Point(4, 5);
            bitmapButtonC2.TextOffX         = 8;
        }
Beispiel #5
0
        public void Init(int idx)
        {
            vRegion = new VirtualRegion(parent);
            vRegion.AddRegion(new PictureAnimRegion(1, X + 11, Y + 19, 56, 56, PictureRegionCellType.Item, 0));
            vRegion.RegionEntered += new VirtualRegion.VRegionEnteredEventHandler(virtualRegion_RegionEntered);
            vRegion.RegionLeft    += new VirtualRegion.VRegionLeftEventHandler(virtualRegion_RegionLeft);

            this.bitmapButtonBuy             = new BitmapButton();
            bitmapButtonBuy.Location         = new Point(X + 125, Y + 70);
            bitmapButtonBuy.Size             = new Size(35, 20);
            this.bitmapButtonBuy.Click      += new System.EventHandler(this.pictureBoxBuy_Click);
            this.bitmapButtonBuy.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonBuy.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonBuy.ForeColor        = Color.White;
            bitmapButtonBuy.IconImage        = HSIcons.GetIconsByEName("oth9");
            bitmapButtonBuy.IconSize         = new Size(16, 16);
            bitmapButtonBuy.IconXY           = new Point(10, 4);
            parent.Controls.Add(bitmapButtonBuy);
        }
Beispiel #6
0
        public MGVoting()
        {
            InitializeComponent();
            this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC1.ForeColor        = Color.White;
            bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("rot3");
            bitmapButtonC1.IconSize         = new Size(16, 16);
            bitmapButtonC1.IconXY           = new Point(4, 5);
            bitmapButtonC1.TextOffX         = 8;
            vRegion = new VirtualRegion(this);
            for (int i = 0; i < 3; i++)
            {
                ButtonRegion region = new ButtonRegion(i + 1, 30, 270 + 30 * i, 20, 20, "GameBackNormal1.png", "GameBackNormal1On.png");
                vRegion.AddRegion(region);
            }

            vRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked);
        }
Beispiel #7
0
        private void selectPanel_DrawCell(Graphics g, int info, int xOff, int yOff)
        {
            var jobConfig = ConfigData.GetJobConfig(info);
            var img       = HSIcons.GetIconsByEName("job" + jobConfig.JobIndex);

            g.DrawImage(img, 14 + xOff, 4 + yOff, 28, 28);
            Font font = new Font("微软雅黑", 11.25F * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            g.DrawString(jobConfig.Name, font, Brushes.White, 58 + xOff, 6 + yOff);
            font.Dispose();

            if (jobConfig.InitialLocked && !UserProfile.Profile.InfoBasic.AvailJobList.Contains(info))
            {
                Brush b = new SolidBrush(Color.FromArgb(150, Color.Black));
                g.FillRectangle(b, xOff, yOff, 154, selectPanel.ItemHeight);

                var lockIcon = HSIcons.GetIconsByEName("oth4");
                g.DrawImage(lockIcon, 65 + xOff, 6 + yOff, 24, 24);
            }
        }
Beispiel #8
0
        private void DrawOnLine(Graphics g, int id, int data1, int data2, int line)
        {
            for (int i = 0; i < 4; i++)
            {
                int v = GetByteFromInt(data1, i);
                g.DrawImage(HSIcons.GetIconsByEName(v == 0 ? "npc2" : "rac" + v), i * 20 + 66 + xoff, line * 20 + 1 + yoff, 18, 18);
            }
            Font font = new Font("微软雅黑", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            g.DrawString(id < 100 ? (id + 1).ToString() : "当前", font, Brushes.White, 10 + xoff, line * 20 + 1 + yoff);
            if (id < 100)
            {
                g.DrawImage(HSIcons.GetIconsByEName("npc3"), 238 + xoff, line * 20 + 1 + yoff, 18, 18);
                g.DrawImage(HSIcons.GetIconsByEName("npc2"), 278 + xoff, line * 20 + 1 + yoff, 18, 18);

                g.DrawString((data2 / 10).ToString(), font, data2 / 10 > 0 ? Brushes.Gold : Brushes.White, 220 + xoff, line * 20 + 1 + yoff);
                g.DrawString((data2 % 10).ToString(), font, (data2 % 10 > 0) ? Brushes.Gold : Brushes.White, 260 + xoff, line * 20 + 1 + yoff);
            }
            font.Dispose();
        }
Beispiel #9
0
        public MGThreeBody()
        {
            InitializeComponent();
            this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC1.ForeColor        = Color.White;
            bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("rot3");
            bitmapButtonC1.IconSize         = new Size(16, 16);
            bitmapButtonC1.IconXY           = new Point(4, 5);
            bitmapButtonC1.TextOffX         = 8;
            vRegion = new VirtualRegion(this);
            string[] txt = { "浸泡", "脱水", "医疗", "农耕", "科研" };
            for (int i = 0; i < 5; i++)
            {
                ButtonRegion region = new ButtonRegion(i + 1, 40 + 55 * i, 310, 50, 50, string.Format("GameSanTi{0}.png", i + 1), string.Format("GameSanTi{0}On.png", i + 1));
                region.AddDecorator(new RegionTextDecorator(10, 30, 10, txt[i]));
                vRegion.AddRegion(region);
            }

            vRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked);
        }
Beispiel #10
0
        private int winLevelCount; //连胜回合数

        public MGLinkGame()
        {
            InitializeComponent();
            this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC1.ForeColor        = Color.White;
            bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("rot1");
            bitmapButtonC1.IconSize         = new Size(16, 16);
            bitmapButtonC1.IconXY           = new Point(4, 5);
            bitmapButtonC1.TextOffX         = 8;
            bitmapButtonC1.Text             = @"开始";
            for (int i = 0; i < 16; i++)
            {
                iconTypes[i] = PicLoader.Read("MiniGame.LinkGame", String.Format("{0}.jpg", i + 1));
            }
            for (int i = 0; i < 6; i++)
            {
                iconTypes[20 + i] = PicLoader.Read("MiniGame.LinkGame", String.Format("s{0}.jpg", i + 1));
            }
            xoff = 0;
        }
Beispiel #11
0
        public MGOvercome()
        {
            InitializeComponent();
            this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            bitmapButtonC1.ForeColor        = Color.White;
            bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("hatt1");
            bitmapButtonC1.IconSize         = new Size(16, 16);
            bitmapButtonC1.IconXY           = new Point(4, 5);
            bitmapButtonC1.TextOffX         = 8;
            vRegion = new VirtualRegion(this);
            string[] txt = { " 水", " 风", " 火", " 光", " 暗" };
            for (int i = 0; i < 5; i++)
            {
                ButtonRegion region = new ButtonRegion(i + 1, 35 + 55 * i, 310, 50, 50, "GameBackNormal1.png", "GameBackNormal1On.png");
                region.AddDecorator(new RegionTextDecorator(10, 20, 10, txt[i]));
                vRegion.AddRegion(region);
            }

            vRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked);
        }
Beispiel #12
0
        private void PeopleViewForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("挑战对手", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (showImage)
            {
                virtualRegion.Draw(e.Graphics);

                if (realTar != -1)
                {
                    int          xoff         = 35;
                    int          yoff         = 35;
                    Font         fontsong     = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    PeopleConfig peopleConfig = ConfigData.GetPeopleConfig(people[realTar].Pid);
                    e.Graphics.DrawString(string.Format("{0} (Lv{1})", peopleConfig.Name, peopleConfig.Level), fontsong, Brushes.White, xoff + 100, yoff + 10);
                    e.Graphics.DrawString("来自", fontsong, Brushes.DarkGray, xoff + 100, yoff + 28);
                    e.Graphics.DrawString(peopleConfig.World, fontsong, Brushes.Cyan, xoff + 140, yoff + 28);
                    e.Graphics.DrawString("属性", fontsong, Brushes.DarkGray, xoff + 100, yoff + 46);
                    for (int i = 0; i < peopleConfig.Deck.Length; i++)
                    {
                        e.Graphics.DrawImage(HSIcons.GetIconsByEName(peopleConfig.Deck[i]), xoff + 140 + i * 18, yoff + 46, 16, 16);
                    }
                    int win  = people[realTar].Win;
                    int loss = people[realTar].Loss;
                    int rate = 0;
                    if (win + loss != 0)
                    {
                        rate = win * 100 / (win + loss);
                    }
                    e.Graphics.DrawString("胜率", fontsong, Brushes.DarkGray, xoff + 100, yoff + 64);
                    e.Graphics.DrawString(string.Format("{0:0.0}% ({1}胜{2}负)", rate, win, loss), fontsong, (win == loss) ? Brushes.White : (win > loss ? Brushes.LightGreen : Brushes.Red), xoff + 140, yoff + 64);
                    fontsong.Dispose();
                }
            }
        }
        private void HeroSkillAttrForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString(" 奇术 ", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            foreach (HeroSkillAttrItem ctl in skillControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            string str    = string.Format("我的阅历:  {0} ", UserProfile.InfoBasic.AttrPoint);
            int    strWid = (int)e.Graphics.MeasureString(str, font).Width;

            e.Graphics.DrawString(str, font, Brushes.White, 20, 290);
            font.Dispose();
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth6"), 20 + strWid, 289, 14, 14);
        }
Beispiel #14
0
        private void CardBagForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            for (int i = 0; i < cardCount; i++)
            {
                var pickCardId = cardOpenArray[i];
                int tx         = cardPos[i * 2];
                int ty         = cardPos[i * 2 + 1];
                if (pickCardId > 0)
                {
                    CardAssistant.DrawBase(e.Graphics, pickCardId, tx, ty, 120, 150);

                    var  cardConfigData = CardConfigManager.GetCardConfig(pickCardId);
                    Font fontStar       = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    e.Graphics.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), fontStar, Brushes.Yellow, tx + 5, ty + 10);
                    fontStar.Dispose();
                    var quality = cardConfigData.Quality + 1;
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("gem" + quality), tx + 50, ty + 125, 20, 20);
                }
                else
                {
                    var imgBack = PicLoader.Read("System", "CardBack.JPG");
                    e.Graphics.DrawImage(imgBack, tx, ty, 120, 150);
                }

                if (coverEffect[i] != null)
                {
                    coverEffect[i].Draw(e.Graphics);
                }
            }

            vRegion.Draw(e.Graphics);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("卡 包", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();
        }
Beispiel #15
0
        private void virtualRegion_RegionClicked(int id, int x, int y, MouseButtons button)
        {
            if (id > 0)
            {
                vRegion.ClearRegion();
                var index = 1;
                if (lastKey == 0)
                {
                    result = evt.ChooseTarget(0);
                    var icon = HSIcons.GetIconsByEName("rot7");
                    vRegion.AddRegion(new ImageRegion(10, pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25, 60, 60, ImageRegionCellType.None, icon));
                }
                else
                {
                    result = evt.ChooseTarget(1);
                    vRegion.AddRegion(new PictureRegion(index, pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25, 60, 60, PictureRegionCellType.Item, lastKey));

                    UserProfile.InfoBag.DeleteItem(lastKey, 1);
                }
                afterChoose = true;
            }
        }
Beispiel #16
0
        public override Image GetPreview(CardPreviewType type, int[] parms)
        {
            const string stars = "★★★★★★★★★★";

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(CardId).Quality;

            tipData.AddTextNewLine(spell.SpellConfig.Name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddText(string.Format("Lv{0}({1})", card.Level, spell.SpellConfig.Ename), "MediumAquamarine");
            tipData.AddTextNewLine(stars.Substring(10 - spell.SpellConfig.Star), "Yellow", 20);
            tipData.AddLine();
            if (spell.SpellConfig.JobId > 0)
            {
                var jobConfig = ConfigData.GetJobConfig(spell.SpellConfig.JobId);
                tipData.AddTextNewLine(string.Format("(限定职业:{0})", jobConfig.Name), "Red");
            }
            tipData.AddTextNewLine("类型/属性", "Gray");
            tipData.AddImage(HSIcons.GetIconsByEName("spl" + (spell.SpellConfig.Type - 200 + 1)));
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + spell.SpellConfig.Attr));
            string des = spell.Descript;

            tipData.AddTextLines(des, "Cyan", 15, true);

            if (type == CardPreviewType.Shop)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("价格", "White");
                for (int i = 0; i < 7; i++)
                {
                    if (parms[i] > 0)
                    {
                        tipData.AddText(" " + parms[i].ToString(), HSTypes.I2ResourceColor(i));
                        tipData.AddImage(HSIcons.GetIconsByEName("res" + (i + 1)));
                    }
                }
            }
            return(tipData.Image);
        }
Beispiel #17
0
        public void Draw(Graphics g)
        {
            Image back = PicLoader.Read("System", "ShopItemBack.JPG");

            g.DrawImage(back, x, y, width - 1, height - 1);
            back.Dispose();

            if (show)
            {
                GameShopConfig gameShopConfig = ConfigData.GetGameShopConfig(productId);
                string         name;
                string         fontcolor;
                var            isEquip = ConfigIdManager.IsEquip(gameShopConfig.ItemId);
                if (!isEquip)
                {
                    HItemConfig itemConfig = ConfigData.GetHItemConfig(gameShopConfig.ItemId);
                    name      = itemConfig.Name;
                    fontcolor = HSTypes.I2RareColor(itemConfig.Rare);
                }
                else
                {
                    EquipConfig equipConfig = ConfigData.GetEquipConfig(gameShopConfig.ItemId);
                    name      = equipConfig.Name;
                    fontcolor = HSTypes.I2QualityColor(equipConfig.Quality);
                }
                Font  fontsong = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Brush brush    = new SolidBrush(Color.FromName(fontcolor));
                g.DrawString(name, fontsong, brush, x + 76, y + 9);
                brush.Dispose();
                var itmConfig = ConfigData.GetHItemConfig(gameShopConfig.ItemId);
                var price     = GameResourceBook.OutGoldSellItem(itmConfig.Rare, itmConfig.ValueFactor);
                g.DrawString(string.Format("{0,3:D}", Math.Max(1, price / GameConstants.DiamondToGold)), fontsong, Brushes.PaleTurquoise, x + 80, y + 37);
                fontsong.Dispose();
                g.DrawImage(HSIcons.GetIconsByEName("res8"), x + 110, y + 35, 16, 16);

                virtualRegion.Draw(g);
            }
        }
Beispiel #18
0
 public MGSeven()
 {
     InitializeComponent();
     #region  钮初始化
     this.bitmapButtonC1.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
     bitmapButtonC1.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
     bitmapButtonC1.ForeColor        = Color.White;
     bitmapButtonC1.IconImage        = HSIcons.GetIconsByEName("rot1");
     bitmapButtonC1.IconSize         = new Size(16, 16);
     bitmapButtonC1.IconXY           = new Point(4, 5);
     bitmapButtonC1.TextOffX         = 8;
     bitmapButtonC1.Text             = @"开始";
     this.bitmapButtonC2.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
     bitmapButtonC2.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
     bitmapButtonC2.ForeColor        = Color.White;
     bitmapButtonC2.IconImage        = HSIcons.GetIconsByEName("rot2");
     bitmapButtonC2.IconSize         = new Size(16, 16);
     bitmapButtonC2.IconXY           = new Point(4, 5);
     bitmapButtonC2.TextOffX         = 8;
     bitmapButtonC2.Text             = @"停止";
     this.bitmapButtonC3.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
     bitmapButtonC3.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
     bitmapButtonC3.ForeColor        = Color.White;
     bitmapButtonC3.IconImage        = HSIcons.GetIconsByEName("rot2");
     bitmapButtonC3.IconSize         = new Size(16, 16);
     bitmapButtonC3.IconXY           = new Point(4, 5);
     bitmapButtonC3.TextOffX         = 8;
     bitmapButtonC3.Text             = @"停止";
     this.bitmapButtonC4.ImageNormal = PicLoader.Read("Button.Panel", "ButtonBack2.png");
     bitmapButtonC4.Font             = new Font("宋体", 8 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
     bitmapButtonC4.ForeColor        = Color.White;
     bitmapButtonC4.IconImage        = HSIcons.GetIconsByEName("rot2");
     bitmapButtonC4.IconSize         = new Size(16, 16);
     bitmapButtonC4.IconXY           = new Point(4, 5);
     bitmapButtonC4.TextOffX         = 8;
     bitmapButtonC4.Text             = @"停止";
     #endregion
 }
Beispiel #19
0
        private void GameShopViewForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("游戏商城", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            virtualRegion.Draw(e.Graphics);
            foreach (GameShopItem ctl in itemControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            string str    = string.Format("我的钻石:  {0} ", UserProfile.InfoBag.Diamond);
            int    strWid = (int)e.Graphics.MeasureString(str, font).Width;

            e.Graphics.DrawString(str, font, Brushes.White, 20, 372);
            font.Dispose();
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("res8"), 20 + strWid, 371, 14, 14);
        }
Beispiel #20
0
        public Image GetPreview()
        {
            ControlPlus.TipImage tipData = new ControlPlus.TipImage(160);
            tipData.AddTextNewLine(string.Format("{0} Lv{1}", Name, Level.ToString()), Camp == CampConfig.Indexer.Reborn ? "Lime" : "Red", 20);

            tipData.AddTextNewLine("", "White", 20);
            tipData.AddImageXY(HSIcons.GetIconsByEName("hatt1"), 0, 0, 32, 32, 5, 20, 20, 20);
            tipData.AddTextOff(Atk.ToString(), "White", 30);
            tipData.AddImageXY(HSIcons.GetIconsByEName("hatt2"), 0, 0, 32, 32, 5 + 80, 20, 20, 20);
            tipData.AddTextOff(Def.ToString(), "White", 30 + 80);

            tipData.AddTextNewLine("", "White", 20);
            tipData.AddImageXY(HSIcons.GetIconsByEName("hatt5"), 0, 0, 32, 32, 5, 40, 20, 20);
            tipData.AddTextOff(Mov.ToString(), "White", 30);
            tipData.AddImageXY(HSIcons.GetIconsByEName("hatt8"), 0, 0, 32, 32, 5 + 80, 40, 20, 20);
            tipData.AddTextOff(Range.ToString(), "White", 30 + 80);

            tipData.AddTextNewLine("", "White", 20);
            tipData.AddImageXY(HSIcons.GetIconsByEName("hatt7"), 0, 0, 32, 32, 5, 60, 20, 20);
            tipData.AddTextOff(string.Format("{0}/{1}", LeftHp, baseAttr.Hp), "White", 30);

            return(tipData.Image);
        }
Beispiel #21
0
        public void Draw(Graphics g)
        {
            Image back = PicLoader.Read("System", "ShopItemBack.jpg");

            g.DrawImage(back, X, Y, Width - 1, Height - 1);
            back.Dispose();

            if (show)
            {
                GameShopConfig gameShopConfig = ConfigData.GetGameShopConfig(productId);
                var            eid            = HItemBook.GetItemId(gameShopConfig.Item);
                HItemConfig    itemConfig     = ConfigData.GetHItemConfig(eid);
                var            name           = itemConfig.Name;
                var            fontcolor      = HSTypes.I2RareColor(itemConfig.Rare);
                uint           price          = GameResourceBook.OutGoldSellItem(itemConfig.Rare, itemConfig.ValueFactor) * 2;
                if (gameShopConfig.UseDiamond)
                {
                    price = Math.Max(1, price / GameConstants.DiamondToGold);
                }
                Font  fontsong = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Brush brush    = new SolidBrush(Color.FromName(fontcolor));
                g.DrawString(name, fontsong, brush, X + 76, Y + 9);
                brush.Dispose();
                g.DrawString(string.Format("{0,3:D}", price), fontsong, Brushes.PaleTurquoise, X + 80, Y + 37);
                fontsong.Dispose();
                if (gameShopConfig.UseDiamond)
                {
                    g.DrawImage(HSIcons.GetIconsByEName("res8"), X + 110, Y + 35, 16, 16);
                }
                else
                {
                    g.DrawImage(HSIcons.GetIconsByEName("res1"), X + 110, Y + 35, 16, 16);
                }

                vRegion.Draw(g);
            }
        }
Beispiel #22
0
        private void VRegion_CellDraw(int id, int x, int y, int key, Graphics g)
        {
            var dnaConfig = ConfigData.GetPlayerDnaConfig(id);
            var pen       = new Pen(Color.DodgerBlue, 4);
            var halfSize  = 36 / 2;

            if (dnaConfig.LineType == 1)
            {
                g.DrawLine(pen, x + halfSize, y + halfSize, x, y + halfSize);
            }
            else if (dnaConfig.LineType == 2)
            {
                g.DrawLine(pen, x + halfSize, y + halfSize, x + halfSize * 2, y + halfSize);
            }
            else if (dnaConfig.LineType == 3)
            {
                g.DrawLine(pen, x, y + halfSize, x + halfSize * 2, y + halfSize);
            }
            pen.Dispose();

            var img = HSIcons.GetImage("Dna", id);

            g.DrawImage(img, x + 2, y + 2, CellSize - 4, CellSize - 4);
        }
Beispiel #23
0
        public override void DrawOnCardDetail(Graphics g, int offX, int offY)
        {
            SpellConfig spellConfig = spell.SpellConfig;

            CardAssistant.DrawBase(g, spell.Id, offX + 10, offY + 10, 180, 200);

            int basel = 210;

            Font font = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(("★★★★★★★★★★").Substring(10 - spellConfig.Star), font, Brushes.Yellow, offX + 30, offY + 30);
            font.Dispose();
            basel += offY;

            Brush headerBack = new SolidBrush(Color.FromArgb(190, 175, 160));
            Brush lineBack   = new SolidBrush(Color.FromArgb(215, 210, 200));

            g.FillRectangle(headerBack, offX + 10, basel, 180, 20);
            for (int i = 0; i < 1; i++)
            {
                g.FillRectangle(lineBack, offX + 10, basel + 20 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, offX + 10, basel + 40, 180, 20);
            for (int i = 0; i < 3; i++)
            {
                g.FillRectangle(lineBack, offX + 10, basel + 75 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, offX + 10, basel + 150, 180, 20);

            g.FillRectangle(lineBack, offX + 10, basel + 170, 180, 45);
            headerBack.Dispose();
            lineBack.Dispose();

            Font       fontblack = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            Font       fontsong  = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            SolidBrush sb        = new SolidBrush(Color.FromArgb(100, 50, 0));

            g.DrawString(spellConfig.Name, fontblack, Brushes.White, offX + 10, basel + 2);
            g.DrawImage(HSIcons.GetIconsByEName("spl" + (spellConfig.Type - 200 + 1)), 60 + offX, basel - 40, 24, 24);
            g.DrawImage(HSIcons.GetIconsByEName("atr" + spellConfig.Attr), 88 + offX, basel - 40, 24, 24);
            g.DrawString(string.Format("Lv{0:00}", card.Level), fontsong, Brushes.Indigo, 13 + offX, basel + 22);
            g.DrawImage(HSIcons.GetIconsByEName("oth10"), 56 + offX, basel + 22, 14, 14);
            g.DrawString(string.Format("({0}/{1})", card.Exp, ExpTree.GetNextRequiredCard(card.Level)), fontsong, Brushes.RoyalBlue, 70 + offX, basel + 22);
            g.DrawString("数据", fontblack, Brushes.White, offX + 10, basel + 42);
            Adder add = new Adder(basel + 61, 15);

            g.DrawString(string.Format("伤害 {0,3:D}", spell.Damage), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Damage / 5, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("治疗 {0,3:D}", spell.Cure), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Cure / 5, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("持续 {0,3:D}", (int)spell.Time), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)(spell.Time * 10), 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("辅助 {0,3:D}", (int)spell.Help), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)(spell.Help * 10), 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("几率 {0,3:D}", (int)spell.Rate), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)spell.Rate, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("加成 {0,3:D}", spell.Atk), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Atk / 2, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString("效果", fontblack, Brushes.White, offX + 10, basel + 152);
            string des = spell.Descript;

            PaintTool.DrawStringMultiLine(g, fontsong, sb, offX + 10, basel + 61 + 110, 15, 13, des);
            fontblack.Dispose();
            fontsong.Dispose();
            sb.Dispose();
        }
Beispiel #24
0
        public static Image GetPreview(int id)
        {
            TournamentConfig tournamentConfig = ConfigData.GetTournamentConfig(id);

            int[]         awardData    = tournamentConfig.Awards;
            RLIdValueList resourceData = tournamentConfig.Resource;

            int wid = 175;
            int heg = awardData.Length * 16;

            wid += 5; heg += 5;
            heg += 16 * 4 + 50;
            Bitmap   bmp = new Bitmap(wid, heg);
            Graphics g   = Graphics.FromImage(bmp);

            g.FillRectangle(Brushes.Black, 0, 0, wid, heg);
            g.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 30)), 0, 0, wid, 18);
            Pen pen = new Pen(Brushes.Gray, 2);

            g.DrawRectangle(pen, 1, 1, wid - 3, heg - 3);
            pen.Dispose();

            int  y         = 3;
            Font fontsong  = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontsongB = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            g.DrawString("赛事名", fontsongB, Brushes.LightGray, 3, y);
            g.DrawString(tournamentConfig.Name, fontsong, Brushes.White, 53, y);
            y += 16;
            g.DrawString("比赛时间", fontsongB, Brushes.LightGray, 3, y);

            //     g.DrawString(string.Format("{0}-{1}", HSTime.GetByDate(begin_date).ToShortString(), HSTime.GetByDate(end_date).ToShortString()), fontsong, Brushes.LightGreen, 66, y);
            y += 16;
            g.DrawString("比赛地图", fontsongB, Brushes.LightGray, 3, y);
            Image mapback = BattleMapBook.GetMapImage(tournamentConfig.Map, TileConfig.Indexer.DefaultTile);

            g.DrawImage(mapback, new Rectangle(70, y, 100, 50), new Rectangle(0, 25, 100, 50), GraphicsUnit.Pixel);
            mapback.Dispose();
            y += 50;
            g.DrawString("等级限制", fontsongB, Brushes.LightGray, 3, y);
            g.DrawString(string.Format("{0}-{1}", tournamentConfig.MinLevel, tournamentConfig.MaxLevel), fontsong, Brushes.LightPink, 66, y);
            y += 16;
            g.DrawString("比赛奖励", fontsongB, Brushes.LightGray, 3, y);
            y += 16;
            for (int i = 0; i < awardData.Length; i++)
            {
                g.DrawString(string.Format("第{0}名 {1}积分", i + 1, awardData[i].ToString().PadLeft(2, ' ')), fontsong, Brushes.White, 33, y);
                if (i < resourceData.Count)
                {
                    if (resourceData[i].Id == 99)
                    {
                        g.DrawString(resourceData[i].Value.ToString().PadLeft(2, ' '), fontsong, Brushes.Cyan, 123, y);
                        g.DrawImage(HSIcons.GetIconsByEName("res8"), 143, y, 16, 16);
                    }
                    else
                    {
                        Brush brush = new SolidBrush(Color.FromName(HSTypes.I2ResourceColor(resourceData[i].Id)));
                        g.DrawString(resourceData[i].Value.ToString().PadLeft(2, ' '), fontsong, brush, 123, y);
                        g.DrawImage(HSIcons.GetIconsByEName("res" + (resourceData[i].Id + 1)), 143, y, 14, 14);
                        brush.Dispose();
                    }
                }
                y += 16;
            }
            fontsong.Dispose();
            fontsongB.Dispose();
            g.Dispose();
            return(bmp);
        }
Beispiel #25
0
        private void DrawMoveRegion(PaintEventArgs e)
        {
            if (savedPath != null && savedPath.Count > 0)
            {
                Font ft = new Font("宋体", 11, FontStyle.Bold);
                TileManager.PathResult mouseTarget = null;
                foreach (var pathResult in savedPath)
                {
                    var px = pathResult.NowCell.X * TileManager.CellSize - baseX;
                    var py = pathResult.NowCell.Y * TileManager.CellSize - baseY;
                    e.Graphics.DrawImage(HSIcons.GetSystemImage(stage == ControlStage.SelectMove ? "rgmove" : "rgattack"), px, py, TileManager.CellSize, TileManager.CellSize);
                    if (stage == ControlStage.AttackSelect)
                    {
                        var tileConfig = tileManager.GetTile(pathResult.NowCell.X, pathResult.NowCell.Y);
                        if (tileConfig.Camp > 0 && tileConfig.Camp != (byte)ConfigDatas.CampConfig.Indexer.Reborn)
                        {
                            e.Graphics.DrawImage(HSIcons.GetSystemImage("rgtarget"), px, py, TileManager.CellSize, TileManager.CellSize);
                        }
                    }

                    if (pathResult.NowCell.X == selectCellPos.X && pathResult.NowCell.Y == selectCellPos.Y)
                    {
                        mouseTarget = pathResult;
                    }

#if DEBUG
                    e.Graphics.DrawString(pathResult.MovLeft.ToString(), ft, Brushes.Black, px, py);
                    if (pathResult.Parent.X == pathResult.NowCell.X + 1)
                    {
                        e.Graphics.DrawString("←", ft, Brushes.Black, px, py + 15);
                    }
                    else if (pathResult.Parent.X == pathResult.NowCell.X - 1)
                    {
                        e.Graphics.DrawString("→", ft, Brushes.Black, px, py + 15);
                    }
                    else if (pathResult.Parent.Y == pathResult.NowCell.Y + 1)
                    {
                        e.Graphics.DrawString("↑", ft, Brushes.Black, px, py + 15);
                    }
                    else if (pathResult.Parent.Y == pathResult.NowCell.Y - 1)
                    {
                        e.Graphics.DrawString("↓", ft, Brushes.Black, px, py + 15);
                    }
#endif
                }
                ft.Dispose();

                if (stage == ControlStage.SelectMove && mouseTarget != null) //绘制移动路径
                {
                    while (mouseTarget.Parent.X >= 0)
                    {
                        e.Graphics.DrawLine(Pens.White,
                                            mouseTarget.NowCell.X * TileManager.CellSize - baseX + TileManager.CellSize / 2,
                                            mouseTarget.NowCell.Y * TileManager.CellSize - baseY + TileManager.CellSize / 2
                                            , mouseTarget.Parent.X * TileManager.CellSize - baseX + TileManager.CellSize / 2,
                                            mouseTarget.Parent.Y * TileManager.CellSize - baseY + TileManager.CellSize / 2);

                        mouseTarget = savedPath.Find(cell =>
                                                     cell.NowCell.X == mouseTarget.Parent.X && cell.NowCell.Y == mouseTarget.Parent.Y);
                    }
                }
            }
        }
Beispiel #26
0
        private IEnumerator DelayAttack(BaseSam atkUnit, BaseSam targetUnit)
        {
            yield return(new NLWaitForSeconds(0.2f));

            var unitPos  = new Point(targetUnit.X * TileManager.CellSize - baseX, targetUnit.Y * TileManager.CellSize - baseY);
            var unitSize = new Size(TileManager.CellSize, TileManager.CellSize);

            if (targetUnit.OnAttack(atkUnit))
            {
                var effectDie = new StaticUIImageEffect(EffectBook.GetEffect("shrink"), HSIcons.GetImage("Samurai", targetUnit.Cid), unitPos, unitSize);
                effectRun.AddEffect(effectDie);
            }

            if (atkUnit.Camp == (byte)ConfigDatas.CampConfig.Indexer.Reborn) //todo 略ws
            {
                stage = ControlStage.None;
            }

            atkUnit.IsFinished = true;//攻击并结束回合
            OnUnitFinish();
        }
Beispiel #27
0
        private void DrawOnDeckView(Graphics g, DeckCard card, int x, int y, bool isSelected, string attr)
        {
            CardAssistant.DrawBase(g, card.BaseId, x, y, cardWidth, cardHeight);
            if (isSelected)
            {
                var brushes = new SolidBrush(Color.FromArgb(130, Color.Yellow));
                g.FillRectangle(brushes, x, y, cardWidth, cardHeight);
                brushes.Dispose();
            }

            if (card.BaseId <= 0)
            {
                return;
            }

            var  cardConfigData = CardConfigManager.GetCardConfig(card.BaseId);
            Font font           = new Font("宋体", 5 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), font, Brushes.Yellow, x + 3, y + 3);
            font.Dispose();

            var quality = cardConfigData.Quality + 1;

            g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + cardWidth / 2 - 8, y + cardHeight - 20, 16, 16);

            var jobId = cardConfigData.JobId;

            if (jobId > 0)
            {
                var   jobConfig = ConfigData.GetJobConfig(jobId);
                Brush brush     = new SolidBrush(Color.FromName(jobConfig.Color));
                g.FillRectangle(brush, x + cardWidth - 24, y + 4, 20, 20);
                g.DrawImage(HSIcons.GetIconsByEName("job" + jobConfig.JobIndex), x + cardWidth - 24, y + 4, 20, 20);
                brush.Dispose();
            }

            if (attr.Contains("D"))
            {
                Image mark = PicLoader.Read("System", "MarkSelect.PNG");
                g.DrawImage(mark, x + cardWidth - 21, y + cardHeight - 25, 21, 25);
                if (attr.Contains("DD"))//2张出战
                {
                    g.DrawImage(mark, x + cardWidth - 21, y + cardHeight - 25 - 15, 21, 25);
                }
                mark.Dispose();
            }
            if (attr.Contains("N"))
            {
                Image mark = PicLoader.Read("System", "MarkNew.PNG");
                g.DrawImage(mark, x, y, 30, 30);
                mark.Dispose();
            }

            g.FillEllipse(Brushes.Black, x + 3, y + 4 + cardHeight - 26, 16, 16);
            Font   fontsong = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            string text     = string.Format("{0:00}", card.Level);

            g.DrawString(text, fontsong, Brushes.Yellow, x + 4, y + 4 + cardHeight - 23);
            if (card.Exp >= ConfigData.GetLevelExpConfig(card.Level).CardExp)//可以升级
            {
                g.DrawString(text, fontsong, Brushes.Lime, x + 4, y + 4 + cardHeight - 23);
                Image mark = PicLoader.Read("System", "ArrowU.PNG");
                g.DrawImage(mark, x + 2, y + 4 + cardHeight - 43, 18, 16);
                mark.Dispose();
            }
            fontsong.Dispose();
        }
Beispiel #28
0
        private void LifeClock_Paint(object sender, PaintEventArgs e)
        {
            if (back == null)//在editor模式下就不绘制了
            {
                return;
            }
            e.Graphics.DrawImage(back, 0, 0, Width, Height);
            if (head != null)
            {
                if (IsLeft)
                {
                    e.Graphics.DrawImage(head, 4, 3, 63, 64);
                }
                else
                {
                    e.Graphics.DrawImage(head, Width - 67, 3, 63, 64);
                }
            }
            PlayerManaTypes        nextAimMana = PlayerManaTypes.None;
            List <PlayerManaTypes> manaQueue   = null;
            float roundRate = 0;

            if (player != null)
            {
                nextAimMana = player.EnergyGenerator.NextAimMana;
                manaQueue   = player.EnergyGenerator.QueuedMana;
                roundRate   = player.GetRoundRate();
            }

            Brush b1  = new LinearGradientBrush(new Rectangle(0, 18, 500, 10), Color.FromArgb(255, 120, 120), Color.FromArgb(255, 0, 0), LinearGradientMode.Vertical);
            Brush b2  = new LinearGradientBrush(new Rectangle(0, 30, 500, 10), Color.FromArgb(120, 120, 255), Color.FromArgb(0, 0, 255), LinearGradientMode.Vertical);
            Pen   pen = new Pen(Brushes.Black, 2);

            if (IsLeft)
            {
                if (manaQueue != null)
                {
                    for (int i = 0; i < manaQueue.Count; i++)
                    {
                        e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)manaQueue[i]), 78 - 7, 12 + i * 7, 17, 6);
                    }
                }
                if (nextAimMana != PlayerManaTypes.None)
                {
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("mix" + (int)nextAimMana), 78, 10, 30, 30);
                }
                var destRegion = new Rectangle(78, 10, 30, (int)(30 * (1 - roundRate)));
                e.Graphics.DrawImage(HSIcons.GetIconsByEName("mix0"), destRegion, 0, 0, 32, 32 * (1 - roundRate), GraphicsUnit.Pixel);
                if (player != null)
                {
                    for (int i = 0; i < player.EnergyGenerator.LimitMp; i++)
                    {
                        if (i < player.Mp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Mp), 112 + 24 * i, 10, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, 112 + 24 * i, 10, 22, 8);
                    }
                    for (int i = 0; i < player.EnergyGenerator.LimitPp; i++)
                    {
                        if (i < player.Pp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Pp), 112 + 24 * i, 20, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, 112 + 24 * i, 20, 22, 8);
                    }
                    for (int i = 0; i < player.EnergyGenerator.LimitLp; i++)
                    {
                        if (i < player.Lp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Lp), 112 + 24 * i, 30, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, 112 + 24 * i, 30, 22, 8);
                    }
                }
            }
            else
            {
                if (manaQueue != null)
                {
                    for (int i = 0; i < manaQueue.Count; i++)
                    {
                        e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)manaQueue[i]), Width - 108 + 20, 12 + i * 7, 17, 6);
                    }
                }
                if (nextAimMana != PlayerManaTypes.None)
                {
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("mix" + (int)nextAimMana), Width - 108, 10, 30, 30);
                }
                var destRegion = new Rectangle(Width - 108, 10, 30, (int)(30 * (1 - roundRate)));
                e.Graphics.DrawImage(HSIcons.GetIconsByEName("mix0"), destRegion, 0, 0, 32, 32 * (1 - roundRate), GraphicsUnit.Pixel);

                if (player != null)
                {
                    for (int i = 0; i < player.EnergyGenerator.LimitMp; i++)
                    {
                        if (i < player.Mp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Mp), Width - 134 - 24 * i, 10, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, Width - 134 - 24 * i, 10, 22, 8);
                    }
                    for (int i = 0; i < player.EnergyGenerator.LimitPp; i++)
                    {
                        if (i < player.Pp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Pp), Width - 134 - 24 * i, 20, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, Width - 134 - 24 * i, 20, 22, 8);
                    }
                    for (int i = 0; i < player.EnergyGenerator.LimitLp; i++)
                    {
                        if (i < player.Lp)
                        {
                            e.Graphics.FillRectangle(PaintTool.GetBrushByManaType((int)PlayerManaTypes.Lp), Width - 134 - 24 * i, 30, 22, 8);
                        }
                        e.Graphics.DrawRectangle(Pens.Gray, Width - 134 - 24 * i, 30, 22, 8);
                    }
                }
            }
            pen.Dispose();
            b1.Dispose();
            b2.Dispose();
            Font font  = new Font("幼圆", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            int  lenth = (int)e.Graphics.MeasureString(nameStr, font).Width;

            e.Graphics.DrawString(nameStr, font, Brushes.White, IsLeft ? 72 : Width - 72 - lenth, 44);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("tsk7"), IsLeft ? Width - 75 : 30, 44, 18, 18);//画剩余卡牌数
            if (player != null)
            {
                e.Graphics.DrawString(player.Cards.LeftCount.ToString(), font, Brushes.White, IsLeft ? Width - 52 : 53, 44);
                if (player.TrapHolder.Count > 0)
                {
                    var icon = HSIcons.GetIconsByEName("tsk6");
                    for (int i = 0; i < player.TrapHolder.Count; i++)
                    {
                        e.Graphics.DrawImage(icon, (IsLeft ? Width - 120 : 80) + i * 8, 44, 18, 18);
                    }
                }
            }
            font.Dispose();
        }
Beispiel #29
0
        public static Image GetPreview(int id)
        {
            HItemConfig hItemConfig = ConfigData.GetHItemConfig(id);

            if (hItemConfig.Id <= 0)
            {
                return(DrawTool.GetImageByString("unknown", 100));
            }

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(hItemConfig.Name, HSTypes.I2RareColor(hItemConfig.Rare), 20);
            if (hItemConfig.IsUsable)
            {
                if (hItemConfig.SubType == HItemTypes.Fight)
                {
                    tipData.AddTextNewLine("       战斗中双击使用", "Red");
                }
                else if (hItemConfig.SubType == HItemTypes.Seed)
                {
                    tipData.AddTextNewLine("       农场中双击使用", "Red");
                }
                else
                {
                    tipData.AddTextNewLine("       双击使用", "Green");
                }
            }
            else if (hItemConfig.SubType == HItemTypes.Task)
            {
                tipData.AddTextNewLine("       任务物品", "DarkBlue");
            }
            else if (hItemConfig.SubType == HItemTypes.Material)
            {
                tipData.AddTextNewLine(string.Format("       材料(稀有度:{0})", hItemConfig.Rare), "White");
            }
            else
            {
                tipData.AddTextNewLine("", "White");
            }
            tipData.AddTextNewLine(string.Format("       等级:{0}", hItemConfig.Level), "White");
            tipData.AddTextNewLine("", "White");
            tipData.AddTextLines(hItemConfig.Descript, "White", 20, true);
            if (hItemConfig.SubType == HItemTypes.RandomCard)
            {
                var consumerConfig = ConfigData.GetItemConsumerConfig(hItemConfig.Id);
                int totalRate      = 0;
                foreach (var rate in consumerConfig.RandomCardRate)
                {
                    totalRate += rate;
                }
                tipData.AddLine();
                tipData.AddTextNewLine("抽卡概率", "White");
                tipData.AddTextNewLine("", "White");
                tipData.AddImage(HSIcons.GetIconsByEName("gem5"));
                tipData.AddText(string.Format("{0:0}%  ", (float)consumerConfig.RandomCardRate[3] * 100 / totalRate), "White");
                tipData.AddImage(HSIcons.GetIconsByEName("gem4"));
                tipData.AddText(string.Format("{0:0}%  ", (float)consumerConfig.RandomCardRate[2] * 100 / totalRate), "White");
                tipData.AddLine();
            }
            tipData.AddTextNewLine(string.Format("出售价格:{0}", GameResourceBook.InGoldSellItem(hItemConfig.Rare, hItemConfig.ValueFactor)), "Yellow");
            tipData.AddImage(HSIcons.GetIconsByEName("res1"));
            tipData.AddImageXY(GetHItemImage(id), 8, 8, 48, 48, 7, 24, 32, 32);

            return(tipData.Image);
        }
Beispiel #30
0
        private void ItemForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("我的物品", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (!show)
            {
                return;
            }

            if (isDirty)
            {
                tempImage.Dispose();
                tempImage = new Bitmap(324, 324);
                Graphics g   = Graphics.FromImage(tempImage);
                Image    img = PicLoader.Read("System", "ItemBackDown.jpg");
                g.DrawImage(img, 0, 0, 324, 324);
                img.Dispose();
                font = new Font("Aril", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                for (int i = 0; i < CellCountPerPage; i++)
                {
                    if (baseid + i < UserProfile.InfoBag.BagCount)
                    {
                        IntPair thing = UserProfile.InfoBag.Items[baseid + i];
                        if (thing.Type != 0)
                        {
                            var itemConfig = ConfigData.GetHItemConfig(thing.Type);
                            g.DrawImage(HItemBook.GetHItemImage(thing.Type), (i % 10) * 31.2f + 5, (i / 10) * 31.8f + 3, 30.0f, 30.0f);
                            g.DrawString(thing.Value.ToString(), font, Brushes.Black, (i % 10) * 31.2f + 8, (i / 10) * 31.8f + 14);
                            g.DrawString(thing.Value.ToString(), font, thing.Value == itemConfig.MaxPile ? Brushes.Tomato : Brushes.White, (i % 10) * 31.2f + 7, (i / 10) * 31.8f + 13);

                            var pen = new Pen(Color.FromName(HSTypes.I2RareColor(itemConfig.Rare)), 2);
                            g.DrawRectangle(pen, (i % 10) * 31.2f + 5, (i / 10) * 31.8f + 3, 30.0f, 30.0f);
                            pen.Dispose();
                        }
                    }
                    else
                    {
                        g.DrawImage(HSIcons.GetIconsByEName("oth3"), (i % 10) * 31.2f + 8, (i / 10) * 31.8f + 4, 24.0f, 24.0f);
                    }
                }
                font.Dispose();
                g.Dispose();
                isDirty = false;
            }
            e.Graphics.DrawImage(tempImage, 6, 36);

            Brush brush = new SolidBrush(Color.FromArgb(150, Color.Yellow));

            for (int i = 0; i < itemCdRate.Length; i++)
            {
                if (itemCdRate[i] > 0)
                {
                    e.Graphics.FillRectangle(brush, (i % 10) * 31.2f + 5 + 6, (i / 10) * 31.8f + 3 + 36, 30, 30 * (100 - itemCdRate[i]) / 100);
                }
            }

            brush.Dispose();

            int rect = tar;

            if (rect >= 0)
            {
                if (baseid + rect < UserProfile.InfoBag.BagCount)
                {
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Yellow));
                    e.Graphics.FillRectangle(yellowbrush, (rect % 10) * 31.2f + 11, (rect / 10) * 31.8f + 39, 30.0f, 30.0f);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Yellow, 2);
                    e.Graphics.DrawRectangle(yellowpen, (rect % 10) * 31.2f + 11, (rect / 10) * 31.8f + 39, 30.0f, 30.0f);
                    yellowpen.Dispose();
                }
                else
                {
                    int tpoff = rect;
                    while (tpoff >= 0 && baseid + tpoff >= UserProfile.InfoBag.BagCount)
                    {
                        e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth4"), (tpoff % 10) * 31.2f + 14, (tpoff / 10) * 31.8f + 40, 24f, 24f);
                        tpoff--;
                    }
                }
            }
        }