Esempio n. 1
0
        public void Draw(Graphics g)
        {
            SolidBrush sb = new SolidBrush(backColor);

            g.FillRectangle(sb, x, y, width, height);
            sb.Dispose();
            g.DrawRectangle(Pens.White, x, y, width - 1, height - 1);

            if (show)
            {
                HItemConfig itemConfig = ConfigData.GetHItemConfig(itemId);

                Font  font  = new Font("微软雅黑", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Brush brush = new SolidBrush(Color.FromName(HSTypes.I2RareColor(itemConfig.Rare)));
                g.DrawString(itemConfig.Name, font, brush, x + 57, y + 7);
                brush.Dispose();

                g.DrawString(price.ToString(), font, Brushes.Gold, x + 57, y + 30);
                g.DrawImage(HSIcons.GetIconsByEName("res1"), g.MeasureString(price.ToString(), font).Width + 57 + x, y + 32, 16, 16);

                virtualRegion.Draw(g);
                g.DrawString(itemCount.ToString(), font, Brushes.Black, x + 30, y + 29);
                g.DrawString(itemCount.ToString(), font, Brushes.White, x + 29, y + 28);

                font.Dispose();

                if (!bitmapButtonBuy.Visible)
                {
                    font = new Font("微软雅黑", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    g.DrawString("完成", font, Brushes.LightGreen, x + 152, y + 30);
                    font.Dispose();
                }
            }
        }
Esempio n. 2
0
        private void PopMenuBase_Paint(object sender, PaintEventArgs e)
        {
            Font fontsong = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            int  index    = 0;

            foreach (var menuItemData in datas)
            {
                if (selectIndex == menuItemData.Id)
                {
                    e.Graphics.FillRectangle(Brushes.DeepSkyBlue, menuItemData.Position.X, menuItemData.Position.Y, menuItemData.Size.Width, menuItemData.Size.Height);
                }

                var imgOff = 0;
                if (menuItemData.Icon != "")
                {
                    var iconImg = HSIcons.GetIconsByEName(menuItemData.Icon);
                    e.Graphics.DrawImage(iconImg, menuItemData.Position.X + 3, menuItemData.Position.Y + 2, 14, 14);
                    imgOff += 16;
                }
                Brush b = new SolidBrush(Color.FromName(menuItemData.Color));
                e.Graphics.DrawString(menuItemData.Text, fontsong, b, imgOff + 3 + menuItemData.Position.X, 2 + menuItemData.Position.Y);
                b.Dispose();
                index++;
            }
            fontsong.Dispose();
        }
Esempio n. 3
0
        public void Draw(Graphics g)
        {
            Image back = PicLoader.Read("System", "CardBack2.JPG");

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

            if (show)
            {
                //   g.FillRectangle(PaintTool.GetBrushByAttribute(CardConfigManager.GetCardConfig(product.Cid).Attr), x + 10, y + 12, 70 - 2, 90 - 2);

                virtualRegion.Draw(g);

                CardAssistant.DrawBase(g, product.Cid, x + 12, y + 14, 64, 84);

                if (coverEffect != null)
                {
                    coverEffect.Draw(g);
                }

                if ((CardProductMarkTypes)product.Mark != CardProductMarkTypes.Null)
                {
                    Image marker = PicLoader.Read("System", string.Format("Mark{0}.PNG", (int)product.Mark));
                    g.DrawImage(marker, x + 28, y + 12, 50, 51);
                    marker.Dispose();
                }

                var cardConfigData = CardConfigManager.GetCardConfig(product.Cid);
                var quality        = cardConfigData.Quality + 1;
                g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + width / 2 - 8, y + height - 44, 16, 16);
            }
        }
Esempio n. 4
0
        private void CalculateRequire()
        {
            int index = 1;

            winRate        = config.ChooseWinRate * (10 - hardness) / 10;
            rollItemSpeedX = MathTool.GetRandom(40, 70);

            if (config.ChooseFood > 0)
            {
                int foodCost = (int)GameResourceBook.OutFoodSceneQuest(config.ChooseFood, true);
                var region   = ComplexRegion.GetResButtonRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25 + 70), 60, ImageRegionCellType.Food, -foodCost);
                region.Parm = ImageRegionCellType.Food;
                vRegion.AddRegion(region);
                index++;
            }

            if (config.ChooseGold > 0)
            {
                int goldCost = (int)GameResourceBook.OutGoldSceneQuest(level, config.ChooseGold, true);
                var region   = ComplexRegion.GetResButtonRegion(index, new Point(pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25 + 70), 60, ImageRegionCellType.Gold, -goldCost);
                region.Parm = ImageRegionCellType.Gold;
                vRegion.AddRegion(region);
                index++;
            }

            var button = new ButtonRegion(20, pos.X + 3 + 20 + (index - 1) * 70, pos.Y + 3 + 25 + 70, 60, 60, "iconbg.jpg", "");

            button.AddDecorator(new RegionImageDecorator(HSIcons.GetIconsByEName("rot7"), 60 / 2));
            vRegion.AddRegion(button);
        }
Esempio n. 5
0
        public void Draw(Graphics g)
        {
            SolidBrush sb = new SolidBrush(Color.FromArgb(20, 20, 20));

            g.FillRectangle(sb, x + 2, y + 2, width - 4, height - 4);
            sb.Dispose();
            g.DrawRectangle(Pens.Teal, x + 2, y + 2, width - 4, height - 4);

            if (show)
            {
                var equipConfig = ConfigData.GetEquipConfig(equipId);

                virtualRegion.Draw(g);

                var   cost = GameResourceBook.OutStoneMerge(equipConfig.Quality + 1, equipConfig.Level);
                Font  ft   = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Brush b    = new SolidBrush(Color.FromName(HSTypes.I2QualityColor(equipConfig.Quality)));
                g.DrawString(equipConfig.Name, ft, b, x + 90, y + 10);
                b.Dispose();
                g.DrawString(string.Format("{0}", cost), ft, Brushes.White, x + 90 + 20, y + 32);
                ft.Dispose();

                g.DrawImage(HSIcons.GetIconsByEName("res3"), x + 90, y + 32 - 3, 18, 18);
            }
        }
Esempio n. 6
0
        public void Draw(Graphics g)
        {
            g.DrawRectangle(Pens.White, x, y, width - 1, height - 1);

            if (show)
            {
                Font font    = new Font("微软雅黑", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                var  isEquip = ConfigIdManager.IsEquip(itemId);
                if (!isEquip)
                {
                    HItemConfig itemConfig = ConfigData.GetHItemConfig(itemId);

                    Brush brush = new SolidBrush(Color.FromName(HSTypes.I2RareColor(itemConfig.Rare)));
                    g.DrawString(itemConfig.Name, font, brush, x + 50, y + 7);
                    brush.Dispose();
                }
                else
                {
                    EquipConfig equipConfig = ConfigData.GetEquipConfig(itemId);

                    Brush brush = new SolidBrush(Color.FromName(HSTypes.I2RareColor(equipConfig.Quality)));
                    g.DrawString(equipConfig.Name, font, brush, x + 50, y + 7);
                    brush.Dispose();
                }
                g.DrawString(price.ToString(), font, Brushes.Gold, x + 50, y + 30);
                g.DrawImage(HSIcons.GetIconsByEName("res" + (priceType + 1)), g.MeasureString(price.ToString(), font).Width + 50 + x, 32 + y, 16, 16);
                font.Dispose();

                virtualRegion.Draw(g);
            }
        }
Esempio n. 7
0
        private void MGOvercome_Paint(object sender, PaintEventArgs e)
        {
            DrawBase(e.Graphics);

            if (!show)
            {
                return;
            }

            virtualRegion.Draw(e.Graphics);

            var left = HSIcons.GetIconsByEName(GetIcon(myChoice));

            e.Graphics.DrawImage(left, 50, 160, 80, 80);

            var right = HSIcons.GetIconsByEName(GetIcon(rivalChoice));

            e.Graphics.DrawImage(right, 220, 160, 80, 80);

            var font = new Font("宋体", 26 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            DrawShadeText(e.Graphics, string.Format(string.Format("{0}战 {1}分", round, score)), font, Brushes.White, 90 + xoff, 140 + yoff);
            font.Dispose();

            if (state != WinState.None)
            {
                font = new Font("宋体", 26 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                DrawShadeText(e.Graphics, state.ToString(), font, Brushes.White, 130, 190);
                font.Dispose();
            }
        }
Esempio n. 8
0
        private void CalculateRequire()
        {
            int            index = 1;
            List <IntPair> items;

            if (config.PayKey == null || config.PayKey.Length == 0)
            {
                items = ArraysUtils.GetSubArray(UserProfile.InfoBag.GetItemCountByType((int)HItemTypes.Material), 0, 13);
            }
            else
            {
                string pickKey = config.PayKey[MathTool.GetRandom(config.PayKey.Length)];
                items = ArraysUtils.GetSubArray(UserProfile.InfoBag.GetItemCountByAttribute(pickKey), 0, 13);
            }
            for (int i = 0; i < items.Count; i++)
            {
                var region = new ButtonRegion(index, pos.X + 3 + 20 + (index - 1) % 7 * 70, pos.Y + 3 + 25 + (index - 1) / 7 * 70, 60, 60, HItemBook.GetHItemImage(items[i].Type));
                region.SetKeyValue(items[i].Type);
                region.AddDecorator(new RegionTextDecorator(37, 42, 12, Color.White, true, items[i].Value.ToString()));
                vRegion.AddRegion(region);
                index++;
            }

            var button = new ButtonRegion(20, pos.X + 3 + 20 + (index - 1) % 7 * 70, pos.Y + 3 + 25 + (index - 1) / 7 * 70, 60, 60, "iconbg.jpg", "");

            button.AddDecorator(new RegionImageDecorator(HSIcons.GetIconsByEName("rot7"), 60 / 2));
            vRegion.AddRegion(button);
        }
Esempio n. 9
0
            public void Draw(Graphics g, int tick)
            {
                var img = HSIcons.GetIconsByEName(this.icon);

                switch (danceType)
                {
                case TextDanceTypes.Normal:
                    g.DrawImage(img, x, y, width, width); break;

                case TextDanceTypes.Jump:
                    g.DrawImage(img, x, y + (int)(Math.Sin((double)(tick) / 2) * 5), width, width); break;

                case TextDanceTypes.Shake:
                    g.DrawImage(img, x + (int)(Math.Sin((double)(tick)) * 5), y + (float)(MathTool.GetRandom(0f, 1) * 2), width, width); break;

                case TextDanceTypes.Lovely:
                    g.DrawImage(img, x, y + (int)(Math.Sin(Math.Tan((double)(tick) / 2)) * 3), width, width); break;

                case TextDanceTypes.Random:
                    var rd = MathTool.GetRandom(0, 16); g.DrawImage(img, x + (rd / 4) - 2, y + (rd % 4) - 2, width, width); break;

                case TextDanceTypes.Stripe:
                    g.DrawImage(img, x + (int)(Math.Sin((double)(tick) / 2) * 5), y + (int)(Math.Sin((double)(tick) / 2) * 5), width, width); break;

                case TextDanceTypes.UpDown:
                    g.DrawImage(img, x, y + (int)(Math.Sin((double)(tick) / 3) * 5), width, width); break;

                case TextDanceTypes.UpdownUniform:
                    g.DrawImage(img, x, y + (int)(Math.Sin((double)(tick) / 3) * 5), width, width); break;

                case TextDanceTypes.LeftRightUniform:
                    g.DrawImage(img, x + (int)(Math.Sin((double)(tick) / 3) * 5), y, width, width); break;
                }
            }
Esempio n. 10
0
        private static Image GetPreview(int id)
        {
            SceneConfig sceneConfig = ConfigData.GetSceneConfig(id);

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(sceneConfig.Name, "Lime", 20);
            tipData.AddTextNewLine(string.Format("地图等级: {0}", sceneConfig.Level), sceneConfig.Level > UserProfile.InfoBasic.Level?"Red": "White");

            string[] icons = SceneBook.GetNPCIconsOnMap(id);
            if (icons.Length > 0)
            {
                tipData.AddTextNewLine("设施", "Green");
                foreach (string icon in icons)
                {
                    tipData.AddImage(HSIcons.GetIconsByEName(icon));
                }
            }

            if (sceneConfig.Func != "")
            {
                tipData.AddTextNewLine("特色", "Pink");
                string[] funcs = sceneConfig.Func.Split(';');
                foreach (string fun in funcs)
                {
                    tipData.AddImage(HSIcons.GetIconsByEName(string.Format("npc{0}", fun.ToLower())));
                }
            }
            return(tipData.Image);
        }
Esempio n. 11
0
        private int speed;          //当前的速度模式

        public MGRacing()
        {
            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 < 3; i++)
            {
                ButtonRegion region = new ButtonRegion(i + 1, 40 + 70 * i, 310, 50, 50, "GameBackNormal1.png", "GameBackNormal1On.png");
                region.AddDecorator(new RegionTextDecorator(10, 20, 10, txt[i]));
                vRegion.AddRegion(region);
            }
            var region2 = new ButtonRegion(4, 40 + 55 * 4, 310, 50, 50, "GameBackNormal2.png", "GameBackNormal1On.png");

            region2.AddDecorator(new RegionTextDecorator(10, 20, 10, "氮气"));
            vRegion.AddRegion(region2);

            vRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClicked);
        }
Esempio n. 12
0
        public void Draw(Graphics g)
        {
            if (datas.Count <= 0)
            {
                return;
            }

            Font fontsong = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            int  index    = 0;

            foreach (var menuItemData in datas)
            {
                g.FillRectangle(selectIndex == menuItemData.Id - 1 ? Brushes.DeepSkyBlue : Brushes.Black,
                                menuItemData.Position.X + baseX, menuItemData.Position.Y + baseY, menuItemData.Size.Width, menuItemData.Size.Height);

                var imgOff = 0;
                if (menuItemData.Icon != "")
                {
                    var iconImg = HSIcons.GetIconsByEName(menuItemData.Icon);
                    g.DrawImage(iconImg, menuItemData.Position.X + 3 + baseX, menuItemData.Position.Y + 2 + baseY, 14, 14);
                    imgOff += 16;
                }

                using (Brush b = new SolidBrush(Color.FromName(menuItemData.Color)))
                    g.DrawString(menuItemData.Text, fontsong, b, imgOff + 3 + menuItemData.Position.X + baseX, 2 + menuItemData.Position.Y + baseY);

                index++;
            }
            fontsong.Dispose();

            g.DrawRectangle(Pens.DimGray, baseX, baseY, width, height);
        }
Esempio n. 13
0
        private void MessageBoxEx_Paint(object sender, PaintEventArgs e)
        {
            virtualRegion.Draw(e.Graphics);

            string itemname;
            var    isEquip = ConfigIdManager.IsEquip(itemid);

            if (!isEquip)
            {
                itemname = ConfigDatas.ConfigData.GetHItemConfig(itemid).Name;
            }
            else
            {
                itemname = ConfigDatas.ConfigData.GetEquipConfig(itemid).Name;
            }
            Font  font  = new Font("微软雅黑", 10 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            Brush brush = new SolidBrush(Color.FromName(fontcolor));

            e.Graphics.DrawString(itemname, font, brush, 134, 52);
            brush.Dispose();
            e.Graphics.DrawString("数量", font, Brushes.White, 69, 106);
            e.Graphics.DrawString("总价", font, Brushes.White, 69, 138);
            font.Dispose();
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("res8"), 212, 140, 16, 16);
        }
Esempio n. 14
0
        private void DrawOnCardView(Graphics g, int cid, int x, int y, bool isSelected)
        {
            CardAssistant.DrawBase(g, cid, x, y, cardWidth, cardHeight);
            if (isSelected)
            {
                var brushes = new SolidBrush(Color.FromArgb(130, Color.Yellow));
                g.FillRectangle(brushes, x, y, cardWidth, cardHeight);
                brushes.Dispose();
            }

            var  cardConfigData = CardConfigManager.GetCardConfig(cid);
            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();
            }
        }
Esempio n. 15
0
        private void NpcTalkForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            if (showImage)
            {
                Font font2 = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                e.Graphics.DrawString(string.Format("{0}(Lv{1})", config.Name, eventLevel), font2, Brushes.White, Width / 2 - 40, 8);
                font2.Dispose();

                e.Graphics.DrawImage(SceneBook.GetSceneQuestImage(config.Id), 15, 40, 140, 140);
                Image border = PicLoader.Read("Border", "questb1.PNG"); //边框
                e.Graphics.DrawImage(border, 15, 40, 140, 140);
                border.Dispose();

                if (evtItem != null)
                {
                    evtItem.Draw(e.Graphics);
                }

                colorWord.Draw(e.Graphics);

                if (answerList != null && (evtItem == null || evtItem.RunningState != TalkEventItem.TalkEventState.Running))
                {
                    Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    int  id   = 0;
                    foreach (var word in answerList)
                    {
                        if (id == tar)
                        {
                            e.Graphics.FillRectangle(Brushes.DarkBlue, 10, id * 20 + Height - 10 - answerList.Count * 20, Width - 20, 20);
                        }

                        int textOff = 20;
                        if (!string.IsNullOrEmpty(word.Prefix))
                        {
                            string icon = "";
                            if (word.Prefix.StartsWith("quest"))
                            {
                                icon = "npc5";
                            }
                            if (word.Prefix.StartsWith("rival"))
                            {
                                icon = "tsk1";
                            }
                            if (icon != "")
                            {
                                e.Graphics.DrawImage(HSIcons.GetIconsByEName(icon), textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2, 18, 18);
                                textOff += 20;
                            }
                        }
                        e.Graphics.DrawString(word.Script, font, Brushes.Wheat, textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2);

                        id++;
                    }
                    font.Dispose();
                }
            }
        }
Esempio n. 16
0
 internal override void Draw(Graphics g)
 {
     for (int i = 0; i < manaList.Count; i++)
     {
         var img = HSIcons.GetIconsByEName("mix" + (int)manaList[i]);
         g.DrawImage(img, position.X + 20 * i, position.Y, 20, 20);
     }
 }
Esempio n. 17
0
 public CalendarForm()
 {
     InitializeComponent();
     this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG");
     radioButton1.Image = HSIcons.GetIconsByEName("mth1");
     radioButton2.Image = HSIcons.GetIconsByEName("mth2");
     radioButton3.Image = HSIcons.GetIconsByEName("mth3");
     radioButton4.Image = HSIcons.GetIconsByEName("mth4");
 }
Esempio n. 18
0
            public override void Draw(Graphics g)
            {
                var img = HSIcons.GetIconsByEName("rot2");

                g.DrawImage(img, X, 2, ItemWidth, ItemWidth);
                Pen p = new Pen(IsLeft ? Brushes.Red : Brushes.Blue, 1);

                g.DrawRectangle(p, X, 2, ItemWidth, ItemWidth);
                p.Dispose();
            }
Esempio n. 19
0
        internal override void Draw(Graphics g)
        {
            g.DrawImage(HSIcons.GetIconsByEName("res" + resource), position.X, position.Y, 20, 20);

            g.DrawString(word, font, Brushes.Black, position.X + 23, position.Y + 1);
            Brush brush = new SolidBrush(color);

            g.DrawString(word, font, brush, position.X + 21, position.Y);
            brush.Dispose();
        }
Esempio n. 20
0
        private void MergeWeaponForm_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 (currentInfo == null)
            {
                return;
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 165, 412);
            font.Dispose();

            int         targetid    = selectPanel.SelectInfo;
            EquipConfig equipConfig = ConfigData.GetEquipConfig(targetid);

            font = new Font("微软雅黑", 14 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            e.Graphics.DrawString((GameResourceBook.OutStoneMerge(equipConfig.Quality + 1, equipConfig.Level)).ToString().PadLeft(5, ' '), font, PaintTool.GetBrushByResource((int)GameResourceType.Mercury), 273, 368);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("res3"), 333, 370, 24, 24);
            font.Dispose();

            font = new Font("微软雅黑", 10 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            int[] imgOff = { 200, 410, 270, 340 };
            int   index  = 1;

            foreach (var pair in currentInfo.Methods)
            {
                var   imgOffX = imgOff[index - 1];
                Brush brush   = new SolidBrush(Color.FromName(HSTypes.I2RareColor(ConfigData.GetHItemConfig(pair.Type).Rare)));
                e.Graphics.DrawString(ConfigData.GetHItemConfig(pair.Type).Name, font, brush, imgOffX, 305);
                brush.Dispose();

                var  itemCount = itemCounts[index];
                bool isEnough  = itemCount >= pair.Value;
                e.Graphics.DrawString(string.Format("{0}/{1}", itemCount, pair.Value), font, isEnough ? Brushes.Lime : Brushes.Red, imgOffX, 325);

                e.Graphics.DrawLine(isEnough ? Pens.Lime : Pens.Gray, 325, 160, imgOffX + 20, 295);

                index++;
            }
            font.Dispose();

            Image border = PicLoader.Read("Border", "itemb1.PNG");

            e.Graphics.DrawImage(border, 295 - 10, 100 - 15, 80, 90);
            border.Dispose();

            virtualRegion.Draw(e.Graphics);
        }
Esempio n. 21
0
        public void DrawIcon(Graphics g, Rectangle dest, int frame)
        {
            string moveicon = "";

            switch (type)
            {
            case "mon": moveicon = ConfigData.GetPeopleConfig(infos[0]).Figue; break;

            case "resource": moveicon = string.Format("res{0}", infos[0]); break;

            case "gold": moveicon = "res1"; break;

            case "task": moveicon = "trap1"; break;
            }

            if (moveicon != "")
            {
                Image moveImage = MazeBook.GetMoveImage(moveicon);
                if (moveImage != null)
                {
                    int       wid        = moveImage.Width / 4;
                    Rectangle targetRect = new Rectangle(dest.X + (38 - wid) / 2, dest.Y, wid, moveImage.Height);
                    g.DrawImage(moveImage, targetRect, wid * frame, 0, wid, moveImage.Height, GraphicsUnit.Pixel);
                    if (type == "mon")
                    {
                        int  lv   = mlevel + infos[1];
                        Font font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                        g.DrawString("lv" + lv, font, Brushes.Maroon, targetRect.X + 6, targetRect.Y + 28);
                        g.DrawString("lv" + lv, font, Brushes.White, targetRect.X + 5, targetRect.Y + 27);
                        font.Dispose();
                    }
                }
            }
            else
            {
                Rectangle smallDest = new Rectangle(dest.X + 7, dest.Y + 7, dest.Width - 14, dest.Height - 14);
                if (type == "block")
                {
                    Image block = PicLoader.Read("Map", "block.PNG");
                    g.DrawImage(block, smallDest);
                    block.Dispose();
                }
                else if (type == "item")
                {
                    g.DrawImage(HItemBook.GetHItemImage(infos[0]), smallDest, 4, 4, 56, 56, GraphicsUnit.Pixel);
                }
                else
                {
                    g.DrawImage(HSIcons.GetIconsByEName("res1"), smallDest, 0, 0, 32, 32, GraphicsUnit.Pixel);
                }
            }
        }
Esempio n. 22
0
 public MGRussiaBlock()
 {
     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             = @"开始";
     xoff += 15;
 }
Esempio n. 23
0
        private void CreatePlayerForm_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();

            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("con{0}", constellation + 1)), 141, 159, 24, 24);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("atr{0}", type)), 141, 192, 24, 24);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("bld{0}", bldType + 1)), 141, 225, 24, 24);
        }
Esempio n. 24
0
 private Image GetTerrainImage(int monType, double[] attrAtk, double[] attrDef)
 {//todo
     ControlPlus.TipImage tipData = new ControlPlus.TipImage();
     tipData.AddTextNewLine("属性:" + HSTypes.I2Attr(monType), "White", 20);
     for (int i = 0; i <= 6; i++)
     {
         tipData.AddTextNewLine("Vs", "Yellow", 16);
         tipData.AddImageXY(HSIcons.GetIconsByEName("atr" + i), 0, 0, 32, 32, 23, 20 + i * 16 + 1, 14, 14);
         //  tipData.AddText(string.Format("    AT={0}%",100+attrAtk[i]*100), attrAtk[i]==0?"White": attrAtk[i]>0?"Lime": "Red");
         tipData.AddTextOff(string.Format("DF={0}%", 100 + attrDef[i] * 100), attrDef[i] == 0 ? "White" : attrDef[i] > 0 ? "Lime" : "Red", 50);
     }
     return(tipData.Image);
 }
Esempio n. 25
0
 private void SetDnaState(int id, bool check)
 {
     if (check) //选中
     {
         dna |= (uint)Math.Pow(2, id);
         vRegion.SetRegionDecorator(id, 0, new RegionImageDecorator(HSIcons.GetIconsByEName("round"), 32));
     }
     else //取消
     {
         dna &= ~(uint)Math.Pow(2, id);
         vRegion.SetRegionDecorator(id, 0, null);
     }
 }
Esempio n. 26
0
        private void tabPageLogin_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac5"), 10, tabPageLogin.Height - 160, 20, 20);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("hatt1"), 10, tabPageLogin.Height - 135, 20, 20);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("spl2"), 10, tabPageLogin.Height - 110, 20, 20);

            Font font = new Font("微软雅黑", 12 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.MonsterAvail, CardConfigManager.MonsterTotal), font, Brushes.White, 35, tabPageLogin.Height - 160);
            e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.WeaponAvail, CardConfigManager.WeaponTotal), font, Brushes.White, 35, tabPageLogin.Height - 135);
            e.Graphics.DrawString(string.Format("{0} / {1}", CardConfigManager.SpellAvail, CardConfigManager.SpellTotal), font, Brushes.White, 35, tabPageLogin.Height - 110);
            font.Dispose();
        }
Esempio n. 27
0
        public static SubVirtualRegion GetResButtonRegion(int index, Point pos, int size, ImageRegionCellType type, int change)
        {
            string iconName    = "";
            Color  borderColor = Color.White;

            CheckResourceType(type, ref iconName, ref borderColor);
            var pictureRegion = new ButtonRegion(index, pos.X, pos.Y, size, size, "iconbg.jpg", "");
            var textControl   = new RegionTextDecorator(3, size - 20, 11, change > 0 ? Color.White : Color.Red, true, change.ToString());

            pictureRegion.AddDecorator(new RegionImageDecorator(HSIcons.GetIconsByEName(iconName), size / 2));
            pictureRegion.AddDecorator(textControl);
            return(pictureRegion);
        }
Esempio n. 28
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(PaintTool.GetTalkColor);
            tipData.AddTextNewLine(hItemConfig.Name, HSTypes.I2RareColor(hItemConfig.Rare), 20);
            if (hItemConfig.IsUsable)
            {
                if (hItemConfig.SubType == (int)HItemTypes.Fight)
                {
                    tipData.AddTextNewLine("       战斗中双击使用", "Red");
                }
                else if (hItemConfig.SubType == (int)HItemTypes.Seed)
                {
                    tipData.AddTextNewLine("       农场中双击使用", "Red");
                }
                else
                {
                    tipData.AddTextNewLine("       双击使用", "Green");
                }
            }
            if (hItemConfig.Type == (int)HItemTypes.Task)
            {
                tipData.AddTextNewLine("       任务物品", "DarkBlue");
            }
            else if (hItemConfig.Type == (int)HItemTypes.Material)
            {
                tipData.AddTextNewLine(string.Format("       材料(稀有度:{0})", hItemConfig.Rare), "White");
            }
            if (hItemConfig.Attributes != null && hItemConfig.Attributes.Length > 0)
            {
                tipData.AddTextNewLine(string.Format("       特性:{0}", string.Join(",", hItemConfig.Attributes)), "Lime");
            }

            tipData.AddTextNewLine(string.Format("       等级:{0}", hItemConfig.Level), "White");
            tipData.AddTextNewLine("", "White", 8);
            if (!string.IsNullOrEmpty(hItemConfig.Descript))
            {
                tipData.AddTextLines(hItemConfig.Descript, "White", 20, true);
            }
            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);
        }
Esempio n. 29
0
        private void MGVoting_Paint(object sender, PaintEventArgs e)
        {
            DrawBase(e.Graphics);

            if (!show)
            {
                return;
            }

            virtualRegion.Draw(e.Graphics);

            e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac8"), xoff + 80, yoff + 10, 30, 30);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac9"), xoff + 140, yoff + 10, 30, 30);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac3"), xoff + 200, yoff + 10, 30, 30);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("rac15"), xoff + 260, yoff + 10, 30, 30);

            var font = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            DrawShadeText(e.Graphics, "人口", font, Brushes.White, xoff + 10, yoff + 50);
            DrawShadeText(e.Graphics, "前轮", font, Brushes.White, xoff + 10, yoff + 70);
            DrawShadeText(e.Graphics, "支持率", font, Brushes.White, xoff + 5, yoff + 90);

            DrawShadeText(e.Graphics, countHuman.ToString(), font, Brushes.White, xoff + 80, yoff + 50);
            DrawShadeText(e.Graphics, countOrc.ToString(), font, Brushes.White, xoff + 140, yoff + 50);
            DrawShadeText(e.Graphics, countElf.ToString(), font, Brushes.White, xoff + 200, yoff + 50);
            DrawShadeText(e.Graphics, countDwalf.ToString(), font, Brushes.White, xoff + 260, yoff + 50);

            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateHumanOld * 100), font, Brushes.White, xoff + 80, yoff + 70);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateOrcOld * 100), font, Brushes.White, xoff + 140, yoff + 70);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateElfOld * 100), font, Brushes.White, xoff + 200, yoff + 70);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateDwalfOld * 100), font, Brushes.White, xoff + 260, yoff + 70);

            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateHuman * 100), font, Brushes.White, xoff + 80, yoff + 90);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateOrc * 100), font, Brushes.White, xoff + 140, yoff + 90);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateElf * 100), font, Brushes.White, xoff + 200, yoff + 90);
            DrawShadeText(e.Graphics, string.Format("{0:0}%", supportRateDwalf * 100), font, Brushes.White, xoff + 260, yoff + 90);

            for (int i = 0; i < targetQuestions.Length; i++)
            {
                var qData = questions[targetQuestions[i]];
                DrawShadeText(e.Graphics, qData.Question, font, Brushes.White, 55, 273 + 30 * i);
            }

            font.Dispose();

            font = new Font("宋体", 18 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            DrawShadeText(e.Graphics, string.Format("第{0}天  {1:0}%", round + 1, supportRateTotal * 100), font, Brushes.Gold, xoff + 90, yoff + 110);
            font.Dispose();
        }
Esempio n. 30
0
        public override void Init(int width, int height)
        {
            base.Init(width, height);
            #region  钮图片
            bitmapButtonC1.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC1.IconImage = HSIcons.GetIconsByEName("rac1");
            this.bitmapButtonC1.IconXY    = new Point(4, 4);
            this.bitmapButtonC1.IconSize  = new Size(20, 20);
            bitmapButtonC2.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC2.IconImage = HSIcons.GetIconsByEName("rac2");
            this.bitmapButtonC2.IconXY    = new Point(4, 4);
            this.bitmapButtonC2.IconSize  = new Size(20, 20);
            bitmapButtonC3.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC3.IconImage = HSIcons.GetIconsByEName("rac3");
            this.bitmapButtonC3.IconXY    = new Point(4, 4);
            this.bitmapButtonC3.IconSize  = new Size(20, 20);
            bitmapButtonC4.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC4.IconImage = HSIcons.GetIconsByEName("rac4");
            this.bitmapButtonC4.IconXY    = new Point(4, 4);
            this.bitmapButtonC4.IconSize  = new Size(20, 20);
            bitmapButtonC5.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC5.IconImage = HSIcons.GetIconsByEName("rac5");
            this.bitmapButtonC5.IconXY    = new Point(4, 4);
            this.bitmapButtonC5.IconSize  = new Size(20, 20);
            bitmapButtonC6.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC6.IconImage = HSIcons.GetIconsByEName("rac6");
            this.bitmapButtonC6.IconXY    = new Point(4, 4);
            this.bitmapButtonC6.IconSize  = new Size(20, 20);
            bitmapButtonC7.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC7.IconImage = HSIcons.GetIconsByEName("rac7");
            this.bitmapButtonC7.IconXY    = new Point(4, 4);
            this.bitmapButtonC7.IconSize  = new Size(20, 20);
            bitmapButtonC8.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC8.IconImage = HSIcons.GetIconsByEName("rac8");
            this.bitmapButtonC8.IconXY    = new Point(4, 4);
            this.bitmapButtonC8.IconSize  = new Size(20, 20);
            bitmapButtonC9.ImageNormal    = PicLoader.Read("Button.Panel", "ButtonBack2.png");
            this.bitmapButtonC9.IconImage = HSIcons.GetIconsByEName("rac9");
            this.bitmapButtonC9.IconXY    = new Point(4, 4);
            this.bitmapButtonC9.IconSize  = new Size(20, 20);
            #endregion
            this.customScrollbar1.Minimum     = 0;
            this.customScrollbar1.LargeChange = 17;
            this.customScrollbar1.Maximum     = (answers.Count - 10) + customScrollbar1.LargeChange;
            this.customScrollbar1.SmallChange = 3;
            this.customScrollbar1.Value       = 0;

            RestartGame();
        }