void FinalRoundReleaseCheck(object sender, RoutedEventArgs e) { string finalRoundFileDir = null; if (finalRoundList.FileName != null) { finalRoundFileDir = Path.Combine(Path.GetDirectoryName(finalRoundList.FileName), "TDFinalRound"); } for (int i = 0, end = finalRoundList.Count; i < end; ++i) { for (int j = i + 1; j < end; ++j) { if (finalRoundList[i].ID == finalRoundList[j].ID) { FinalRounders.FinalRoundIssue(string.Format("There are multiple {0} IDs.", finalRoundList[i].ID)); return; } } if (finalRoundList[i].Items.Count < 3) { FinalRounders.FinalRoundIssue(string.Format("{0} has less than 3 answers.", finalRoundList[i].Text)); return; } if (finalRoundList.FileName != null && !Parsing.CheckAudio(finalRoundFileDir, finalRoundList[i].ID)) { FinalRounders.FinalRoundIssue(string.Format("Audio files are missing for topic ID {0}.", finalRoundList[i].ID)); return; } } MessageBox.Show("Release check successful. This topic set is compatible with the game.", "Release check result"); }
void AddTopicAudio(object sender, RoutedEventArgs e) { if (finalRounders.SelectedItem == null) { FinalRounders.FinalRoundIssue("Select the topic to import the audio of."); return; } if (finalRoundList.FileName == null) { FinalRounders.FinalRoundIssue("The final round file has to exist first. Export your work or import an existing final round file."); return; } if (audioBrowser.ShowDialog() == true) { selectedTopic.ImportTopicAudio(finalRoundList.FileName, audioBrowser.FileName); } }