//
// GameSettingsLayer::onCustomButton from 0x10016700c to 0x100167164 (344 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008e3430
//
// This function is hookable on this platform (idp: arm, 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 10:59:48 +0000
//
void __fastcall GameSettingsLayer::onCustomButton(__int64 a1, __int64 a2)
{
__int64 v3; // x0
_QWORD *v4; // x20
__int64 v5; // x0
__int64 v6; // x0
void *v7; // x0
void *__p[2]; // [xsp+8h] [xbp-28h] BYREF
char v9; // [xsp+1Fh] [xbp-11h]
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)v3 == -1004 )
{
v7 = (void *)sub_1004A9BA8();
LABEL_11:
(*(void (__fastcall **)(void *))(*(_QWORD *)v7 + 1312LL))(v7);
return;
}
if ( (_DWORD)v3 != -1003 )
{
if ( (_DWORD)v3 == -1001 )
{
v4 = (_QWORD *)sub_100302C44();
v4[74] = a1 + 1088;
v5 = cocos2d::CCDirector::sharedDirector(v4);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(v5 + 272) + 464LL))(
*(_QWORD *)(v5 + 272),
v4,
106);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v4 + 1328LL))(v4, 0);
}
return;
}
if ( *(_BYTE *)(GJKeybindManager::sharedState(v3) + 184) != 1 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 344LL))(a1, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1000LL))(a1, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);
v7 = KeybindingsLayer::create(a1);
goto LABEL_11;
}
sub_100009900(__p, "You cannot edit Global Controls while Custom Level Controls are active.");
v6 = sub_10034A8F8(0, "Keybinds", __p, "OK", 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);
if ( v9 < 0 )
operator delete(__p[0]);
}