//
// SetTargetIDLayer::init from 0x94c668 to 0x94cbac (1348 bytes)
//
// 2 xrefs:
// > SetTargetIDLayer::create @ 0x94cdb0
// > ??> @ 0x64c68
//
// 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 __fastcall SetTargetIDLayer::init(
SetupTriggerPopup *a1,
EffectGameObject *a2,
cocos2d::CCArray *a3,
__int64 a4,
char **a5,
int a6,
int a7,
int a8)
{
bool v11; // w0
_BOOL4 v12; // w22
SetupTriggerPopup_vtbl *v14; // x1
void (__fastcall *determineStartValues)(SetupTriggerPopup *__hidden); // x1
cocos2d::CCDirector *v16; // x0
void *v17; // x0
void *v18; // x0
void *v19; // x0
void *v20; // x0
float v21; // s3
float v22; // s4
void *v23; // x0
char *v24; // x0
unsigned int *v25; // x19
int v26; // w1
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
float v39; // [xsp+A8h] [xbp+78h]
float v40; // [xsp+ACh] [xbp+7Ch]
char *v41; // [xsp+B0h] [xbp+80h] BYREF
cocos2d::CCPoint v42; // [xsp+B8h] [xbp+88h] BYREF
cocos2d::CCPoint v43; // [xsp+C0h] [xbp+90h] BYREF
__int64 v44; // [xsp+C8h] [xbp+98h] BYREF
__int64 v45; // [xsp+D0h] [xbp+A0h] BYREF
cocos2d::CCPoint v46; // 0:s0.4,4:s1.4
v11 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 240.0, 1);
v12 = v11;
if ( v11 )
{
v14 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
LODWORD(a1[1].FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable) = a6;
*((_DWORD *)&a1->m_hideAll + 1) = a8;
determineStartValues = v14->determineStartValues;
HIDWORD(a1[1].FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable) = a7;
determineStartValues(a1);
v16 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v16);
sub_D18D28(&v45);
SetupTriggerPopup::addTitle(a1, (std::string)&v45);
v17 = (void *)(v45 - 24);
if ( (__int64 *)(v45 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(v45 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(v45 - 8);
*(_DWORD *)(v45 - 8) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v17);
}
sub_D153B8((int)&v45, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)&v45);
v18 = (void *)(v45 - 24);
if ( (__int64 *)(v45 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)(v45 - 8);
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(_DWORD *)(v45 - 8);
*(_DWORD *)(v45 - 8) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v18);
}
v41 = &byte_124B6C8;
if ( a8 == 3662 )
sub_D1798C(
&v41,
"Ensures visibility of every object in Group ID. If one object in the group is visible, all objec"
"t will be visible even if offscreen.\n"
"Processed at level load and cannot be disabled after.",
202);
else
sub_D1798C(&v41, "Stops an Area trigger using Effect ID.", 54);
sub_D153B8((int)&v43, "Help");
sub_D18D28(&v44);
SetupTriggerPopup::addHelpButton(a1, (std::string)&v43, (std::string)&v44, 1.0);
v19 = (void *)(v44 - 24);
if ( (__int64 *)(v44 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = (unsigned int *)(v44 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(_DWORD *)(v44 - 8);
*(_DWORD *)(v44 - 8) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v19);
}
v20 = (void *)(*(_QWORD *)&v43 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v43 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(*(_QWORD *)&v43 - 8LL);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *(_DWORD *)(*(_QWORD *)&v43 - 8LL);
*(_DWORD *)(*(_QWORD *)&v43 - 8LL) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v20);
}
cocos2d::CCPoint::CCPoint(&v42, v39 * 0.5, v40 * 0.5);
sub_D153B8((int)&v45, *a5);
cocos2d::CCPoint::CCPoint(&v43, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v44, &v42, &v43);
v46.x = 1.0;
v46.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
51,
(std::string)&v45,
v46,
1.0,
(bool)&v44,
Float,
2,
6,
v21,
v22,
1,
0,
GoldLabel,
0,
2,
0);
v23 = (void *)(v45 - 24);
if ( (__int64 *)(v45 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v45 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(v45 - 8);
*(_DWORD *)(v45 - 8) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v23);
}
if ( a8 != 3662 )
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
v24 = v41 - 24;
if ( v41 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v41 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *((_DWORD *)v41 - 2);
*((_DWORD *)v41 - 2) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v24);
}
}
return v12;
}