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 249ee69ecb.

* Revert "Revert "Discord RPC Toggle""

This reverts commit c2eca02e94.

* Remove duplicate song saving

FileMode.OpenOrCreate go brrrrrr

* Delete Properties.meta

whats that still doing there
This commit is contained in:
Zeo 2023-03-22 21:51:44 -05:00 committed by GitHub
parent 4b56dfeb94
commit 04cbfae438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -382,7 +382,7 @@ namespace HeavenStudio.Editor
private void SaveRemixFile(string path) 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)) using (var archive = new ZipArchive(zipFile, ZipArchiveMode.Update))
{ {
@ -390,12 +390,14 @@ namespace HeavenStudio.Editor
using (var zipStream = levelFile.Open()) using (var zipStream = levelFile.Open())
zipStream.Write(Encoding.UTF8.GetBytes(GetJson()), 0, Encoding.UTF8.GetBytes(GetJson()).Length); 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); var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression);
using (var zipStream = musicFile.Open()) using (var zipStream = musicFile.Open())
zipStream.Write(MusicBytes, 0, MusicBytes.Length); zipStream.Write(MusicBytes, 0, MusicBytes.Length);
} }
} }
currentRemixPath = path; currentRemixPath = path;