//
// SetupObjectOptions2Popup::init from 0x97c23c to 0x97c964 (1832 bytes)
//
// 2 xrefs:
// > SetupObjectOptions2Popup::create @ 0x97cb10
// > ??> @ 0x609a8
//
// 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 SetupObjectOptions2Popup::init(SetupObjectOptions2Popup *a1, GameObject *a2, cocos2d::CCArray *a3)
{
bool v4; // w25
void *v6; // x0
void *v7; // x0
void *v8; // x0
void *v9; // x0
cocos2d::CCDirector *v10; // x0
float v11; // s3
float v12; // s4
void *v13; // x0
void *v14; // x0
float v15; // s3
float v16; // s4
void *v17; // x0
float v18; // s3
float v19; // s4
void *v20; // x19
unsigned int *v21; // x23
int v22; // w0
unsigned int *v23; // x1
int v24; // w2
unsigned int *v25; // x1
int v26; // w2
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x1
int v30; // w2
unsigned int *v31; // x1
int v32; // w2
unsigned int *v33; // x1
int v34; // w2
unsigned int *v35; // x1
int v36; // w2
int v37; // [xsp+18h] [xbp-18h]
__int64 v38; // [xsp+18h] [xbp-18h]
__int64 v39; // [xsp+18h] [xbp-18h]
char v40; // [xsp+20h] [xbp-10h]
__int64 v41; // [xsp+20h] [xbp-10h]
__int64 v42; // [xsp+20h] [xbp-10h]
_QWORD v43[2]; // [xsp+30h] [xbp+0h] BYREF
float v44; // [xsp+B0h] [xbp+80h]
float v45; // [xsp+B4h] [xbp+84h]
cocos2d::CCPoint v46; // [xsp+B8h] [xbp+88h] BYREF
cocos2d::CCPoint v47; // [xsp+C0h] [xbp+90h] BYREF
__int64 v48; // [xsp+C8h] [xbp+98h] BYREF
__int64 v49; // [xsp+D0h] [xbp+A0h] BYREF
cocos2d::CCPoint v50; // 0:s0.4,4:s1.4
cocos2d::CCPoint v51; // 0:s0.4,4:s1.4
cocos2d::CCPoint v52; // 0:s0.4,4:s1.4
v4 = SetupTriggerPopup::init(a1, (EffectGameObject *)a2, a3, 320.0, 200.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
a1->m_disableTextDelegate = 1;
sub_D153B8((unsigned int)v43 + 160, "Config 2");
SetupTriggerPopup::addTitle(a1, (std::string)&v49);
v6 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v49 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v6);
}
sub_D153B8((unsigned int)v43 + 160, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)&v49);
v7 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(v49 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v48, "Help");
sub_D153B8(
(int)&v49,
"Enter Channel is used to set a specific enter effect.\n"
"Material is used to link with specific events.\n"
"ControlID allows you to reference specific objects when using remapping.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v48, (std::string)&v49, 1.0);
v8 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = (unsigned int *)(v49 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v8);
}
v9 = (void *)(v48 - 24);
if ( (__int64 *)(v48 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v48 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(v48 - 8);
*(_DWORD *)(v48 - 8) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v9);
}
v10 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v10);
cocos2d::CCPoint::CCPoint(&v46, v44 * 0.5, (float)(v45 * 0.5) + 30.0);
sub_D153B8((int)&v49, "Enter Channel:");
cocos2d::CCPoint::CCPoint(&v47, -80.0, 0.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
v50.y = 0.0;
v37 = 2;
v50.x = 0.7;
v40 = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
343,
(std::string)&v49,
v50,
0.0,
(bool)&v48,
Float,
3,
6,
v11,
v12,
1,
0,
GoldLabel,
0,
v37,
v40);
v13 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v49 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v13);
}
cocos2d::CCPoint::CCPoint(&v47, -5.0, 0.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
sub_D153B8((int)&v49, &byte_F288A0);
SetupTriggerPopup::createPlusButton((int)a1, 343, (int)&v48, (int)&v49, 0);
v14 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)(v49 - 8);
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v14);
}
sub_D153B8((int)&v49, "Material:");
cocos2d::CCPoint::CCPoint(&v47, 80.0, 0.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
v51.y = 0.0;
v51.x = 0.7;
LODWORD(v38) = 2;
LOBYTE(v41) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
446,
(std::string)&v49,
v51,
0.0,
(bool)&v48,
Float,
3,
6,
v15,
v16,
1,
0,
GoldLabel,
0,
v38,
v41);
v17 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v49 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v17);
}
if ( a1->m_effectObjects )
{
sub_D153B8((int)&v49, "ControlID:");
cocos2d::CCPoint::CCPoint(&v47, 80.0, -55.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
v52.y = 0.0;
v52.x = 0.7;
LODWORD(v39) = 2;
LOBYTE(v42) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
534,
(std::string)&v49,
v52,
0.0,
(bool)&v48,
Float,
3,
6,
v18,
v19,
1,
0,
GoldLabel,
0,
v39,
v42);
v20 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v49 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v20);
}
}
SetupTriggerPopup::postSetup(a1);
}
return v4;
}