From 0ece5c78c5b96091b9e6997cdd0b4a02859f5290 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Thu, 17 Oct 2024 23:57:08 +0200 Subject: [PATCH] fix incorrect popup ordering in bi layers --- mod.json | 2 +- src/layers/_bases/BIBaseLayer.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mod.json b/mod.json index d57f5f0..508e707 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.7.1", + "geode": "3.8.1", "version": "v4.2.10", "gd": { "win": "2.206", diff --git a/src/layers/_bases/BIBaseLayer.cpp b/src/layers/_bases/BIBaseLayer.cpp index af93aed..8b14aed 100644 --- a/src/layers/_bases/BIBaseLayer.cpp +++ b/src/layers/_bases/BIBaseLayer.cpp @@ -108,12 +108,16 @@ void BIBaseLayer::onEnterTransitionDidFinish() { CCLayer::onEnterTransitionDidFinish(); //workaround for no esc catching bug + std::vector> alerts; + size_t i = 0; - while(Ref alert = getChildOfType(this, i++)) { - alert->retain(); + while(auto alert = getChildOfType(this, i++)) { + alerts.push_back(alert); + } + + for(auto alert : alerts) { alert->removeFromParentAndCleanup(false); alert->m_noElasticity = true; alert->show(); - alert->release(); } } \ No newline at end of file