diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index 97df4da8..9f657771 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -304,6 +304,7 @@ namespace PckStudio.Forms.Editor PCKAudioFile.AudioCategory overworldCategory = audioFile.GetCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld); + bool songs_missing = false; foreach (var category in audioFile.Categories) { if (category.SongNames.Count < 1) @@ -312,6 +313,16 @@ namespace PckStudio.Forms.Editor return; } + foreach(var song in category.SongNames) + { + string FileName = Path.Combine(parent.GetDataPath(), song + ".binka"); + if (!File.Exists(FileName)) + { + songs_missing = true; + MessageBox.Show("\"" + song + ".binka\" does not exist in the \"Data\" folder. The game will crash when attempting to load this track.", "File missing"); + } + } + category.Name = ""; if (playOverworldInCreative.Checked && category.audioType == PCKAudioFile.AudioCategory.EAudioType.Creative) { @@ -327,6 +338,12 @@ namespace PckStudio.Forms.Editor } } + if (songs_missing) + { + MessageBox.Show("Failed to save AudioData file because there are missing song entries", "Error"); + return; + } + using (var stream = new MemoryStream()) { PCKAudioFileWriter.Write(stream, audioFile, _isLittleEndian);