Isaac compatibility warning on save

Settings > File > Isaac Compatibility Warning (on by default): saving in
the Isaac format first lists what the game's copy can't keep as it is -
eased frames (baked into one-frame steps), group transforms (baked into
their items), shear and shaders (dropped), trigger sounds (dropped) - with
Save Anyway / Cancel. model::isaac_issues_get counts them (tested on the
fixtures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 21:05:57 -04:00
1 parent 251d04848a
commit 8fb28ef30a
8 files changed
+104

No files matched your search

+39
View File
@@ -9,6 +9,7 @@
#include "document.hpp"
#include "log.hpp"
#include "model/xml.hpp"
#include "path.hpp"
#include "strings.hpp"
#include "toast.hpp"
@@ -50,6 +51,14 @@ namespace anm2ed::imgui
PendingSave request{.index = index, .path = path, .options = settings.anm2_options_get()};
if (isQueued)
{
// The game's copy would differ from the document: ask first.
if (settings.fileIsWarnIsaac && !request.options.isExtendedFormat &&
model::isaac_issues_get(document->model) != model::IsaacIssues{})
{
isaacSave = request;
isaacPopup.open();
return false;
}
save_enqueue(manager, request);
return true;
}
@@ -356,6 +365,36 @@ namespace anm2ed::imgui
aboutPopup.end();
isaacPopup.trigger();
if (ImGui::BeginPopupModal(isaacPopup.label(), &isaacPopup.isOpen, ImGuiWindowFlags_NoResize))
{
ImGui::TextWrapped("%s", localize.get(TEXT_ISAAC_ISSUES));
if (auto document = manager.get(isaacSave.index))
{
auto issues = model::isaac_issues_get(document->model);
for (auto [count, format] : {std::pair{issues.easedFrames, FORMAT_ISAAC_EASED_FRAMES},
{issues.groupTransforms, FORMAT_ISAAC_GROUP_TRANSFORMS},
{issues.shearFrames, FORMAT_ISAAC_SHEAR_FRAMES},
{issues.shaderFrames, FORMAT_ISAAC_SHADER_FRAMES},
{issues.triggerSounds, FORMAT_ISAAC_TRIGGER_SOUNDS}})
if (count > 0) ImGui::BulletText("%s", localize_format(format, count).c_str());
}
ImGui::TextWrapped("%s", localize.get(TEXT_ISAAC_EDITOR_COPY));
auto widgetSize = widget_size_with_row_get(2);
shortcut(manager.chords[SHORTCUT_CONFIRM]);
if (ImGui::Button(localize.get(LABEL_SAVE_ANYWAY), widgetSize))
{
save_enqueue(manager, isaacSave);
isaacPopup.close();
}
ImGui::SameLine();
shortcut(manager.chords[SHORTCUT_CANCEL]);
if (ImGui::Button(localize.get(BASIC_CANCEL), widgetSize)) isaacPopup.close();
ImGui::EndPopup();
}
isaacPopup.end();
if (shortcut(manager.chords[SHORTCUT_NEW], shortcut::GLOBAL)) dialog.file_save(Dialog::ANM2_CREATE);
if (shortcut(manager.chords[SHORTCUT_OPEN], shortcut::GLOBAL)) dialog.file_open(Dialog::ANM2_OPEN, true);
if (shortcut(manager.chords[SHORTCUT_SAVE], shortcut::GLOBAL))
+2
View File
@@ -40,6 +40,8 @@ namespace anm2ed::imgui
PopupHelper(LABEL_TASKBAR_GENERATE_REGIONS_FROM_ANIMATIONS, imgui::POPUP_SMALL_NO_HEIGHT)};
PopupHelper changePopup{PopupHelper(LABEL_CHANGE_ALL_FRAME_PROPERTIES, imgui::POPUP_NORMAL_NO_HEIGHT)};
PopupHelper overwritePopup{PopupHelper(LABEL_TASKBAR_OVERWRITE_FILE, imgui::POPUP_SMALL_NO_HEIGHT)};
PopupHelper isaacPopup{PopupHelper(LABEL_ISAAC_COMPATIBILITY_WARNING, imgui::POPUP_SMALL_NO_HEIGHT)};
PendingSave isaacSave{};
PopupHelper renderPopup{PopupHelper(LABEL_TASKBAR_RENDER_ANIMATION, imgui::POPUP_SMALL_NO_HEIGHT)};
PopupHelper configurePopup{PopupHelper(LABEL_TASKBAR_CONFIGURE)};
PopupHelper aboutPopup{PopupHelper(LABEL_TASKBAR_ABOUT)};
+2
View File
@@ -82,6 +82,8 @@ namespace anm2ed::imgui::wizard
ImGui::SeparatorText(localize.get(LABEL_OPTIONS));
ImGui::Checkbox(localize.get(LABEL_OVERWRITE_WARNING), &temporary.fileIsWarnOverwrite);
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_OVERWRITE_WARNING));
ImGui::Checkbox(localize.get(LABEL_ISAAC_COMPATIBILITY_WARNING), &temporary.fileIsWarnIsaac);
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_ISAAC_COMPATIBILITY_WARNING));
ImGui::SeparatorText(localize.get(LABEL_SERIALIZATION));
ImGui::Checkbox(localize.get(LABEL_EXTENDED_FORMAT), &temporary.isFileExtendedFormat);