//
// SetupSmartBlockLayer::onCreate from 0x672668 to 0x67270e (166 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:55:53 +0000
//
int __fastcall SetupSmartBlockLayer::onCreate(SetupSmartBlockLayer *this, cocos2d::CCObject *a2)
{
cocos2d::CCArray *v3; // r0
cocos2d::CCObject *v4; // r1
cocos2d::CCArray *v5; // r6
cocos2d::CCArray *v6; // r1
int v7; // r5
_BOOL4 v8; // r5
EditorUI *v9; // r7
int v10; // r1
unsigned int RandomStartKey; // r0
int v12; // r1
EditorUI *v13; // r0
GameLevelManager *v14; // r0
GameManager *ActiveSmartTemplate; // r5
int v16; // r0
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(this);
v4 = *((cocos2d::CCObject **)this + 134);
v5 = v3;
if ( v4 )
{
v3 = (cocos2d::CCArray *)cocos2d::CCArray::addObject(v3, v4);
}
else
{
v6 = *((cocos2d::CCArray **)this + 135);
if ( v6 )
v3 = (cocos2d::CCArray *)cocos2d::CCArray::addObjectsFromArray(v3, v6);
}
v7 = *((_DWORD *)this + 133);
if ( v7 < 0 )
{
v14 = (GameLevelManager *)GameLevelManager::sharedState(v3);
ActiveSmartTemplate = (GameManager *)GameLevelManager::getActiveSmartTemplate(v14);
v16 = GameManager::sharedState(ActiveSmartTemplate);
EditorUI::createSmartObjectsFromTemplate(
*(cocos2d::CCArray ****)(*(_DWORD *)(v16 + 408) + 11856),
ActiveSmartTemplate,
v5,
*((unsigned __int8 *)this + 528),
*((_BYTE *)this + 529),
0,
0);
}
else
{
v8 = v7 == 9;
if ( v8 )
*((_DWORD *)this + 133) = 8;
v9 = *(EditorUI **)(*(_DWORD *)(GameManager::sharedState(v3) + 408) + 11856);
RandomStartKey = EditorUI::getRandomStartKey(*((_DWORD *)this + 133), v10);
v13 = (EditorUI *)EditorUI::smartTypeForKey(RandomStartKey, v12);
EditorUI::createSmartObjectsFromType(v9, v13, v5, v8, *((_BYTE *)this + 529));
}
return SetupSmartBlockLayer::onClose((cocos2d::CCArray **)this, nullptr);
}