//
// SetupSmartTemplateLayer::onClick from 0x1004e2e30 to 0x1004e2f2d (253 bytes)
//
// 2 xrefs:
// > SetupSmartTemplateLayer::init @ 0x1004e2bfc
// > SetupSmartTemplateLayer::init @ 0x1004e2cb4
//
// 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 SetupSmartTemplateLayer::onClick(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rax
char *v4; // rbx
_QWORD v5[2]; // [rsp+0h] [rbp-20h] BYREF
void *__p; // [rsp+10h] [rbp-10h]
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)result == 5 )
{
__p = operator new(0x38u);
v5[0] = 57;
v5[1] = 54;
strcpy((char *)__p, "Are you sure you want to delete this template?");
v4 = FLAlertLayer::create_1((int)a1 + 664, (int)"Delete Template", (__int64)v5, (int)"NO", (int)"YES", 300.0);
if ( (v5[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v4 + 72LL))(v4, 5);
return (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v4 + 1312LL))(v4);
}
else if ( !(_DWORD)result )
{
v3 = sub_1004E2F50(*(_QWORD *)(a1 + 672), 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 1312LL))(v3);
return SetupSmartTemplateLayer::onClose(a1);
}
return result;
}