Ejemplo n.º 1
0
        private void MazeWindow_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(ConfigDatas.ConfigData.GetNpcConfig(npcId).Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            int xoff = 8;
            int yoff = 35;

            e.Graphics.DrawImage(mazeBack, new Rectangle(xoff, yoff, 380, 380), wx * 38, wy * 38, 380, 380, GraphicsUnit.Pixel);

            e.Graphics.DrawImage(hero, new Rectangle((x - wx) * 38 + xoff + 6, (y - wy) * 38 + yoff, 23, 35), heroAct * 23, last * 35, 23, 35, GraphicsUnit.Pixel);
            for (int i = wx; i < Math.Min(wx + 10, mazeState.GetLength(0) - 1); i++)
            {
                for (int j = wy; j < Math.Min(wy + 10, mazeState.GetLength(1) - 1); j++)
                {
                    Rectangle dest = new Rectangle((i - wx) * 38 + xoff, (j - wy) * 38 + yoff, 38, 38);
                    if (mazeState[i, j] != 4)
                    {
                        maze.DrawIcon(e.Graphics, dest, i, j, heroAct);
                    }
                }
            }
#if DEBUG
            e.Graphics.DrawString(string.Format("{0},{1}", x, y), new Font("宋体", 11), Brushes.Black, xoff, yoff);
#endif
            e.Graphics.DrawRectangle(Pens.White, xoff, yoff, 379, 379);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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();
                }
            }
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
        private void SystemMenu_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 - 30, 8);
            font.Dispose();
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        private void BattleForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            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();
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
0
        private void LevelInfoForm_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 (LevelInfoItem ctl in infoControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
Ejemplo n.º 10
0
        private void CardViewForm_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();

            cardDetail.Draw(e.Graphics);
            e.Graphics.FillRectangle(Brushes.DarkGray, 67, 37, cardWidth * xCount - 4, 71);
            Image img = PicLoader.Read("System", "SearchBack.JPG");

            e.Graphics.DrawImage(img, 70, 40, cardWidth * xCount - 10, 65);
            img.Dispose();

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString("分类", font, Brushes.White, 86, 61);
            font.Dispose();

            if (show)
            {
                int pages     = cards.Count / cardCount + 1;
                int cardLimit = (page < pages - 1) ? cardCount : (cards.Count % cardCount);
                int former    = cardCount * page + 1;
                if (isDirty)
                {
                    tempImage.Dispose();
                    tempImage = new Bitmap(cardWidth * xCount, cardHeight * yCount);
                    Graphics g = Graphics.FromImage(tempImage);
                    for (int i = former - 1; i < former + cardLimit - 1; i++)
                    {
                        int ri = i % (xCount * yCount);
                        int x  = (ri % xCount) * cardWidth;
                        int y  = (ri / xCount) * cardHeight;
                        DrawOnCardView(g, cards[i], x, y, false);
                    }
                    g.Dispose();
                    isDirty = false;
                }
                e.Graphics.DrawImage(tempImage, 65, 110);
                if (tar != -1 && tar < cards.Count)
                {
                    int ri = tar % (xCount * yCount);
                    int x  = (ri % xCount) * cardWidth + 65;
                    int y  = (ri / xCount) * cardHeight + 110;
                    DrawOnCardView(e.Graphics, cards[tar], x, y, true);
                }
            }
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 12
0
        private void MagicBookViewForm_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, 300, 8);
            font.Dispose();

            Image back = PicLoader.Read("System", "MagicBookBack.JPG");

            e.Graphics.DrawImage(back, 5, 35, 672, 420);
            back.Dispose();

            virtualRegion.Draw(e.Graphics);
        }
Ejemplo n.º 13
0
        private void AchieveViewForm_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 (AchieveItem ctl in achieveControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
Ejemplo n.º 14
0
        private void ItemPackageForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Image img = PicLoader.Read("System", "ItemBackDown2.JPG");

            e.Graphics.DrawImage(img, 10, 35, 185, 185);
            img.Dispose();

            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();
        }
Ejemplo n.º 15
0
        private void BlessViewForm_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 (var ctl in blessControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 445, 375);
            font.Dispose();
        }
Ejemplo n.º 16
0
        private void CardShopViewForm_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();

            vRegion.Draw(e.Graphics);
            foreach (CardShopItem ctl in itemControls)
            {
                ctl.Draw(e.Graphics);
            }
            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 18, 447);
            font.Dispose();
        }
Ejemplo n.º 17
0
        protected void DrawBase(Graphics g)
        {
            BorderPainter.Draw(g, "", Width, Height);

            if (!show)
            {
                return;
            }

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

            g.DrawString(config.Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (backImage != null)
            {
                g.DrawImage(backImage, xoff, yoff, 324, 244);
            }
        }
Ejemplo n.º 18
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();

            font = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            if (tid == 0)
            {
                e.Graphics.DrawString("排名", font, Brushes.LightCyan, 215, 50);
                e.Graphics.DrawString("名字", font, Brushes.LightCyan, 325, 50);
                e.Graphics.DrawString("等级", font, Brushes.LightCyan, 400, 50);
                e.Graphics.DrawString("职业", font, Brushes.LightCyan, 450, 50);
                e.Graphics.DrawString("积分", font, Brushes.LightCyan, 560, 50);
            }
            else
            {
                //Tournament tour = TournamentBook.GetTournament(tid);
                //if (tour.begin_date <= UserProfile.Profile.time.Date && tour.end_date >= UserProfile.Profile.time.Date)
                //{
                //    e.Graphics.DrawString("比赛中", font, Brushes.Gold, 250, 50);
                //}
                //else if (tour.apply_date != UserProfile.Profile.time.Date)
                //{
                //    e.Graphics.DrawString("报名时间", font, Brushes.LightGray, 200, 50);
                //    e.Graphics.DrawString(HSTime.GetByDate(tour.apply_date).ToShortString(), font, Brushes.LightGreen, 266, 50);
                //}
                //else if (UserProfile.MemData.GetTournamentData(tid).engage)
                //{
                //    e.Graphics.DrawString("已报名", font, Brushes.Lime, 250, 50);
                //}
                //else if (UserProfile.Profile.level < tour.min_level || UserProfile.Profile.level > tour.max_level)
                //{
                //    e.Graphics.DrawString("等级限制", font, Brushes.Red, 250, 50);
                //}
            }
            font.Dispose();
            e.Graphics.DrawLine(Pens.White, 200, 70, 700, 70);
        }
Ejemplo n.º 19
0
        private void RoleForm_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(UserProfile.Profile.Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (!show)
            {
                return;
            }
            e.Graphics.FillRectangle(Brushes.LightSlateGray, 25 - 1, 55 - 1, 52, 52);
            Image head = PicLoader.Read("Player", string.Format("{0}.png", UserProfile.InfoBasic.Head));

            e.Graphics.DrawImage(head, 25, 55, 50, 50);
            head.Dispose();

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

            Brush brush = new SolidBrush(Color.FromArgb(220, Color.Black));

            e.Graphics.FillRectangle(brush, 12, 300, 305, 105);
            brush.Dispose();

            string namestr = string.Format("Lv {0}", UserProfile.InfoBasic.Level);

            e.Graphics.DrawString(namestr, font, Brushes.White, 20, 305);

            string expstr = string.Format("{0}/{1}", UserProfile.InfoBasic.Exp, ExpTree.GetNextRequired(UserProfile.InfoBasic.Level));

            e.Graphics.DrawString(expstr, font2, Brushes.White, 130, 300);
            e.Graphics.FillRectangle(Brushes.DimGray, 80, 314, 180, 4);
            e.Graphics.FillRectangle(Brushes.DodgerBlue, 80, 314, Math.Min(UserProfile.InfoBasic.Exp * 179 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level) + 1, 180), 4);

            font.Dispose();
            font2.Dispose();
        }
Ejemplo n.º 20
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();
                }
            }
        }
Ejemplo n.º 21
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();
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
0
        private void DeckViewForm_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();

            try
            {
                if (show)
                {
                    if (!isShowStatistic)
                    {
                        cardDetail.Draw(e.Graphics);
                    }
                    else
                    {
                        deckStatistic.Draw(e.Graphics);
                    }
                    cardRegion.Draw(e.Graphics);
                    selectRegion.Draw(e.Graphics);

                    virtualRegion.Draw(e.Graphics);

                    font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                    e.Graphics.DrawString(UserProfile.InfoCard.SelectedDeck.Name, font, Brushes.White, 5, 580);
                    font.Dispose();
                }
            }
            catch (Exception ex)
            {
                NLog.Error("DeckViewForm_Paint" + ex);
            }
        }
Ejemplo n.º 25
0
        private void WorldMapViewForm_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)
            {
                return;
            }

            e.Graphics.DrawImage(worldMap, new Rectangle(15, 35, 750, 500), new Rectangle(baseX, baseY, 750, 500), GraphicsUnit.Pixel);
            Image tit = PicLoader.Read("Map", "title.PNG");

            e.Graphics.DrawImage(tit, 30, 45, 126, 44);
            tit.Dispose();
            foreach (var mapIconConfig in ConfigData.SceneDict.Values)
            {
                if (mapIconConfig.Icon == "")
                {
                    continue;
                }

                if (mapIconConfig.Icon == selectName)
                {
                    var iconSize = iconSizeDict[mapIconConfig.Id];
                    int x        = mapIconConfig.IconX;
                    int y        = mapIconConfig.IconY;
                    int width    = iconSize.Width;
                    int height   = iconSize.Height;

                    if (x > baseX && y > baseY && x + width < baseX + 750 && y + height < baseY + 500)
                    {
                        Image     image     = PicLoader.Read("MapIcon", string.Format("{0}.PNG", mapIconConfig.Icon));
                        Rectangle destRect  = new Rectangle(x - baseX + 11, y - baseY + 31, width + 8, height + 8);
                        Rectangle destRect2 = new Rectangle(x - baseX + 15, y - baseY + 35, width, height);
                        e.Graphics.DrawImage(image, destRect, 0, 0, width, height, GraphicsUnit.Pixel);
                        e.Graphics.DrawImage(image, destRect2, 0, 0, width, height, GraphicsUnit.Pixel);
                        image.Dispose();

                        image = GetPreview(mapIconConfig.Id);
                        int tx = x - baseX + width;
                        if (tx > 750 - image.Width)
                        {
                            tx -= image.Width + width;
                        }
                        e.Graphics.DrawImage(image, tx + 15, y - baseY + 35, image.Width, image.Height);
                        image.Dispose();
                    }
                }
                if (mapIconConfig.Id == UserProfile.InfoBasic.MapId)
                {
                    Image image = PicLoader.Read("Map", "arrow.PNG");
                    e.Graphics.DrawImage(image, mapIconConfig.IconX - baseX + 40, mapIconConfig.IconY - baseY - 5 + pointerY, 30, 48);
                    image.Dispose();
                }
            }
        }
Ejemplo n.º 26
0
        private void CalendarForm_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)
            {
                return;
            }

            //if (nowSeason == UserProfile.Profile.time.Season)
            //{
            //    int day = UserProfile.Profile.time.Day;
            //    for (int i = 0; i < 28; i++)
            //    {
            //        if (day > i)
            //        {
            //            e.Graphics.FillRectangle(Brushes.DimGray, 30 + 70 * (i%7), 45 + 70 * (i/7), 70,70);
            //        }
            //        else if (day == i)
            //        {
            //            e.Graphics.FillRectangle(Brushes.DarkRed, 30 + 70 * (i % 7), 45 + 70 * (i / 7), 70, 70);
            //        }
            //    }
            //}
            Pen pen = new Pen(Color.White, 2);

            for (int i = 0; i < 5; i++)
            {
                e.Graphics.DrawLine(pen, 30, 45 + 70 * i, 520, 45 + 70 * i);
            }
            for (int i = 0; i < 8; i++)
            {
                e.Graphics.DrawLine(pen, 30 + 70 * i, 45, 30 + 70 * i, 325);
            }
            pen.Dispose();
            font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            Font font2 = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            for (int i = 0; i < 28; i++)
            {
                e.Graphics.DrawString((i + 1).ToString().PadLeft(2), font, Brushes.White, 70 * (i % 7) + 63, 70 * (i / 7) + 53);
                int date = nowSeason * 28 + i;
                int maid = TournamentBook.GetDayApplyId(date);
                int mmid = TournamentBook.GetDayMatchId(date);

                if (maid != 0)
                {
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth2"), 70 * (i % 7) + 37, 70 * (i / 7) + 50, 24, 24);
                    e.Graphics.DrawString(ConfigDatas.ConfigData.GetTournamentConfig(maid).Name, font2, Brushes.White, 70 * (i % 7) + 33, 70 * (i / 7) + 95);
                }
                else if (mmid != 0)
                {
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth1"), 70 * (i % 7) + 37, 70 * (i / 7) + 50, 24, 24);
                    e.Graphics.DrawString(ConfigDatas.ConfigData.GetTournamentConfig(mmid).Name, font2, Brushes.White, 70 * (i % 7) + 33, 70 * (i / 7) + 95);
                }
            }
            font.Dispose();
            font2.Dispose();
        }
Ejemplo n.º 27
0
        private void BattleResultForm_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();

            Image back = PicLoader.Read("System", "BattleResultBack.JPG");

            e.Graphics.DrawImage(back, 15, 35, 504, 354);
            back.Dispose();

            virtualRegion.Draw(e.Graphics);

            if (show)
            {
                font = new Font("微软雅黑", 15 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                Font font2 = new Font("宋体", 12 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                if (leftId == 0)
                {
                    Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face));
                    e.Graphics.DrawImage(head, 95, 40, 50, 50);
                    head.Dispose();
                    e.Graphics.DrawString(UserProfile.ProfileName, font, Brushes.White, 155, 45);
                }
                else
                {
                    PeopleConfig leftPeople = ConfigData.GetPeopleConfig(leftId);
                    Image        head       = PicLoader.Read("People", string.Format("{0}.PNG", leftPeople.Figue));
                    e.Graphics.DrawImage(head, 95, 40, 50, 50);
                    head.Dispose();
                    e.Graphics.DrawString(leftPeople.Name, font, Brushes.White, 155, 45);
                }

                PeopleConfig rightPeople = ConfigData.GetPeopleConfig(rightId);
                Image        head2       = PicLoader.Read("People", string.Format("{0}.PNG", rightPeople.Figue));
                e.Graphics.DrawImage(head2, 305, 40, 50, 50);
                head2.Dispose();
                head2 = PicLoader.Read("System", "Win.PNG");
                e.Graphics.DrawImage(head2, isWin ? 135 : 345, 40, 109, 70);
                head2.Dispose();
                e.Graphics.DrawString(rightPeople.Name, font, Brushes.White, 370, 45);

                BattleStatisticData battleStatisticData = BattleManager.Instance.StatisticData;
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.MonsterAdd), font2, Brushes.White, 159, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.SpellAdd), font2, Brushes.White, 159, 123);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.Kill), font2, Brushes.White, 259, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.WeaponAdd), font2, Brushes.White, 259, 123);
                e.Graphics.DrawString(GetDamageStr(battleStatisticData.Left.DamageTotal), font2, Brushes.White, 159, 143);

                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.MonsterAdd), font2, Brushes.White, 373, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.SpellAdd), font2, Brushes.White, 373, 123);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.Kill), font2, Brushes.White, 473, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.WeaponAdd), font2, Brushes.White, 473, 123);
                e.Graphics.DrawString(GetDamageStr(battleStatisticData.Right.DamageTotal), font2, Brushes.White, 373, 143);

                TimeSpan span = battleStatisticData.EndTime - battleStatisticData.StartTime;
                e.Graphics.DrawString(string.Format("{0:00}:{1:00}:{2:00}", span.Hours, span.Minutes, span.Seconds), font2, Brushes.White, 158, 195);
                e.Graphics.DrawString(string.Format("{0}", battleStatisticData.Round), font2, Brushes.White, 158, 175);

                font.Dispose();
                font2.Dispose();
            }
        }
Ejemplo n.º 28
0
        private void MonsterSkillViewForm_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, 320, 8);
            font.Dispose();

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

            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(245, 244, 242)), 65, cardHeight * yCount + 40, cardWidth * xCount, 100 + (7 - yCount) * cardHeight);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(190, 175, 160)), 65, cardHeight * yCount + 40, cardWidth * xCount, 20);
            e.Graphics.DrawString("所有卡组", fontblack, Brushes.White, 65, cardHeight * yCount + 42);
            fontblack.Dispose();

            cardDetail.Draw(e.Graphics);

            if (show)
            {
                int pages     = totalCount / cardCount + 1;
                int cardLimit = (page < pages - 1) ? cardCount : (totalCount % cardCount);
                int former    = cardCount * page + 1;
                if (isDirty)
                {
                    tempImage.Dispose();
                    tempImage = new Bitmap(cardWidth * xCount, cardHeight * yCount);
                    Graphics g = Graphics.FromImage(tempImage);
                    for (int i = former - 1; i < former + cardLimit - 1; i++)
                    {
                        g.DrawImage(PeopleBook.GetPersonImage(people[i]), (i % xCount) * cardWidth, ((i / xCount) % yCount) * cardHeight, cardWidth, cardHeight);
                    }
                    g.Dispose();
                    isDirty = false;
                }
                e.Graphics.DrawImage(tempImage, 65, 35);

                if (sel != -1 && sel < totalCount)
                {
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Lime));
                    int        x           = (sel % xCount) * cardWidth + 65;
                    int        y           = ((sel / xCount) % yCount) * cardHeight + 35;
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Lime, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
                if (tar != -1 && tar < totalCount)
                {
                    int        x           = (tar % xCount) * cardWidth + 65;
                    int        y           = ((tar / xCount) % yCount) * cardHeight + 35;
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Yellow));
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Yellow, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
            }
        }
Ejemplo n.º 29
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--;
                    }
                }
            }
        }
Ejemplo n.º 30
0
        private void FarmForm_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)
            {
                return;
            }

            Image back = PicLoader.Read("Farm", "back.JPG");

            e.Graphics.DrawImage(back, 15, 40, 602, 392);
            back.Dispose();

            for (int i = 0; i < 9; i++)
            {
                int baseX = 15 + 218;
                int baseY = 40 + 56;
                if ((i / 3) != 0)
                {
                    baseX += 70 * (i / 3);
                    baseY += 40 * (i / 3);
                }
                if ((i % 3) != 0)
                {
                    baseX -= 80 * (i % 3);
                    baseY += 40 * (i % 3);
                }
                DbFarmState timeState = UserProfile.Profile.InfoFarm.GetFarmState(i);
                string      baseName  = timeState.Type == -1 ? "tile2" : "tile1";
                Image       tile      = PicLoader.Read("Farm", i == select ? baseName + "On.PNG" : baseName + ".PNG");
                e.Graphics.DrawImage(tile, baseX, baseY + 86 - tile.Height, tile.Width, tile.Height);
                tile.Dispose();

                if (timeState.Type > 0)
                {
                    TimeSpan span = TimeTool.UnixTimeToDateTime(timeState.Time) - DateTime.Now;

                    Image veg = PicLoader.Read("Farm", string.Format("veg{0}.PNG", timeState.Type % 100));
                    if (span.TotalSeconds > 0)
                    {
                        e.Graphics.DrawImage(veg, new Rectangle(baseX + 59, baseY + 6, veg.Width, veg.Height), 0, 0, veg.Width, veg.Height, GraphicsUnit.Pixel, Core.HSImageAttributes.ToGray);
                    }
                    else
                    {
                        e.Graphics.DrawImage(veg, baseX + 59, baseY + 6, veg.Width, veg.Height);
                    }
                    veg.Dispose();


                    if (span.TotalSeconds > 0)
                    {
                        string timeText = string.Format("{0}:{1:00}:{2:00}", span.Hours, span.Minutes, span.Seconds);
                        font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                        e.Graphics.DrawString(timeText, font, Brushes.White, baseX + 55, baseY + 30);
                        font.Dispose();
                    }
                }
            }
        }