大幅优化

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-10-05 11:45:32 +08:00
parent e145d65d38
commit 725009e354
66 changed files with 616229 additions and 175087 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Ichni.Editor;
using Ichni.RhythmGame;
using Ichni.RhythmGame.Beatmap;
@@ -111,15 +112,21 @@ namespace Ichni
public void Save()
{
LogWindow.Log("Start Saving...");
_ = SaveAllCoroutine();
SaveProjectInfo();
SaveSongInfo();
SaveBeatMap();
SaveCommandScripts();
}
public async Task SaveAllCoroutine()
{
await Task.Run(() =>
{
SaveProjectInfo();
SaveSongInfo();
SaveBeatMap();
SaveCommandScripts();
});
LogWindow.Log("Save Complete", Color.green);
}
private void SaveProjectInfo()
{
EditorManager.instance.projectInformation.SaveBM();
@@ -535,11 +542,11 @@ namespace Ichni
File.Delete(oldestSave);
saveFiles.RemoveAt(saveFiles.Count - 1);
LogWindow.Log("AutoSave finished, the oldest file deleted");
LogWindow.Log("AutoSaving... , the oldest file deleted");
}
else
{
LogWindow.Log("AutoSave finished");
LogWindow.Log("AutoSaving...");
}
// 依次重命名存档
@@ -558,9 +565,17 @@ namespace Ichni
private void SaveBeatMap(string autoSavePath)
{
EditorManager.instance.beatmapContainer.SaveBM();
ES3.Save("Beatmap", EditorManager.instance.beatmapContainer.matchedBM as BeatmapContainer_BM,
autoSavePath, ProjectManager.SaveSettings);
SaveBeatMapCoroutine(autoSavePath);
}
async void SaveBeatMapCoroutine(string autoSavePath)
{
await Task.Run(() =>
{
EditorManager.instance.beatmapContainer.SaveBM();
ES3.Save("Beatmap", EditorManager.instance.beatmapContainer.matchedBM as BeatmapContainer_BM, autoSavePath, ProjectManager.SaveSettings);
});
LogWindow.Log("Auto-saved", Color.green);
}
private List<string> GetSortedSaveFiles()