//
// GameSettingsLayer::onCustomButton from 0x1402c7ad0 to 0x1402c7e0d (829 bytes)
//
// 2 xrefs:
// > ??> @ 0x140766250
// > ??> @ 0x14091dc00
//
// 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:29:22 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GameSettingsLayer::onCustomButton(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rax
__int64 v5; // rbx
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
cocos2d::CCObject *v9; // rbx
__int64 (__fastcall *v10)(__int64); // rdx
__int64 v11; // rax
__int128 v12; // [rsp+50h] [rbp-48h] BYREF
__int64 v13; // [rsp+60h] [rbp-38h]
__int64 v14; // [rsp+68h] [rbp-30h]
_BYTE v15[32]; // [rsp+70h] [rbp-28h] BYREF
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
switch ( (_DWORD)result )
{
case 0xFFFFFC14:
v9 = (cocos2d::CCObject *)operator new(0x2C0u);
memset(v9, 0, 0x2C0u);
FLAlertLayer::FLAlertLayer((__int64)v9);
*(_QWORD *)v9 = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 40) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 41) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 42) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 43) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 44) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 51) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 54) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 68) = &ClearPlatformerSavesPopup::`vftable';
*((_QWORD *)v9 + 83) = &ClearPlatformerSavesPopup::`vftable';
*((_BYTE *)v9 + 672) = 0;
*((_QWORD *)v9 + 85) = 0;
*((_QWORD *)v9 + 86) = 0;
*((_QWORD *)v9 + 87) = 0;
if ( ClearPlatformerSavesPopup::init((__int64)v9) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 8LL))(v9, 1);
v9 = nullptr;
}
v10 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1064LL);
if ( v10 == FLAlertLayer::show )
return FLAlertLayer::show((__int64)v9);
return v10((__int64)v9);
case 0xFFFFFC15:
if ( !*(_BYTE *)(GJKeybindManager::sharedState() + 216) )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 336LL))(a1, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 920LL))(a1, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 992LL))(a1, 0);
v11 = KeybindingsLayer::create(a1);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 1064LL))(v11);
}
v12 = 0;
*(_QWORD *)&v12 = sub_14003D460(0x60u);
v13 = 87;
v14 = 95;
strcpy((char *)v12, "You cannot edit Global Controls while Custom Level Controls are active.");
v8 = sub_14003F4F0((__int64)v15, (__int64)&v12);
v9 = FLAlertLayer::create(0, (int)"Keybinds", v8, (__int64)"OK", 0, 1132068864, 0, 0, 1065353216);
sub_14003D310((__int64)&v12);
v10 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1064LL);
return v10((__int64)v9);
case 0xFFFFFC17:
v4 = GJSongBrowser::create();
v5 = v4;
v6 = a1 + 1072;
if ( !a1 )
v6 = 0;
*(_QWORD *)(v4 + 592) = v6;
v7 = cocos2d::CCDirector::sharedDirector(v6);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(v7 + 272) + 456LL))(
*(_QWORD *)(v7 + 272),
v5,
106);
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 1080LL))(v5, 0);
}
return result;
}