void WorstResponseReleaseCheck(object sender, RoutedEventArgs e) { string fileDir = null; if (worstResponseList.FileName != null) { fileDir = Path.Combine(Path.GetDirectoryName(worstResponseList.FileName), "TDWorstResponse"); } for (int i = 0, end = worstResponseList.Count; i < end; ++i) { for (int j = i + 1; j < end; ++j) { if (worstResponseList[i].ID == worstResponseList[j].ID) { WorstResponses.ResponseIssue(string.Format("There are multiple {0} IDs.", worstResponseList[i].ID)); return; } } if (worstResponseList.FileName != null && !Parsing.CheckAudio(fileDir, worstResponseList[i].ID)) { WorstResponses.ResponseIssue(string.Format("Audio files are missing for response ID {0}.", worstResponseList[i].ID)); return; } } MessageBox.Show("Release check successful. This response set is compatible with the game.", "Release check result"); }
void WorstResponseRemove(object sender, RoutedEventArgs e) { if (worstResponses.SelectedItem == null) { WorstResponses.ResponseIssue("Select the response to remove."); return; } worstResponseList.Remove((WorstResponse)worstResponses.SelectedItem); }
void WorstResponseAudio(object sender, RoutedEventArgs e) { if (worstResponses.SelectedItem == null) { WorstResponses.ResponseIssue("Select the response to import the audio of."); return; } if (worstResponseList.FileName == null) { WorstResponses.ResponseIssue("The response file has to exist first. Export your work or import an existing response file."); return; } if (audioBrowser.ShowDialog() == true) { ((WorstResponse)worstResponses.SelectedItem).ImportAudio(worstResponseList.FileName, audioBrowser.FileName); } }