mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 17:43:51 +00:00
fix(editor): quit-confirm dialog also triggers for unsaved object/NPC/quest changes
Previously only terrain edits would trigger the 'unsaved changes' prompt on quit, so a user who only added NPCs or quests could lose their work by closing the window. Now checks autoSavePendingChanges_ alongside terrain dirty state.
This commit is contained in:
parent
11f0580ccb
commit
848947604e
1 changed files with 4 additions and 1 deletions
|
|
@ -277,7 +277,10 @@ void EditorApp::processEvents() {
|
|||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
|
||||
if (event.type == SDL_QUIT) {
|
||||
if (terrain_.isLoaded() && terrainEditor_.hasUnsavedChanges()) {
|
||||
// Confirm-on-quit fires for any unsaved change — terrain edits OR
|
||||
// object/NPC/quest changes (autoSavePendingChanges_).
|
||||
bool dirty = terrainEditor_.hasUnsavedChanges() || autoSavePendingChanges_;
|
||||
if (terrain_.isLoaded() && dirty) {
|
||||
showQuitConfirm_ = true;
|
||||
} else {
|
||||
window_->setShouldClose(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue