Exemple #1
0
        private void SelectJobForm_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();

            jobDes.Draw(e.Graphics);
            virtualRegion.Draw(e.Graphics);

            if (selectJobId > 0)
            {
                var  jobConfig = ConfigData.GetJobConfig(selectJobId);
                Font font1     = new Font("宋体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                e.Graphics.DrawString(jobConfig.Name, font1, Brushes.Gold, 180, 45);
                font1.Dispose();

                Font fontDes = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                e.Graphics.DrawString("领导", fontDes, Brushes.White, 180, 175);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[0] / 8 + 1), fontDes, Brushes.Gold, 210, 175);
                e.Graphics.DrawString("力量", fontDes, Brushes.White, 180, 195);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[1] / 8 + 1), fontDes, Brushes.Red, 210, 195);
                e.Graphics.DrawString("魔力", fontDes, Brushes.White, 180, 215);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[2] / 8 + 1), fontDes, Brushes.Blue, 210, 215);
                fontDes.Dispose();
            }

            e.Graphics.DrawRectangle(Pens.DodgerBlue, 8, 39, 153, 279);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 38, 330, 125);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 168, 330, 86);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 259, 330, 59);
        }
Exemple #2
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();
                }
            }
        }
Exemple #3
0
        private void ConnectForm_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();

            colorWord.Draw(e.Graphics);
        }
Exemple #4
0
        private void BuyPieceForm_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();

            colorWord.Draw(e.Graphics);
            foreach (PieceItem ctl in pieceControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
Exemple #5
0
        public void Draw(Graphics g)
        {
            g.DrawRectangle(Pens.White, x, y, width - 1, height - 1);

            if (show)
            {
                colorWord.Draw(g);

                LevelInfoConfig levelInfoConfig = ConfigData.GetLevelInfoConfig(id);
                g.DrawImage(LevelInfoBook.GetLevelInfoImage(id), x + 10, y + 10, 64, 64);

                Image back = PicLoader.Read("Border", "border3.PNG");
                g.DrawImage(back, x + 10, y + 10, 64, 64);
                back.Dispose();

                Font  font  = new Font("微软雅黑", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Brush brush = new SolidBrush(Color.FromName(HSTypes.I2LevelInfoColor(levelInfoConfig.Type)));
                g.DrawString(HSTypes.I2LevelInfoType(levelInfoConfig.Type), font, brush, x + 80, y + 30);
                brush.Dispose();
                font.Dispose();
            }
        }
Exemple #6
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})({2})", config.Name, eventLevel, config.Script), font2, Brushes.White, Width / 2 - 40, 8);
                font2.Dispose();

                e.Graphics.DrawImage(SceneQuestBook.GetSceneQuestImageBig(config.Id), 20, 60, 300, 300);
                Image border = PicLoader.Read("Border", "scenequestbg.png"); //边框
                e.Graphics.DrawImage(border, 20, 60, 300, 300);
                border.Dispose();

                if (config.TriggerRate > 0 && config.TriggerRate <= 30)
                {//稀有
                    Image rareImg = PicLoader.Read("System", "sqrare2.png");
                    e.Graphics.DrawImage(rareImg, 20 + 16, 60 + 16, 64, 32);
                    rareImg.Dispose();
                }
                else if (config.TriggerRate > 0 && config.TriggerRate <= 60)
                {//罕见
                    Image rareImg = PicLoader.Read("System", "sqrare1.png");
                    e.Graphics.DrawImage(rareImg, 20 + 16, 60 + 16, 64, 32);
                    rareImg.Dispose();
                }

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

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

                if (answerList != null && (evtItem == null || evtItem.RunningState != TalkEventItem.TalkEventState.Running))
                {
                    int id       = 0;
                    var bgTarget = PicLoader.Read("System", "WordBack1.png");
                    var bgCommon = PicLoader.Read("System", "WordBack2.png");
                    foreach (var word in answerList)
                    {
                        var rect   = word.Rect;
                        var bgRect = new Rectangle(rect.X, rect.Y, rect.Width - 20, 24);
                        if (id == tar)
                        {
                            e.Graphics.DrawImage(bgTarget, bgRect);
                        }
                        else
                        {
                            e.Graphics.DrawImage(bgCommon, bgRect);
                        }

                        word.Draw(e.Graphics);
                        id++;
                    }
                    bgTarget.Dispose();
                    bgCommon.Dispose();
                }
            }
        }
 public override void Draw(Graphics g)
 {
     colorWord.Draw(g);
 }