//
// SetupSmartBlockLayer::onClose from 0x1404583d0 to 0x140458481 (177 bytes)
//
// 8 xrefs:
// > SetupSmartBlockLayer::onPasteTemplate @ 0x140458119
// > SetupSmartBlockLayer::onCreate @ 0x1404588b5
// > SetupSmartBlockLayer::onCreateTemplate @ 0x1404589b2
// > SetupSmartBlockLayer::keyBackClicked @ 0x140458a79
// > SetupSmartBlockLayer::init @ 0x140456dbf
// > ??> @ 0x1406a37d8
// > ??> @ 0x1406a37e8
// > ??> @ 0x1406daa30
//
// 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 SetupSmartBlockLayer::onClose(SetupSmartBlockLayer *a1, cocos2d::CCObject *a2)
{
__int64 v3; // rax
cocos2d::CCTouchDispatcher *v4; // rax
SmartGameObject *m_gameObject; // rcx
cocos2d::CCArray *m_gameObjects; // rcx
unsigned int v7; // edi
SmartGameObject *v8; // rax
_BOOL8 v9; // rdx
v3 = cocos2d::CCDirector::sharedDirector(a1);
v4 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 144LL))(v3);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, a1);
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
SmartGameObject::updateSmartFrame(m_gameObject);
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
{
v7 = 0;
if ( cocos2d::CCArray::count(m_gameObjects) )
{
do
{
v8 = (SmartGameObject *)cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, v7);
SmartGameObject::updateSmartFrame(v8);
++v7;
}
while ( v7 < cocos2d::CCArray::count(a1->m_gameObjects) );
}
}
}
a1->setKeypadEnabled(a1, 0);
LOBYTE(v9) = 1;
a1->removeFromParentAndCleanup(a1, v9);
}