//
// SetupGravityTriggerPopup::init from 0x1405be8d0 to 0x1405bed59 (1161 bytes)
//
// 3 xrefs:
// > SetupGravityTriggerPopup::create @ 0x1405be88e
// > ??> @ 0x14092e034
// > ??> @ 0x14092e040
//
// 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:34:46 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupGravityTriggerPopup::init(_BYTE *a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
float v12[2]; // [rsp+88h] [rbp-29h] BYREF
__int128 *v13; // [rsp+90h] [rbp-21h] BYREF
__int128 *v14; // [rsp+98h] [rbp-19h] BYREF
__int128 *v15; // [rsp+A0h] [rbp-11h] BYREF
__int128 v16; // [rsp+A8h] [rbp-9h] BYREF
__int64 v17; // [rsp+B8h] [rbp+7h]
__int64 v18; // [rsp+C0h] [rbp+Fh]
__int128 v19; // [rsp+C8h] [rbp+17h] BYREF
__int64 v20; // [rsp+D8h] [rbp+27h]
__int64 v21; // [rsp+E0h] [rbp+2Fh]
char v22; // [rsp+130h] [rbp+7Fh] BYREF
result = SetupTriggerPopup::init((_DWORD)a1, a2, a3, a4, 1131413504, 1, 0);
if ( result )
{
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1096LL))(a1);
v17 = 15;
v18 = 15;
strcpy((char *)&v16, "Gravity Trigger");
SetupTriggerPopup::addTitle(a1, &v16);
v16 = 0;
v17 = 2;
v18 = 15;
strcpy((char *)&v16, "OK");
SetupTriggerPopup::addCloseButton(a1, &v16);
v13 = &v16;
v16 = 0;
v17 = 0;
v18 = 0;
*(_QWORD *)&v16 = sub_14003D460(0xA0u);
v17 = 144;
v18 = 159;
strcpy(
(char *)v16,
"Changes the gameplay gravity.\n"
"P1 is player 1 and P2 is player 2.\n"
"PT targets the player that touches the trigger.");
v19 = 0;
v20 = 4;
v21 = 15;
strcpy((char *)&v19, "Help");
SetupTriggerPopup::addHelpButton(a1, &v19, &v16);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v22, v12[0] * 0.5, (float)(v12[1] * 0.5) + 50.0);
v14 = &v16;
v17 = 7;
v18 = 15;
v16 = 0x79746976617247uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v15, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v22, &v13, v8);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
148,
(unsigned int)&v16,
(unsigned int)&v13,
1059481190,
0,
1,
6,
0,
1036831949,
0x40000000,
0,
0,
0,
2,
0);
v15 = &v19;
v19 = 0;
v20 = 2;
v21 = 15;
strcpy((char *)&v19, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v14, -75.0, -60.0);
cocos2d::CCPoint::operator+(&v22, &v13, v9);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
138,
(unsigned int)&v19,
(unsigned int)&v13,
0,
0,
0,
1065353216);
v15 = &v19;
v19 = 0;
v20 = 2;
v21 = 15;
strcpy((char *)&v19, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v14, 0.0, -60.0);
cocos2d::CCPoint::operator+(&v22, &v13, v10);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
200,
(unsigned int)&v19,
(unsigned int)&v13,
0,
0,
0,
1065353216);
v15 = &v19;
v19 = 0;
v20 = 2;
v21 = 15;
strcpy((char *)&v19, "PT");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v14, 75.0, -60.0);
cocos2d::CCPoint::operator+(&v22, &v13, v11);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
201,
(unsigned int)&v19,
(unsigned int)&v13,
0,
0,
0,
1065353216);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1136LL))(a1);
a1[744] = 0;
return 1;
}
return result;
}