mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
fix the index notif staying on all the time
This commit is contained in:
parent
0bdb0df702
commit
c967b520df
3 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ namespace geode {
|
||||||
class GEODE_DLL SceneManager {
|
class GEODE_DLL SceneManager {
|
||||||
protected:
|
protected:
|
||||||
cocos2d::CCArray* m_persistedNodes;
|
cocos2d::CCArray* m_persistedNodes;
|
||||||
|
cocos2d::CCScene* m_lastScene = nullptr;
|
||||||
|
|
||||||
bool setup();
|
bool setup();
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,6 @@ void Notification::show() {
|
||||||
auto winSize = CCDirector::get()->getWinSize();
|
auto winSize = CCDirector::get()->getWinSize();
|
||||||
this->setPosition(winSize.width / 2, winSize.height / 4);
|
this->setPosition(winSize.width / 2, winSize.height / 4);
|
||||||
this->setZOrder(CCScene::get()->getHighestChildZ() + 100);
|
this->setZOrder(CCScene::get()->getHighestChildZ() + 100);
|
||||||
CCScene::get()->addChild(this);
|
|
||||||
}
|
}
|
||||||
SceneManager::get()->keepAcrossScenes(this);
|
SceneManager::get()->keepAcrossScenes(this);
|
||||||
m_showing = true;
|
m_showing = true;
|
||||||
|
|
|
@ -23,6 +23,10 @@ SceneManager::~SceneManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneManager::keepAcrossScenes(CCNode* node) {
|
void SceneManager::keepAcrossScenes(CCNode* node) {
|
||||||
|
if (m_lastScene) {
|
||||||
|
node->removeFromParentAndCleanup(false);
|
||||||
|
m_lastScene->addChild(node);
|
||||||
|
}
|
||||||
m_persistedNodes->addObject(node);
|
m_persistedNodes->addObject(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,4 +40,5 @@ void SceneManager::willSwitchToScene(CCScene* scene) {
|
||||||
node->removeFromParentAndCleanup(false);
|
node->removeFromParentAndCleanup(false);
|
||||||
scene->addChild(node);
|
scene->addChild(node);
|
||||||
}
|
}
|
||||||
|
m_lastScene = scene;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue