Skip to content

Commit

Permalink
o
Browse files Browse the repository at this point in the history
mishpro-programm committed Mar 28, 2024
1 parent e657bf0 commit 8522cf0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ class $modify(MyPauseLayer, PauseLayer) {
};
class $modify(FixedPlayLayer, PlayLayer) {
bool isPaused(){
return CCDirector::sharedDirector()->getRunningScene()->getChildByID("PauseLayer") != nullptr;
CCDirector::sharedDirector()->getRunningScene()->getChildByID("PauseLayer") != nullptr;
}
void onEnterH(){
auto sc = this->getParent() == CCScene::get();
@@ -75,7 +75,11 @@ class $modify(CCLayer){
void onEnter(){
if(reinterpret_cast<void*>(PlayLayer::get()) == reinterpret_cast<void*>(this)){
auto pl = reinterpret_cast<FixedPlayLayer*>(static_cast<CCLayer*>(this));
if(pl->isPaused()){
bool _isPaused;
Loader::get()->queueInMainThread([pl, _isPaused] {
_isPaused = pl->isPaused();
});
if(_isPaused){
pl->onEnterH();
} else {
CCLayer::onEnter();

0 comments on commit 8522cf0

Please sign in to comment.