//
// SetupSmartBlockLayer::onCreate from 0xb141c8 to 0xb142b4 (236 bytes)
//
// 3 xrefs:
// > ??> @ 0xe85d0
// > SetupSmartBlockLayer::init @ 0xb15084
// > ??> @ 0x1547018
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:01:31 +0000
//
__int64 __fastcall SetupSmartBlockLayer::onCreate(SetupSmartBlockLayer *this, cocos2d::CCObject *a2)
{
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x21
cocos2d::CCObject *v5; // x1
GameLevelManager *v6; // x0
unsigned __int8 v7; // w20
EditorUI *v8; // x22
EditorUI *RandomStartKey; // x0
unsigned int v10; // w0
cocos2d::CCArray *v11; // x1
GameLevelManager *v12; // x0
__int64 v13; // x0
GameManager *ActiveSmartTemplate; // [xsp+38h] [xbp+38h]
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(this);
v4 = v3;
v5 = *((cocos2d::CCObject **)this + 86);
if ( v5 )
{
cocos2d::CCArray::addObject(v3, v5);
}
else
{
v11 = *((cocos2d::CCArray **)this + 87);
if ( v11 )
{
cocos2d::CCArray::addObjectsFromArray(v3, v11);
v6 = (GameLevelManager *)*((unsigned int *)this + 170);
if ( ((unsigned int)v6 & 0x80000000) == 0 )
goto LABEL_4;
LABEL_10:
v12 = (GameLevelManager *)GameLevelManager::sharedState(v6);
ActiveSmartTemplate = (GameManager *)GameLevelManager::getActiveSmartTemplate(v12);
v13 = GameManager::sharedState(ActiveSmartTemplate);
EditorUI::createSmartObjectsFromTemplate(
*(EditorUI **)(*(_QWORD *)(v13 + 552) + 14248LL),
ActiveSmartTemplate,
v4,
*((_BYTE *)this + 676),
*((_BYTE *)this + 677),
0,
0);
return SetupSmartBlockLayer::onClose((cocos2d::CCArray **)this, nullptr);
}
}
v6 = (GameLevelManager *)*((unsigned int *)this + 170);
if ( ((unsigned int)v6 & 0x80000000) != 0 )
goto LABEL_10;
LABEL_4:
v7 = (_DWORD)v6 == 9;
if ( (_DWORD)v6 == 9 )
{
v6 = (GameLevelManager *)byte_8;
*((_DWORD *)this + 170) = (unsigned int)byte_8;
}
v8 = *(EditorUI **)(*(_QWORD *)(GameManager::sharedState(v6) + 552) + 14248LL);
RandomStartKey = (EditorUI *)EditorUI::getRandomStartKey(*((unsigned int *)this + 170));
v10 = EditorUI::smartTypeForKey(RandomStartKey);
EditorUI::createSmartObjectsFromType(v8, v10, v4, v7, *((_BYTE *)this + 677));
return SetupSmartBlockLayer::onClose((cocos2d::CCArray **)this, nullptr);
}