Beispiel #1
0
 static void Main()
 {
     Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       var main = new Main();
       main.FormClosed += (sender, e) => Application.Exit();
       Application.Run();
 }
Beispiel #2
0
        public SummonerDetails(SummonerStats data, List<LogData> logs, Main form)
        {
            mainForm = form;
              InitializeComponent();
              Data = data;
              logData = logs;

              headerLabel.Text = data.Name;
              if (!String.IsNullOrEmpty(data.Server)) {
            headerLabel.Text += " (" + data.Server + ")";
              }

              var gamesDetails = new List<string>();
              if (data.GamesWith > 0) {
            gamesDetails.Add("with: " + data.GamesWith);
              }
              if (data.GamesAgainst > 0) {
            gamesDetails.Add("against: " + data.GamesAgainst);
              }
              int spec = data.Games - data.GamesWith - data.GamesAgainst - data.GamesAs;
              if (spec > 0) {
            gamesDetails.Add("spec: " + spec);
              }
              if (data.GamesAs > 0 && gamesDetails.Count > 0) {
            gamesDetails.Insert(0, "as: " + data.GamesAs);
              }
              var gamesText = gamesPlayedLabel.Text =
            String.Format("Games: {0}{1}", data.Games, gamesDetails.Count > 0 ? " (" + String.Join(", ", gamesDetails.ToArray()) + ")" : "");

              // Create links
              string[] labels = {"Games", "as", "with", "against", "spec"};
              foreach (var label in labels) {
            var match = Regex.Match(gamesText, label + ": ([0-9]+)");
            if (match.Success) {
              var type = label == "Games" ? "" : label;
              gamesPlayedLabel.Links.Add(new LinkLabel.Link(match.Groups[1].Index, match.Groups[1].Length, type));
            }
              }

              var recordDetails = new List<string>();
              if (data.WinsAs + data.LossesAs > 0) {
            recordDetails.Insert(0, "as: " + data.WinsAs + "-" + data.LossesAs);
              }
              if (data.WinsWith + data.LossesWith > 0) {
            recordDetails.Add("with: " + data.WinsWith + "-" + data.LossesWith);
              }
              int winsAgainst = data.KnownWins - data.WinsWith - data.WinsAs;
              int lossesAgainst = data.KnownLosses - data.LossesWith - data.LossesAs;
              if (winsAgainst + lossesAgainst > 0) {
            recordDetails.Add("against: " + lossesAgainst + "-" + winsAgainst);
              }
              recordLabel.Text = "Known record" + (recordDetails.Count > 0 ? " " + String.Join(", ", recordDetails.ToArray()) : ": 0-0");

              timeLabel.Text = "Total time logged: " + Util.FormatTime(data.TimePlayed);

              LoadChampionStats();
              LoadDeathStats();
        }
Beispiel #3
0
        public GameDetails(LogData game, Main form)
        {
            mainForm = form;
              InitializeComponent();

              Game = game;
              headerLabel.Text = String.Format("{0}, {1}v{2}{3}", Game.Map, Game.BlueTeam.Count, Game.PurpleTeam.Count,
                                       Game.BotGame ? " (Co-op vs. AI)" : "");
              switch (Game.ExitCode) {
            case LogData.ExitCodes.WIN:
              resultLabel.Text = "VICTORY";
              resultLabel.BackColor = Color.LimeGreen;
              resultLabel.ForeColor = Color.White;
              break;
            case LogData.ExitCodes.LOSE:
              resultLabel.Text = "DEFEAT";
              resultLabel.BackColor = Color.Tomato;
              resultLabel.ForeColor = Color.Black;
              break;
            case LogData.ExitCodes.CRASH:
              resultLabel.Text = "CRASH";
              resultLabel.BackColor = Color.Red;
              resultLabel.ForeColor = Color.White;
              break;
            case LogData.ExitCodes.UNKNOWN:
              resultLabel.Text = "UNKNOWN";
              resultDisclaimer.SetToolTip(resultLabel, "Game result was not logged in this client version.");
              resultLabel.BackColor = Color.Silver;
              resultLabel.ForeColor = Color.Black;
              break;
            case LogData.ExitCodes.LEAVE:
              resultLabel.Text = "LEAVE";
              resultLabel.BackColor = Color.Yellow;
              resultLabel.ForeColor = Color.Black;
              break;
              }
              if (Game.Spectated) {
            resultLabel.Text = "SPECTATED";
            resultLabel.BackColor = Color.SlateBlue;
            resultLabel.ForeColor = Color.White;
            deathsLabel.Text = "You spectated this game.";
              } else {
            string msg = "";
            if (Game.Deaths.Count > 7) {
              msg = " (Feeder!)";
            } else if (Game.Deaths.Count == 0) {
              msg = " (Nice!)";
            }
            deathsLabel.Text = String.Format("You had {0} death{1} this game. {2}", Game.Deaths.Count, Game.Deaths.Count == 1 ? "" : "s", msg);
            if (Game.Deaths.Count > 0) {
              deathsLabel.LinkArea = new LinkArea("You had ".Length, Game.Deaths.Count.ToString().Length);
            }
              }

              dateLabel.Text = String.Format("Played on {0}{1} (version {2})",
                                     Game.GameStartDate.ToString(@"MMM d, yyyy h:mm tt"),
                                     Game.Server == "" ? "" : " on " + Game.Server,
                                     Game.GameVersion);
              lengthLabel.Text = String.Format("Game length: {0}:{1:d2}", Game.GameLength/60, Game.GameLength%60);

              foreach (var summoner in Game.BlueTeam) {
            AddSummoner(summoner, blueTeamFlow, true, summoner.Name == Game.PlayerName);
              }
              foreach (var summoner in Game.PurpleTeam) {
            AddSummoner(summoner, purpleTeamFlow, false, summoner.Name == Game.PlayerName);
              }

              // for Hexakill
              if (Game.BlueTeam.Count > 5 || Game.PurpleTeam.Count > 5) {
            this.Height += 22;
              }
        }