//
// SetupSmartBlockLayer::onCreate from 0x1004e6ce0 to 0x1004e6de1 (257 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::init @ 0x1004e5fbb
//
// 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 v2; // rax
cocos2d::CCArray *v3; // r14
SmartGameObject *m_gameObject; // rsi
cocos2d::CCArray *m_gameObjects; // rsi
int m_specialTemplate; // eax
bool v7; // r15
EditorUI *m_editorUI; // r12
int RandomStartKey; // eax
unsigned int v10; // eax
GJSmartTemplate *v11; // rsi
GameLevelManager *v12; // rax
GJSmartTemplate *ActiveSmartTemplate; // r15
GameManager *v14; // rax
v2 = sub_10071F9E0(a1, a2);
v3 = (cocos2d::CCArray *)v2;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
sub_10071FCD0(v2, m_gameObject);
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
sub_100720050(v2, m_gameObjects);
}
m_specialTemplate = a1->m_specialTemplate;
if ( m_specialTemplate < 0 )
{
v12 = GameLevelManager::sharedState();
ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v12);
v14 = GameManager::sharedState();
v11 = ActiveSmartTemplate;
EditorUI::createSmartObjectsFromTemplate(
v14->m_levelEditorLayer->m_editorUI,
ActiveSmartTemplate,
v3,
a1->m_useNearby,
a1->m_dontDelete,
0,
0);
}
else
{
if ( m_specialTemplate == 9 )
a1->m_specialTemplate = 8;
v7 = m_specialTemplate == 9;
m_editorUI = GameManager::sharedState()->m_levelEditorLayer->m_editorUI;
RandomStartKey = EditorUI::getRandomStartKey(a1->m_specialTemplate);
v10 = EditorUI::smartTypeForKey(RandomStartKey);
v11 = (GJSmartTemplate *)v10;
EditorUI::createSmartObjectsFromType(m_editorUI, v10, v3, v7, a1->m_dontDelete);
}
SetupSmartBlockLayer::onClose(a1, v11);
}