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
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)
{
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;