//
// BrowseSmartTemplateLayer::onTemplateObject from 0x6752a8 to 0x6753ca (290 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:55 +0000
//
int __fastcall BrowseSmartTemplateLayer::onTemplateObject(BrowseSmartTemplateLayer *this, cocos2d::CCObject *a2)
{
int v3; // r0
int v4; // r7
int v5; // r6
cocos2d::CCArray *Prefabs; // r7
cocos2d::CCObject *v7; // r7
int v8; // r2
int v9; // r3
FLAlertLayer *v10; // r6
void (__fastcall *v12)(BrowseSmartTemplateLayer *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v13; // r0
int v14[3]; // [sp+Ch] [bp-20h] BYREF
int v15[3]; // [sp+18h] [bp-14h] BYREF
v3 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 536))(a2);
v4 = *((_DWORD *)this + 130);
v5 = v3 + 264;
std::string::basic_string(v15, v3 + 264);
Prefabs = (cocos2d::CCArray *)GJSmartTemplate::getPrefabs(v4, (int)v15);
std::string::~string((int)v15);
if ( Prefabs && cocos2d::CCArray::count(Prefabs) )
{
BrowseSmartTemplateLayer::onClose(this, nullptr);
v7 = *((cocos2d::CCObject **)this + 130);
std::string::basic_string(v15, v5);
v10 = BrowseSmartKeyLayer::create(v7, (int)v15, v8, v9);
std::string::~string((int)v15);
*((_DWORD *)v10 + 139) = *((_DWORD *)this + 132);
return (*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)v10 + 656))(v10);
}
else
{
std::string::basic_string(v15, v5);
BrowseSmartTemplateLayer::createPrefab(this, (int)v15, 0);
std::string::~string((int)v15);
v12 = *(void (__fastcall **)(BrowseSmartTemplateLayer *, cocos2d::CCNode *, int))(*(_DWORD *)this + 232);
memset(v14, 0, sizeof(v14));
std::string::__init(v14, "Added to editor", 0xFu);
memset(v15, 0, sizeof(v15));
std::string::__init(v15, &unk_B6B226, 0);
v13 = TextAlertPopup::create((int)v14, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)v15);
v12(this, v13, 100);
std::string::~string((int)v15);
return std::string::~string((int)v14);
}
}