Per-document target: Extended or Rebirth

A document remembers whether it saves as the editor's document alone (marked
with ExtendedVersion on Info) or as Rebirth's document with the editor's copy
embedded. Detected on open; File > Extended Format toggles it (undoable). The
setting is now the default for new files, and the Isaac compatibility warning
only applies to Rebirth documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 16:14:25 -04:00
1 parent 1381824fb7
commit 6edf5f0e5b
110 files changed
+175 -137

No files matched your search

+1 -3
View File
@@ -154,9 +154,7 @@ namespace anm2ed::imgui
document.lastAutosaveTime += ImGui::GetIO().DeltaTime;
if (document.lastAutosaveTime > time::SECOND_M)
{
auto options = settings.anm2_options_get();
manager.command_push(
{i, [options](Manager& manager, Document& document) { manager.autosave(document, options); }});
manager.command_push({i, [](Manager& manager, Document& document) { manager.autosave(document); }});
}
}
}
+16 -6
View File
@@ -30,16 +30,15 @@ namespace anm2ed::imgui
bool Taskbar::save_execute(Manager& manager, const PendingSave& request)
{
return manager.save(request.index, request.path, request.options);
return manager.save(request.index, request.path);
}
void Taskbar::save_enqueue(Manager& manager, const PendingSave& request)
{
auto index = request.index;
auto path = request.path;
auto options = request.options;
manager.command_push({.runManager = [=](Manager& manager) { manager.save(index, path, options); }});
manager.command_push({.runManager = [=](Manager& manager) { manager.save(index, path); }});
}
bool Taskbar::save_request(Manager& manager, Settings& settings, int index, const std::filesystem::path& path,
@@ -48,11 +47,11 @@ namespace anm2ed::imgui
auto* document = manager.get(index);
if (!document) return false;
PendingSave request{.index = index, .path = path, .options = settings.anm2_options_get()};
PendingSave request{.index = index, .path = path};
if (isQueued)
{
// The game's copy would differ from the document: ask first.
if (settings.fileIsWarnIsaac && !request.options.isExtendedFormat &&
if (settings.fileIsWarnIsaac && !document->model.isExtendedFormat &&
model::isaac_issues_get(document->model) != model::IsaacIssues{})
{
isaacSave = request;
@@ -124,6 +123,16 @@ namespace anm2ed::imgui
if (ImGui::MenuItem(localize.get(LABEL_EXPLORE_XML_LOCATION), nullptr, false, document))
dialog.file_explorer_open(document->directory_get());
// Which game this document is saved for: the editor's format alone, or Rebirth's (with the editor's copy).
auto isExtendedFormat = document && document->model.isExtendedFormat;
if (ImGui::MenuItem(localize.get(LABEL_DOCUMENT_EXTENDED_FORMAT), nullptr, isExtendedFormat, document))
manager.command_push({manager.selected, [isExtendedFormat](Manager&, Document& document)
{
document.edit_apply(EDIT_DOCUMENT_FORMAT, [&](model::Model& model)
{ model.isExtendedFormat = !isExtendedFormat; });
}});
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_DOCUMENT_EXTENDED_FORMAT));
ImGui::Separator();
if (ImGui::MenuItem(localize.get(LABEL_EXIT), settings.shortcutExit.c_str())) isQuitting = true;
ImGui::EndMenu();
@@ -131,7 +140,8 @@ namespace anm2ed::imgui
if (dialog.is_selected(Dialog::ANM2_CREATE))
{
auto path = dialog.path;
manager.command_push({.runManager = [path](Manager& manager) { manager.new_(path); }});
manager.command_push({.runManager = [path, isExtendedFormat = settings.isFileExtendedFormat](Manager& manager)
{ manager.new_(path, isExtendedFormat); }});
dialog.reset();
}
-1
View File
@@ -24,7 +24,6 @@ namespace anm2ed::imgui
{
int index{-1};
std::filesystem::path path{};
Options options{};
bool isQueued{};
};