Mega Region Update.

This commit is contained in:
2026-02-05 21:34:42 -05:00
parent 00bff4a91f
commit 64d6a1d95a
45 changed files with 1590 additions and 205 deletions
+8 -5
View File
@@ -99,7 +99,7 @@ namespace anm2ed
void Manager::new_(const std::filesystem::path& path) { open(path, true); }
void Manager::save(int index, const std::filesystem::path& path)
void Manager::save(int index, const std::filesystem::path& path, anm2::Compatibility compatibility)
{
if (auto document = get(index); document)
{
@@ -107,18 +107,21 @@ namespace anm2ed
ensure_parent_directory_exists(path);
document->path = !path.empty() ? path : document->path;
document->path.replace_extension(".anm2");
document->save(document->path, &errorString);
document->save(document->path, &errorString, compatibility);
recent_file_add(document->path);
}
}
void Manager::save(const std::filesystem::path& path) { save(selected, path); }
void Manager::save(const std::filesystem::path& path, anm2::Compatibility compatibility)
{
save(selected, path, compatibility);
}
void Manager::autosave(Document& document)
void Manager::autosave(Document& document, anm2::Compatibility compatibility)
{
std::string errorString{};
auto autosavePath = document.autosave_path_get();
if (!document.autosave(&errorString)) return;
if (!document.autosave(&errorString, compatibility)) return;
autosaveFiles.erase(std::remove(autosaveFiles.begin(), autosaveFiles.end(), autosavePath), autosaveFiles.end());
autosaveFiles.insert(autosaveFiles.begin(), autosavePath);