//
// SetupSmartBlockLayer::onCreate from 0x10006fd40 to 0x10006fe1c (220 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::init @ 0x10006f32c
//
// 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 SetupSmartBlockLayer::onCreate(SetupSmartBlockLayer *a1, cocos2d::CCObject *a2)
{
__int64 v3; // x0
cocos2d::CCArray *v4; // x20
SmartGameObject *m_gameObject; // x1
cocos2d::CCArray *m_gameObjects; // x1
int m_specialTemplate; // w8
bool v8; // w21
EditorUI *m_editorUI; // x22
int RandomStartKey; // w0
int v11; // w0
cocos2d::CCObject *v12; // x1
GameLevelManager *v13; // x0
GJSmartTemplate *ActiveSmartTemplate; // x21
GameManager *v15; // x0
v3 = sub_10024A15C(a1);
v4 = (cocos2d::CCArray *)v3;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
sub_10024A2D0(v3, m_gameObject);
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
sub_10024A360(v3, m_gameObjects);
}
m_specialTemplate = a1->m_specialTemplate;
if ( m_specialTemplate < 0 )
{
v13 = GameLevelManager::sharedState();
ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v13);
v15 = GameManager::sharedState();
EditorUI::createSmartObjectsFromTemplate(
v15->m_levelEditorLayer->m_editorUI,
ActiveSmartTemplate,
v4,
a1->m_useNearby,
a1->m_dontDelete,
0,
0);
}
else
{
if ( m_specialTemplate == 9 )
a1->m_specialTemplate = 8;
v8 = m_specialTemplate == 9;
m_editorUI = GameManager::sharedState()->m_levelEditorLayer->m_editorUI;
RandomStartKey = EditorUI::getRandomStartKey(a1->m_specialTemplate);
v11 = EditorUI::smartTypeForKey(RandomStartKey);
EditorUI::createSmartObjectsFromType(m_editorUI, v11, v4, v8, a1->m_dontDelete);
}
SetupSmartBlockLayer::onClose(a1, v12);
}