//
// SetupSmartTemplateLayer::onClick from 0x1405eef90 to 0x1405ef151 (449 bytes)
//
// 3 xrefs:
// > SetupSmartTemplateLayer::init @ 0x1405eed75
// > SetupSmartTemplateLayer::init @ 0x1405eee68
// > ??> @ 0x14092f138
//
// 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 11:35:05 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall SetupSmartTemplateLayer::onClick(__int64 a1, __int64 a2)
{
__int64 result; // rax
int v4; // ebx
__int64 v5; // rax
cocos2d::CCObject *v6; // rbx
__int64 v7; // rbx
__int64 v8; // rax
cocos2d::CCObject *v9; // rdi
__int128 v10; // [rsp+50h] [rbp-48h] BYREF
__int64 v11; // [rsp+60h] [rbp-38h]
__int64 v12; // [rsp+68h] [rbp-30h]
_BYTE v13[32]; // [rsp+70h] [rbp-28h] BYREF
void *v14; // [rsp+A8h] [rbp+10h]
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
if ( (_DWORD)result )
{
if ( (_DWORD)result == 5 )
{
v4 = a1 + 664;
if ( !a1 )
v4 = 0;
v10 = 0;
*(_QWORD *)&v10 = sub_14003D460(0x40u);
v11 = 54;
v12 = 63;
strcpy((char *)v10, "Are you sure you want to delete this template?");
v5 = sub_14003F4F0((__int64)v13, (__int64)&v10);
v6 = FLAlertLayer::create(
v4,
(int)"Delete Template",
v5,
(__int64)&unk_14073A058,
(__int64)"YES",
1133903872,
0,
0,
1065353216);
sub_14003D310((__int64)&v10);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v6 + 64LL))(v6, 5);
return (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v6 + 1064LL))(v6);
}
}
else
{
v7 = *(_QWORD *)(a1 + 672);
v14 = operator new(0x2C8u);
v8 = BrowseSmartTemplateLayer::BrowseSmartTemplateLayer((__int64)v14);
v9 = (cocos2d::CCObject *)v8;
if ( v8 )
{
if ( (unsigned __int8)BrowseSmartTemplateLayer::init(v8, v7) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 8LL))(v9, 1);
v9 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v9 + 1064LL))(v9);
return SetupSmartTemplateLayer::onClose(a1);
}
return result;
}