fix Notification not being at the top of the scene tree

This commit is contained in:
HJfod 2023-04-15 14:20:33 +03:00
parent 7bcb6d75eb
commit 475499407f

View file

@ -166,7 +166,8 @@ void Notification::show() {
if (!this->getParent()) { if (!this->getParent()) {
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);
CCDirector::get()->getRunningScene()->addChild(this); this->setZOrder(CCScene::get()->getHighestChildZ() + 100);
CCScene::get()->addChild(this);
} }
SceneManager::get()->keepAcrossScenes(this); SceneManager::get()->keepAcrossScenes(this);
m_showing = true; m_showing = true;