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