Beispiel #1
0
 private void Champion_Click(object sender, EventArgs e)
 {
     Program.MainFormInstance.ShowChampInfo(CurrentGame.GetChampionID(CurrentChampion));
 }
Beispiel #2
0
        public ReplayPanel(GhostReplay replay)
            : base(replay.Flags)
        {
            try
            {
                rep   = replay;
                IsPBE = (rep.Platform == "PBE1");
                InitializeComponent();
                metroLabel1.Text = replay.RecordDate.ToShortDateString() + " " + replay.RecordDate.ToShortTimeString();
                stats            = replay.GameStats;

                if (stats != null)
                {
                    bluewins = IsWon(100);
                    string dur = string.Format("{0:0}:{1:00}", rep.GameLength.Minutes, rep.GameLength.Seconds);
                    if (rep.SummonerName != "")
                    {
                        if (IsWon(rep.SummonerName))
                        {
                            GameWon    = true;
                            maplb.Text = stats.GameMode + "  - " + dur + " - Win";
                        }
                        else
                        {
                            GameWon     = false;
                            maplb.Text  = stats.GameMode + "  - " + dur + " - Loss";
                            maplb.Style = MetroColorStyle.Red;
                        }
                    }
                    else
                    {
                        GameWon = false;
                        if (IsWon(100))
                        {
                            maplb.Text = stats.GameMode + "  - " + dur + " - Blue Team Wins";
                        }
                        else
                        {
                            maplb.Text = stats.GameMode + "  - " + dur + " - Red Team Wins";
                        }
                    }
                    if (replay.SummonerName != null)
                    {
                        champion = FindSkinName(replay.SummonerName);
                        if (champion != null)
                        {
                            Replaylb.Text = replay.SummonerName + " - " + champion;
                            cid           = CurrentGame.GetChampionID(champion);

                            if (File.Exists(Application.StartupPath + @"\Champions\" + champion + ".png"))
                            {
                                this.Champion.BackgroundImage = Image.FromFile(Application.StartupPath + @"\Champions\" + champion + ".png");
                            }
                            else
                            {
                                this.Champion.BackgroundImage = Ghostblade.Properties.Resources.Unknown;
                            }
                        }
                        else
                        {
                            Replaylb.Text = replay.SummonerName;
                        }
                    }
                    else
                    {
                        champion = FindSkinName(Program.MainFormInstance.SelectedAccount.SummonerName);
                        if (champion != null)
                        {
                            Replaylb.Text = Program.MainFormInstance.SelectedAccount.SummonerName + " - " + champion;
                            cid           = CurrentGame.GetChampionID(champion);
                            if (File.Exists(Application.StartupPath + @"\Champions\" + champion + ".png"))
                            {
                                this.Champion.BackgroundImage = Image.FromFile(Application.StartupPath + @"\Champions\" + champion + ".png");
                            }
                            else
                            {
                                this.Champion.BackgroundImage = Ghostblade.Properties.Resources.Unknown;
                            }
                        }
                        else
                        {
                            Replaylb.Text = "Unknown";
                        }
                    }
                }
                gameidlb.Text = replay.MetaData.gameKey.gameId.ToString();
                if (replay.Platform == "PBE1" && SettingsManager.Settings.HasPBE)
                {
                    versionlb.Style = MetroColorStyle.Orange;
                    VersionResult vr = RiotTool.Instance.CompareVersions(SettingsManager.Settings.PbeVersion, rep.GameVersion);

                    if (vr == VersionResult.OUTDATED)
                    {
                        versionlb.Style = MetroColorStyle.Red;
                    }
                    else if (vr == VersionResult.PREDATED)
                    {
                        versionlb.Style = MetroColorStyle.Blue;
                    }
                    else if (vr == VersionResult.OK)
                    {
                        versionlb.Style = MetroColorStyle.Green;
                    }
                }
                else
                {
                    versionlb.Style = MetroColorStyle.Orange;
                    VersionResult vr = RiotTool.Instance.CompareVersions(SettingsManager.Settings.GameVersion, rep.GameVersion);

                    if (vr == VersionResult.OUTDATED)
                    {
                        versionlb.Style = MetroColorStyle.Red;
                    }
                    else if (vr == VersionResult.PREDATED)
                    {
                        versionlb.Style = MetroColorStyle.Blue;
                    }
                    else if (vr == VersionResult.OK)
                    {
                        versionlb.Style = MetroColorStyle.Green;
                    }
                }

                versionlb.Text = replay.GameVersion;

                if ((rep.Flags & ReplayInfo.BaronReplays) == ReplayInfo.BaronReplays)
                {
                    Replaylb.Text += " - [BR]";
                }
                else if ((rep.Flags & ReplayInfo.LolReplay) == ReplayInfo.LolReplay)
                {
                    Replaylb.Text += " - [LR]";
                }
                else if ((rep.Flags & ReplayInfo.UnknownRecorder) == ReplayInfo.UnknownRecorder)
                {
                    Replaylb.Text += " - [UR]";
                }
            }
            catch (Exception ex)
            {
            }
        }