//
// GJShopLayer::onBack from 0x10014bb84 to 0x10014bcf0 (364 bytes)
//
// 3 xrefs:
// > GJShopLayer::keyBackClicked @ 0x10014c940
// > sub_10014C944 @ 0x10014c948
// > GJShopLayer::init @ 0x10014af18
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJShopLayer::onBack(GJShopLayer *a1, cocos2d::CCObject *a2)
{
cocos2d::CCDirector *v3; // x0
cocos2d::CCTouchDispatcher *v4; // x0
cocos2d::CCScene *v5; // x0
cocos2d::CCScene *v6; // x20
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
__n128 v9; // q1
__n128 v10; // q0
const cocos2d::CCPoint *v11; // x0
cocos2d::CCMoveTo *v12; // x0
cocos2d::CCEaseIn *v13; // x20
cocos2d::CCAction *v14; // x0
GameManager *v15; // x0
GameManager *v16; // x19
void *__p[2]; // [xsp+18h] [xbp-38h] BYREF
char v18; // [xsp+2Fh] [xbp-21h]
_DWORD v19[4]; // [xsp+30h] [xbp-20h] BYREF
cocos2d::SEL_CallFunc v20; // 0:x1.16
if ( !a1->m_closing )
{
a1->m_closing = 1;
v3 = cocos2d::CCDirector::sharedDirector();
v4 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v3->getTouchDispatcher)(v3);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, a1);
cocos2d::CCObject::retain(a1);
((void (__fastcall *)(GJShopLayer *))a1->removeFromParent)(a1);
if ( a1->m_type )
v5 = SecretRewardsLayer::scene(1);
else
v5 = GJGarageLayer::scene();
v6 = v5;
if ( v5 )
{
v7 = cocos2d::CCDirector::sharedDirector();
if ( cocos2d::CCDirector::replaceScene(v7, v6) )
{
((void (__fastcall *)(GJShopLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(cocos2d::CCScene *, GJShopLayer *, __int64))v6->addChild_0)(v6, a1, 1000);
cocos2d::CCObject::release(a1);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
v9.n128_u32[0] = v19[3];
v10.n128_u32[0] = 0;
v11 = (const cocos2d::CCPoint *)sub_100022980(v10, v9, v19);
v12 = cocos2d::CCMoveTo::create(0.3, v11);
v13 = cocos2d::CCEaseIn::create(v12, 2.0);
v20.ptr = (void (*)(void))520;
v20.adj = 1;
cocos2d::CCCallFunc::create(a1, v20);
v14 = (cocos2d::CCAction *)sub_10018A494(v13);
cocos2d::CCNode::runAction(a1, v14);
LODWORD(v13) = a1->m_type;
v15 = GameManager::sharedState();
v16 = v15;
if ( (_DWORD)v13 )
{
sub_100009900(__p, "secretLoop.mp3");
GameManager::fadeInMusic(v16, __p);
if ( v18 < 0 )
operator delete(__p[0]);
}
else
{
GameManager::fadeInMenuMusic(v15);
}
}
}
}
}