//
// SetupSmartBlockLayer::onCreateTemplate from 0x1004e16f0 to 0x1004e176f (127 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::init @ 0x1004e090e
//
// This function is hookable on this platform (idp: pc, 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 12:31:18 +0000
//
__int64 __fastcall SetupSmartBlockLayer::onCreateTemplate(_QWORD *a1, double a2)
{
__int64 v2; // rax
__int64 v3; // r14
__int64 v4; // rsi
__int64 v5; // rsi
__int64 v6; // rax
__int64 ActiveSmartTemplate; // r15
__int64 v8; // rax
v2 = sub_1007FE900(a1);
v3 = v2;
v4 = a1[86];
if ( v4 )
{
sub_1007FEBF0(v2, v4);
}
else
{
v5 = a1[87];
if ( v5 )
sub_1007FEF70(v2, v5);
}
v6 = GameLevelManager::sharedState(a2);
ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v6);
v8 = GameManager::sharedState();
EditorUI::addObjectsToSmartTemplate(*(_QWORD *)(*(_QWORD *)(v8 + 552) + 14248LL), ActiveSmartTemplate, v3);
return SetupSmartBlockLayer::onClose(a1);
}