private async void DetailForm_Load(object sender, EventArgs e) { var filename = DetailWindowManager.GetReplayFilename(replaypath); GeneralGameFileLabel.Text = filename; try { fileinfo = await ReplayReader.ReadReplayFileAsync(replaypath); ImageDownloader.SetDataDragonVersion(fileinfo.MatchMetadata.GameVersion.ToString()); } catch (Exception ex) { MessageBox.Show("Error Parsing Replay: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(1); } if (fileinfo != null) { DetailWindowManager.PopulatePlayerData(fileinfo.MatchMetadata, this); DetailWindowManager.PopulateGeneralReplayData(fileinfo, this); } else { MessageBox.Show("Error Parsing Replay", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(1); } // Set version text in about tab this.AboutVersionLabel.Text = RoflSettings.Default.VersionString; }
private void GeneralGameViewOnlineButton_Click(object sender, EventArgs e) { var matchId = _replayFile.Data.PayloadFields.MatchId; string regionEndpoint = DetailWindowManager.GetRegionEndpointName(RoflSettings.Default.Region); MessageBox.Show("This feature is still a work in progress! I need more information from different regions. Let me know if you encounter any problems.\n\n" + $"Region: {RoflSettings.Default.Region}\n" + $"Region Endpoint: {regionEndpoint}", "Beta Feature", MessageBoxButtons.OK, MessageBoxIcon.Information); System.Diagnostics.Process.Start(@"https://matchhistory.na.leagueoflegends.com/en/#match-details/" + regionEndpoint + "/" + matchId); }
///////////////////// Debug Methods private async void GeneralDebugDumpJsonButton_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(_replayFile.Location)) { var outputfile = Path.Combine(Path.GetDirectoryName(_replayFile.Location), Path.GetFileNameWithoutExtension(_replayFile.Location) + ".json"); var success = await DetailWindowManager.WriteReplayHeaderToFile(outputfile, _replayFile.Data); if (success) { MessageBox.Show("Dumped JSON!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to dump JSON", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private async void DetailForm_Load(object sender, EventArgs e) { // Load in compatibility mode if (_replayFile.Type != REPLAYTYPES.ROFL) { this.Text = this.Text + " - Compatibility Mode"; this.GeneralPlayReplaySplitButton.Enabled = false; } // Set version text in about tab this.AboutVersionLabel.Text = RoflSettings.Default.VersionString; this.GeneralGameFileLabel.Text = _replayFile.Name; await _requestManager.SetDataDragonVersionAsync(_replayFile.Data.MatchMetadata.GameVersion); DetailWindowManager.PopulatePlayerData(_replayFile.Data.MatchMetadata, this); DetailWindowManager.PopulateGeneralReplayData(_requestManager, _replayFile.Data, this); }
///////////////////// Player Tab Methods private void PlayerSelectComboBox_SelectChanged(object sender, EventArgs e) { var selectedplayername = PlayerSelectComboBox.Text; var player = (from qplayer in fileinfo.MatchMetadata.Players where qplayer["NAME"].ToString().ToUpper() == selectedplayername.ToUpper() select qplayer).FirstOrDefault(); PlayerStatsChampImage.Image = null; PlayerItemImage1.Image = null; PlayerItemImage2.Image = null; PlayerItemImage3.Image = null; PlayerItemImage4.Image = null; PlayerItemImage5.Image = null; PlayerItemImage6.Image = null; PlayerItemImage7.Image = null; DetailWindowManager.PopulatePlayerStatsData(player, this); }
///////////////////// Debug Methods private async void GeneralDebugDumpJsonButton_Click(object sender, EventArgs e) { if (fileinfo == null) { //fileinfo = (await LeagueManager.LoadAndParseReplayHeaders(replaypath)).Result; fileinfo = ReplayReader.ReadReplayFile(replaypath); } if (!string.IsNullOrEmpty(replaypath)) { var outputfile = Path.Combine(Path.GetDirectoryName(replaypath), Path.GetFileNameWithoutExtension(replaypath) + ".json"); var success = await DetailWindowManager.WriteReplayHeaderToFile(outputfile, fileinfo); if (success) { MessageBox.Show("Dumped JSON!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to dump JSON", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
///////////////////// Player Tab Methods private void PlayerSelectComboBox_SelectChanged(object sender, EventArgs e) { var selectedplayername = PlayerSelectComboBox.Text; // Find the selected player dictionary var player = (from qplayer in _replayFile.Data.MatchMetadata.AllPlayers where qplayer["NAME"].ToString().ToUpper() == selectedplayername.ToUpper() select qplayer).FirstOrDefault(); // Set images to null, so they appear blank PlayerStatsChampImage.Image = null; PlayerItemImage1.Image = null; PlayerItemImage4.Image = null; PlayerItemImage2.Image = null; PlayerItemImage5.Image = null; PlayerItemImage3.Image = null; PlayerItemImage6.Image = null; PlayerItemImage7.Image = null; // Call the manager to populate data DetailWindowManager.PopulatePlayerStatsData(_requestManager, player, this); }