Skip to content

Commit

Permalink
v1.1.1 - Separate audio import checks
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Mar 19, 2023
1 parent fbef6a1 commit d1d0b77
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
8 changes: 6 additions & 2 deletions TriviaMurderPartyModder/MainWindow.FinalRound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ void AddTopicChoices(object _, RoutedEventArgs e) {
}
}

void AddTopicAudio(object _, RoutedEventArgs e) =>
selectedTopic.ImportTopicAudio(finalRoundList.DataFolderPath, LoadAudio(questions, questionList));
void AddTopicAudio(object _, RoutedEventArgs e) {
string file = LoadAudio(finalRounders, finalRoundList);
if (file != null) {
selectedTopic.ImportTopicAudio(finalRoundList.DataFolderPath, file);
}
}

void TopicIDChange(object sender, TextChangedEventArgs e) {
TextBox box = (TextBox)sender;
Expand Down
2 changes: 1 addition & 1 deletion TriviaMurderPartyModder/MainWindow.WorstDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void WorstDrawingImportLastSave(object _, RoutedEventArgs e) =>
void WorstDrawingReleaseCheck(object _, RoutedEventArgs e) => ReleaseCheck(worstDrawingList);
void WorstDrawingAudio(object _, RoutedEventArgs e) =>
((WorstDrawing)worstDrawings.SelectedItem).ImportAudio(worstDrawingList.DataFolderPath,
LoadAudio(questions, questionList));
LoadAudio(worstDrawings, worstDrawingList));
void WorstDrawingRemove(object _, RoutedEventArgs e) => RemoveElement(worstDrawings, worstDrawingList);
}
}
2 changes: 1 addition & 1 deletion TriviaMurderPartyModder/MainWindow.WorstResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void WorstResponseImportLastSave(object _, RoutedEventArgs e) =>
void WorstResponseReleaseCheck(object _, RoutedEventArgs e) => ReleaseCheck(worstResponseList);
void WorstResponseAudio(object _, RoutedEventArgs e) =>
((WorstResponse)worstResponses.SelectedItem).ImportAudio(worstResponseList.DataFolderPath,
LoadAudio(questions, questionList));
LoadAudio(worstResponses, worstResponseList));
void WorstResponseRemove(object _, RoutedEventArgs e) => RemoveElement(worstResponses, worstResponseList);
}
}
12 changes: 12 additions & 0 deletions TriviaMurderPartyModder/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ string LoadAudio<T>(DataGrid grid, DataFile<T> list) {
list.Issue(Properties.Resources.noAudioImportSelection);
return null;
}
return FinalizeLoadAudio(list);
}

string LoadAudio<T>(TreeView tree, DataFile<T> list) {
if (tree.SelectedItem == null) {
list.Issue(Properties.Resources.noAudioImportSelection);
return null;
}
return FinalizeLoadAudio(list);
}

string FinalizeLoadAudio<T>(DataFile<T> list) {
if (list.FileName == null) {
list.Issue(Properties.Resources.noSavedFile);
return null;
Expand Down
4 changes: 2 additions & 2 deletions TriviaMurderPartyModder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.1.0")]

0 comments on commit d1d0b77

Please sign in to comment.