From 04cbfae438e9c9463062df1f117a011a9f1c2969 Mon Sep 17 00:00:00 2001 From: Zeo <67521686+ThatZeoMan@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:51:44 -0500 Subject: [PATCH] Remove duplicate song saving (#356) * Unrecognized entity support Due to some recent discoveries about a certain upcoming rhythm game, I have added support for unrecognized entities found in remix.json to be loaded and moved, and be able to save them. * Discord RPC Toggle Required for Mac use. Since there is no persistent settings save, it must be re-enabled each time you open the program. * Revert "Discord RPC Toggle" This reverts commit 249ee69ecb1837048fb2f1e45c5dbfffabb11b47. * Revert "Revert "Discord RPC Toggle"" This reverts commit c2eca02e94d5bc4924c87099f71a25fff8ff101d. * Remove duplicate song saving FileMode.OpenOrCreate go brrrrrr * Delete Properties.meta whats that still doing there --- Assets/Scripts/LevelEditor/Editor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 85547c757..7e86d81d5 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -382,7 +382,7 @@ namespace HeavenStudio.Editor private void SaveRemixFile(string path) { - using (FileStream zipFile = File.Open(path, FileMode.Create)) + using (FileStream zipFile = File.Open(path, FileMode.OpenOrCreate)) { using (var archive = new ZipArchive(zipFile, ZipArchiveMode.Update)) { @@ -390,12 +390,14 @@ namespace HeavenStudio.Editor using (var zipStream = levelFile.Open()) zipStream.Write(Encoding.UTF8.GetBytes(GetJson()), 0, Encoding.UTF8.GetBytes(GetJson()).Length); - if (MusicBytes != null) + if ((MusicBytes != null) && (changedMusic == true)) { + Debug.Log("Saving music..."); var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression); using (var zipStream = musicFile.Open()) zipStream.Write(MusicBytes, 0, MusicBytes.Length); } + } currentRemixPath = path;