From 0190c18be2569800b5c10e9c8db4a46cb34e2acb Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 10 May 2023 07:16:28 -0400 Subject: [PATCH] Fix for backslash bug in Audio Editor --- PCK-Studio/Forms/Editor/AudioEditor.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index 309b9be6..6cc90670 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -17,8 +17,7 @@ using OMI.Formats.Languages; using OMI.Formats.Pck; using PckStudio.Forms.Additional_Popups; -// Audio Editor by MattNL -// additional work and optimization by Miku-666 +// Audio Editor by MattNL and Miku-666 namespace PckStudio.Forms.Editor { @@ -75,9 +74,15 @@ namespace PckStudio.Forms.Editor { treeView1.BeginUpdate(); treeView1.Nodes.Clear(); + foreach (var category in audioFile.Categories) { - if(category.audioType == PckAudioFile.AudioCategory.EAudioType.Creative) + // fix songs with directories using backslash instead of forward slash + // Songs with a backslash instead of a forward slash would not play in RPCS3 + foreach (string songname in category.SongNames.FindAll(s => s.Contains('\\'))) + category.SongNames[category.SongNames.IndexOf(songname)] = songname.Replace('\\', '/'); + + if (category.audioType == PckAudioFile.AudioCategory.EAudioType.Creative) { if (category.Name == "include_overworld" && audioFile.TryGetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld, out PckAudioFile.AudioCategory overworldCategory))