//
// SetupOptionsTriggerPopup::init from 0x9e267c to 0x9e31f8 (2940 bytes)
//
// 2 xrefs:
// > SetupOptionsTriggerPopup::create @ 0x9e33a4
// > ??> @ 0xc7c20
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool SetupOptionsTriggerPopup::init(SetupOptionsTriggerPopup *a1, GameOptionsTrigger *a2, cocos2d::CCArray *a3)
{
bool v4; // w24
void *v6; // x0
void *v7; // x0
void *v8; // x0
void *v9; // x0
cocos2d::CCDirector *v10; // x0
float v11; // s0
float v12; // s1
void *v13; // x0
void *v14; // x0
void *v15; // x0
void *v16; // x0
void *v17; // x0
void *v18; // x0
float v19; // s0
float v20; // s1
void *v21; // x0
void *v22; // x0
void *v23; // x0
void *v24; // x0
void *v25; // x0
void *v26; // x0
void *v27; // x0
float v28; // s3
float v29; // s4
void *v30; // x0
float v31; // s0
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x1
int v37; // w2
unsigned int *v38; // x1
int v39; // w2
unsigned int *v40; // x1
int v41; // w2
unsigned int *v42; // x1
int v43; // w2
unsigned int *v44; // x1
int v45; // w2
unsigned int *v46; // x1
int v47; // w2
unsigned int *v48; // x1
int v49; // w2
unsigned int *v50; // x1
int v51; // w2
unsigned int *v52; // x1
int v53; // w2
unsigned int *v54; // x1
int v55; // w2
unsigned int *v56; // x1
int v57; // w2
unsigned int *v58; // x1
int v59; // w2
unsigned int *v60; // x1
int v61; // w2
unsigned int *v62; // x1
int v63; // w2
unsigned int *v64; // x1
int v65; // w2
unsigned int *v66; // x19
int v67; // w1
int v68; // [xsp+18h] [xbp-18h]
char v69; // [xsp+20h] [xbp-10h]
_QWORD v70[2]; // [xsp+30h] [xbp+0h] BYREF
float v71; // [xsp+98h] [xbp+68h]
float v72; // [xsp+9Ch] [xbp+6Ch]
cocos2d::CCPoint v73; // [xsp+A0h] [xbp+70h] BYREF
cocos2d::CCPoint v74; // [xsp+A8h] [xbp+78h] BYREF
__int64 v75; // [xsp+B0h] [xbp+80h] BYREF
cocos2d::CCPoint v76; // 0:s0.4,4:s1.4
v4 = SetupTriggerPopup::init(a1, a2, a3, 420.0, 300.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v70 + 128, "Setup Options Trigger");
SetupTriggerPopup::addTitle(a1, (std::string)&v75);
v6 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v75 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v6);
}
sub_D153B8((unsigned int)v70 + 128, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)&v75);
v7 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v75 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v74, "Help");
sub_D153B8(
(unsigned int)v70 + 128,
"Lets you change various options.\n"
"Streak Additive toggles blending of player trail and particles.\n"
"Unlink Dual Gravity allows dual players to switch gravity independently. By default they switch together.\n"
"Disable P1 and P2 Controls allows you to toggle controls for a specific player.\n"
"Audio on Death continues to play music and SFX after the player dies.\n"
"Boost Slide increases sliding after a force is applied.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v74, (std::string)&v75, 1.0);
v8 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v75 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v8);
}
v9 = (void *)(*(_QWORD *)&v74 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v74 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v52 = (unsigned int *)(*(_QWORD *)&v74 - 8LL);
do
v53 = __ldaxr(v52);
while ( __stlxr(v53 - 1, v52) );
}
else
{
v53 = *(_DWORD *)(*(_QWORD *)&v74 - 8LL);
*(_DWORD *)(*(_QWORD *)&v74 - 8LL) = v53 - 1;
}
if ( v53 <= 0 )
operator delete(v9);
}
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
v10 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v10);
cocos2d::CCPoint::CCPoint(&v73, (float)(v71 * 0.5) + -30.0, (float)(v72 * 0.5) + 100.0);
cocos2d::CCPoint::operator=(&a1->m_togglePosition, v11, v12);
a1->m_togglePage = 0;
sub_D153B8((unsigned int)v70 + 128, "Streak\nAdditive");
SetupOptionsTriggerPopup::addOption(a1, 159);
v13 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v44 = (unsigned int *)(v75 - 8);
do
v45 = __ldaxr(v44);
while ( __stlxr(v45 - 1, v44) );
}
else
{
v45 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v45 - 1;
}
if ( v45 <= 0 )
operator delete(v13);
}
sub_D153B8((unsigned int)v70 + 128, "Hide Ground");
SetupOptionsTriggerPopup::addOption(a1, 161);
v14 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v60 = (unsigned int *)(v75 - 8);
do
v61 = __ldaxr(v60);
while ( __stlxr(v61 - 1, v60) );
}
else
{
v61 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v61 - 1;
}
if ( v61 <= 0 )
operator delete(v14);
}
sub_D153B8((unsigned int)v70 + 128, "Hide MG");
SetupOptionsTriggerPopup::addOption(a1, 195);
v15 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v40 = (unsigned int *)(v75 - 8);
do
v41 = __ldaxr(v40);
while ( __stlxr(v41 - 1, v40) );
}
else
{
v41 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v41 - 1;
}
if ( v41 <= 0 )
operator delete(v15);
}
sub_D153B8((unsigned int)v70 + 128, "Hide P1");
SetupOptionsTriggerPopup::addOption(a1, 162);
v16 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v56 = (unsigned int *)(v75 - 8);
do
v57 = __ldaxr(v56);
while ( __stlxr(v57 - 1, v56) );
}
else
{
v57 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v57 - 1;
}
if ( v57 <= 0 )
operator delete(v16);
}
sub_D153B8((unsigned int)v70 + 128, "Hide P2");
SetupOptionsTriggerPopup::addOption(a1, 163);
v17 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v48 = (unsigned int *)(v75 - 8);
do
v49 = __ldaxr(v48);
while ( __stlxr(v49 - 1, v48) );
}
else
{
v49 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v49 - 1;
}
if ( v49 <= 0 )
operator delete(v17);
}
sub_D153B8((unsigned int)v70 + 128, "Disable P1\nControls");
SetupOptionsTriggerPopup::addOption(a1, 165);
v18 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v64 = (unsigned int *)(v75 - 8);
do
v65 = __ldaxr(v64);
while ( __stlxr(v65 - 1, v64) );
}
else
{
v65 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v65 - 1;
}
if ( v65 <= 0 )
operator delete(v18);
}
sub_D153B8((unsigned int)v70 + 128, "Disable P2\nControls");
SetupOptionsTriggerPopup::addOption(a1, 199);
v21 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(v75 - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v21);
}
cocos2d::CCPoint::operator=(&a1->m_togglePosition, v19, v20);
++a1->m_togglePage;
sub_D153B8((unsigned int)v70 + 128, "Unlink Dual\nGravity");
SetupOptionsTriggerPopup::addOption(a1, 160);
v22 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v54 = (unsigned int *)(v75 - 8);
do
v55 = __ldaxr(v54);
while ( __stlxr(v55 - 1, v54) );
}
else
{
v55 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v55 - 1;
}
if ( v55 <= 0 )
operator delete(v22);
}
sub_D153B8((unsigned int)v70 + 128, "Hide\nAttempts");
SetupOptionsTriggerPopup::addOption(a1, 532);
v23 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v46 = (unsigned int *)(v75 - 8);
do
v47 = __ldaxr(v46);
while ( __stlxr(v47 - 1, v46) );
}
else
{
v47 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v47 - 1;
}
if ( v47 <= 0 )
operator delete(v23);
}
sub_D153B8((unsigned int)v70 + 128, "Audio on\nDeath");
SetupOptionsTriggerPopup::addOption(a1, 575);
v24 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v62 = (unsigned int *)(v75 - 8);
do
v63 = __ldaxr(v62);
while ( __stlxr(v63 - 1, v62) );
}
else
{
v63 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v63 - 1;
}
if ( v63 <= 0 )
operator delete(v24);
}
sub_D153B8((unsigned int)v70 + 128, "No Death\nSFX");
SetupOptionsTriggerPopup::addOption(a1, 576);
v25 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v42 = (unsigned int *)(v75 - 8);
do
v43 = __ldaxr(v42);
while ( __stlxr(v43 - 1, v42) );
}
else
{
v43 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v43 - 1;
}
if ( v43 <= 0 )
operator delete(v25);
}
sub_D153B8((unsigned int)v70 + 128, "Edit Respawn\nTime");
SetupOptionsTriggerPopup::addOption(a1, 573);
v26 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v58 = (unsigned int *)(v75 - 8);
do
v59 = __ldaxr(v58);
while ( __stlxr(v59 - 1, v58) );
}
else
{
v59 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v59 - 1;
}
if ( v59 <= 0 )
operator delete(v26);
}
sub_D153B8((unsigned int)v70 + 128, "Boost Slide");
SetupOptionsTriggerPopup::addOption(a1, 593);
v27 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v50 = (unsigned int *)(v75 - 8);
do
v51 = __ldaxr(v50);
while ( __stlxr(v51 - 1, v50) );
}
else
{
v51 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v51 - 1;
}
if ( v51 <= 0 )
operator delete(v27);
}
sub_D153B8((unsigned int)v70 + 128, "Respawn Time");
cocos2d::CCPoint::CCPoint(&v74, v71 * 0.5, a1->m_togglePosition.y - 5.0);
v76.x = 0.8;
v68 = 1;
v69 = 0;
v76.y = 1.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
574,
(std::string)&v75,
v76,
10.0,
(bool)&v74,
(InputValueType)0,
1,
10,
v28,
v29,
0,
1,
GoldLabel,
1,
v68,
v69);
v30 = (void *)(v75 - 24);
if ( (__int64 *)(v75 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v66 = (unsigned int *)(v75 - 8);
do
v67 = __ldaxr(v66);
while ( __stlxr(v67 - 1, v66) );
}
else
{
v67 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v67 - 1;
}
if ( v67 <= 0 )
operator delete(v30);
}
SetupTriggerPopup::toggleLimitValue(a1, 574, 1);
v31 = (float)(a1->m_width * 0.5) + 15.0;
a1->m_togglePosition.y = a1->m_togglePosition.y - 30.0;
SetupTriggerPopup::createPageButtons(a1, v31, 1);
SetupTriggerPopup::goToPage(a1, 0, 0);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}