bugfix for loading deleted mods + safe saves

This commit is contained in:
⍚~Nex
2024-03-17 18:00:18 +01:00
parent c3691c8f08
commit 3de8fcc804
10 changed files with 56 additions and 49 deletions
+2 -2
View File
@@ -206,11 +206,11 @@ class Chart {
var chartPath = '${songFolderPath}/charts/${difficulty.trim()}.json';
var metaPath = '${songFolderPath}/meta.json';
File.saveContent(chartPath, Json.stringify(filteredChart, null, saveSettings.prettyPrint == true ? "\t" : null));
CoolUtil.safeSaveFile(chartPath, Json.stringify(filteredChart, null, saveSettings.prettyPrint == true ? "\t" : null));
// idk how null reacts to it so better be sure
if (saveSettings.overrideExistingMeta == true || !FileSystem.exists(metaPath))
File.saveContent(metaPath, Json.stringify(meta, null, saveSettings.prettyPrint == true ? "\t" : null));
CoolUtil.safeSaveFile(metaPath, Json.stringify(meta, null, saveSettings.prettyPrint == true ? "\t" : null));
#end
return filteredChart;
}