From 77268271ee97cf1094fc9d554af1c1750267d495 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:53:58 +0300 Subject: [PATCH] fix esc not showing unsaved changes popup --- loader/src/ui/mods/settings/ModSettingsPopup.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/loader/src/ui/mods/settings/ModSettingsPopup.cpp b/loader/src/ui/mods/settings/ModSettingsPopup.cpp index 5c831fad..45d519a6 100644 --- a/loader/src/ui/mods/settings/ModSettingsPopup.cpp +++ b/loader/src/ui/mods/settings/ModSettingsPopup.cpp @@ -290,19 +290,21 @@ bool ModSettingsPopup::hasUncommitted() const { } void ModSettingsPopup::onClose(CCObject* sender) { - if (sender && this->hasUncommitted()) { + if (this->hasUncommitted()) { createQuickPopup( "Unsaved Changes", "You have unsaved changes! Are you sure you " "want to exit?", "Cancel", "Discard", [this](FLAlertLayer*, bool btn2) { - if (btn2) this->onClose(nullptr); + if (btn2) { + GeodePopup::onClose(nullptr); + } } ); return; } - Popup::onClose(sender); + GeodePopup::onClose(sender); } ModSettingsPopup* ModSettingsPopup::create(Mod* mod) {