Beispiel #1
0
        private void TourLeague4_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font             font             = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                TournamentConfig tournamentConfig = ConfigData.GetTournamentConfig(tid);
                foreach (int mid in TournamentBook.GetTournamentMatchIds(tid))
                {
                    TournamentMatchConfig tournamentMatchConfig = ConfigData.GetTournamentMatchConfig(mid);
                    Image head = MatchManager.GetHeadImage(tourData.Pids[tournamentMatchConfig.LeftValue]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 10 + (36 - headSize) / 2, gridSize * tournamentMatchConfig.Offset + 10 + (36 - headSize) / 2, headSize, headSize);
                    }
                    Brush nbrush = new SolidBrush(MatchManager.GetNameColor(tourData.Results[tournamentMatchConfig.Offset].Winner, tourData.Pids[tournamentMatchConfig.LeftValue]));
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[tournamentMatchConfig.LeftValue]), font, nbrush, 50, gridSize * tournamentMatchConfig.Offset + 25);
                    nbrush.Dispose();

                    head = MatchManager.GetHeadImage(tourData.Pids[tournamentMatchConfig.RightValue]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 210 + (36 - headSize) / 2, gridSize * tournamentMatchConfig.Offset + 10 + (36 - headSize) / 2, headSize, headSize);
                    }
                    nbrush = new SolidBrush(MatchManager.GetNameColor(tourData.Results[tournamentMatchConfig.Offset].Winner, tourData.Pids[tournamentMatchConfig.RightValue]));
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[tournamentMatchConfig.RightValue]), font, nbrush, 250, gridSize * tournamentMatchConfig.Offset + 25);
                    nbrush.Dispose();

                    if (tourData.Results[tournamentMatchConfig.Offset].Winner != 0)
                    {
                        e.Graphics.DrawString(tourData.Results[tournamentMatchConfig.Offset].Winner == tourData.Pids[tournamentMatchConfig.LeftValue] ? "胜" : "负", font, Brushes.White, 143, gridSize * tournamentMatchConfig.Offset + 25);
                    }
                }

                List <int[]> ranks = tourData.GetRanks();
                Brush        brush = new SolidBrush(Color.FromArgb(15, 15, 15));
                e.Graphics.FillRectangle(brush, 340, 53, 165, 200);
                brush.Dispose();
                e.Graphics.DrawRectangle(Pens.Gray, 340, 53, 165, tournamentConfig.PlayerCount * 50);
                e.Graphics.DrawLine(Pens.Gray, 400, 53, 400, 53 + tournamentConfig.PlayerCount * 50);
                for (int i = 0; i < tournamentConfig.PlayerCount - 1; i++)
                {
                    e.Graphics.DrawLine(Pens.Gray, 340, 103 + 50 * i, 505, 103 + 50 * i);
                }
                for (int i = 0; i < tournamentConfig.PlayerCount; i++)
                {
                    Image head = MatchManager.GetHeadImage(ranks[i][0]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 350, 50 * i + 60, 36, 36);
                        e.Graphics.DrawString(string.Format("{0}战 {1}胜 {2}分", ranks[i][1], ranks[i][2], ranks[i][3]), font, Brushes.White, 410, 50 * i + 75);
                    }
                }

                font.Dispose();
            }
        }
Beispiel #2
0
        private void TourCup8_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                for (int i = 0; i < 8; i++)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Pids[i]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 10, 50 * i + 10, 36, 36);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[i]), font, IsPlayerLost(tourData.Pids[i]) ? Brushes.DimGray : Brushes.White, 50, 50 * i + 25);
                }
                for (int i = 0; i < 4; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 100, 100 * i + 33, 140, 100 * i + 83);
                    if (tourData.Results[i].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 148, 100 * i + 35, 36, 36);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i].Winner), font, IsPlayerLost(tourData.Results[i].Winner) ? Brushes.DimGray : Brushes.White, 188, 100 * i + 50);
                    }
                }
                for (int i = 0; i < 2; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 238, 200 * i + 58, 278, 200 * i + 158);
                    if (tourData.Results[i + 4].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 4].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 286, 200 * i + 85, 36, 36);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 4].Winner), font, IsPlayerLost(tourData.Results[i + 4].Winner) ? Brushes.DimGray : Brushes.White, 326, 200 * i + 100);
                    }
                }
                MatchManager.DrawCrossing(e.Graphics, 376, 108, 416, 308);
                if (tourData.Results[6].Winner != 0)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Results[6].Winner);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 424, 185, 36, 36);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[6].Winner), font, Brushes.White, 464, 200);
                }
            }
        }
Beispiel #3
0
        private void TourRankList_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                for (int i = 0; i < ranks.Length; i++)
                {
                    Image        head         = MatchManager.GetHeadImage(ranks[i].Id);
                    PeopleConfig peopleConfig = ConfigData.GetPeopleConfig(ranks[i].Id);
                    e.Graphics.DrawImage(head, 85, 32 * i, 24, 24);
                    e.Graphics.DrawString(string.Format("{0}", i + 1), font, Brushes.White, 35, 32 * i + 5);
                    e.Graphics.DrawString(string.Format("{0}", ranks[i].Id == -1 ? UserProfile.ProfileName : peopleConfig.Name), font, Brushes.White, 120, 32 * i + 5);
                    e.Graphics.DrawString(string.Format("{0}", ranks[i].Id == -1 ? UserProfile.InfoBasic.Level : peopleConfig.Level), font, Brushes.White, 220, 32 * i + 5);
                    e.Graphics.DrawString(string.Format("{0}", ConfigData.GetJobConfig(ranks[i].Id == -1 ? UserProfile.InfoBasic.Job : peopleConfig.Job).Name), font, Brushes.White, 260, 32 * i + 5);
                    e.Graphics.DrawString(string.Format("{0}", ranks[i].Mark).PadLeft(5, ' '), font, Brushes.Gold, 360, 32 * i + 5);
                }

                font.Dispose();
            }
        }
Beispiel #4
0
        private void TourCup16_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                for (int i = 0; i < 16; i++)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Pids[i]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 10, 36 * i + 10, 24, 24);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[i]), font, IsPlayerLost(tourData.Pids[i]) ? Brushes.DimGray : Brushes.White, 36, 36 * i + 15);
                }
                for (int i = 0; i < 8; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 90, 72 * i + 21, 126, 72 * i + 57);
                    if (tourData.Results[i].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 128, 72 * i + 25, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i].Winner), font, IsPlayerLost(tourData.Results[i].Winner) ? Brushes.DimGray : Brushes.White, 154, 72 * i + 30);
                    }
                }
                for (int i = 0; i < 4; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 208, 144 * i + 38, 244, 144 * i + 110);
                    if (tourData.Results[i + 8].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 8].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 246, 144 * i + 61, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 8].Winner), font, IsPlayerLost(tourData.Results[i + 8].Winner) ? Brushes.DimGray : Brushes.White, 272, 144 * i + 66);
                    }
                }
                for (int i = 0; i < 2; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 326, 288 * i + 74, 362, 288 * i + 219);
                    if (tourData.Results[i + 12].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 12].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 364, 288 * i + 134, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 12].Winner), font, IsPlayerLost(tourData.Results[i + 12].Winner) ? Brushes.DimGray : Brushes.White, 390, 288 * i + 140);
                    }
                }
                MatchManager.DrawCrossing(e.Graphics, 444, 149, 480, 435);
                if (tourData.Results[14].Winner != 0)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Results[14].Winner);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 482, 278, 24, 24);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[14].Winner), font, Brushes.White, 508, 284);
                }
            }
        }