fix esc not showing unsaved changes popup

This commit is contained in:
HJfod 2024-09-09 23:53:58 +03:00
parent ad537375fa
commit 77268271ee

View file

@ -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 <cr>unsaved changes</c>! 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<Mod*>::onClose(sender);
GeodePopup::onClose(sender);
}
ModSettingsPopup* ModSettingsPopup::create(Mod* mod) {