//
// SetupCoinLayer::init from 0xa4e514 to 0xa4ea58 (1348 bytes)
//
// 2 xrefs:
// > SetupCoinLayer::create @ 0xa4ebf8
// > ??> @ 0x863a0
//
// 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 SetupCoinLayer::init(SetupCoinLayer *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
bool v5; // w22
cocos2d::CCPoint *p_m_textOffset; // x0
__int64 v8; // x2
__int64 v9; // x3
__int64 v10; // x4
__int64 v11; // x5
const char *v12; // x6
cocos2d::CCPoint *v13; // x0
cocos2d::CCPoint *v14; // x0
void *v15; // x0
cocos2d::CCDirector *v16; // x0
float v17; // s3
float v18; // s4
cocos2d::CCPoint *v19; // x0
float v20; // s3
float v21; // s4
cocos2d::CCPoint *v22; // x0
unsigned int *v23; // x20
int v24; // w1
unsigned int *v25; // x1
int v26; // w2
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x1
int v30; // w2
unsigned int *p_m_caption; // x1
int m_data; // w2
unsigned int *v33; // x1
int v34; // w2
_QWORD v35[2]; // [xsp+30h] [xbp+0h] BYREF
float v36; // [xsp+B0h] [xbp+80h]
float v37; // [xsp+B4h] [xbp+84h]
cocos2d::CCPoint v38; // [xsp+B8h] [xbp+88h] BYREF
cocos2d::CCPoint v39; // [xsp+C0h] [xbp+90h] BYREF
cocos2d::CCPoint v40; // [xsp+C8h] [xbp+98h] BYREF
ButtonSprite *v41; // [xsp+D0h] [xbp+A0h] BYREF
cocos2d::CCPoint v42; // 0:s0.4,4:s1.4
cocos2d::CCPoint v43; // 0:s0.4,4:s1.4
v5 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 220.0, 1);
if ( v5 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v35 + 160, "Setup Coin");
SetupTriggerPopup::addTitle((__int64)a1);
p_m_textOffset = &v41[-1].m_textOffset;
if ( &v41[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_caption = (unsigned int *)&v41[-1].m_caption;
do
m_data = __ldaxr(p_m_caption);
while ( __stlxr(m_data - 1, p_m_caption) );
}
else
{
m_data = (int)v41[-1].m_caption.m_data.m_data;
LODWORD(v41[-1].m_caption.m_data.m_data) = m_data - 1;
}
if ( m_data <= 0 )
operator delete(p_m_textOffset);
}
sub_D153B8((unsigned int)v35 + 160, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, &v41, v8, v9, v10, v11, v12);
v13 = &v41[-1].m_textOffset;
if ( &v41[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)&v41[-1].m_caption;
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = (int)v41[-1].m_caption.m_data.m_data;
LODWORD(v41[-1].m_caption.m_data.m_data) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v13);
}
sub_D153B8((int)&v40, "Help");
sub_D153B8((int)&v41, "Target ID will be spawn triggered when collected.");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v14 = &v41[-1].m_textOffset;
if ( &v41[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)&v41[-1].m_caption;
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = (int)v41[-1].m_caption.m_data.m_data;
LODWORD(v41[-1].m_caption.m_data.m_data) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v14);
}
v15 = (void *)(*(_QWORD *)&v40 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v40 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(*(_QWORD *)&v40 - 8LL);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(*(_QWORD *)&v40 - 8LL);
*(_DWORD *)(*(_QWORD *)&v40 - 8LL) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v15);
}
v16 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v16);
cocos2d::CCPoint::CCPoint(&v38, v36 * 0.5, v37 * 0.5);
sub_D153B8((int)&v41, "Target ID:");
cocos2d::CCPoint::CCPoint(&v39, 0.0, 30.0);
cocos2d::CCPoint::operator+(&v40, &v38, &v39);
v42.y = 0.0;
v42.x = 0.8;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x33u,
v42,
9999.0,
v17,
v18,
(std::string)&v41,
&v40,
Float,
Int,
10,
1u,
0,
0,
0,
0,
0);
v19 = &v41[-1].m_textOffset;
if ( &v41[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)&v41[-1].m_caption;
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = (int)v41[-1].m_caption.m_data.m_data;
LODWORD(v41[-1].m_caption.m_data.m_data) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v19);
}
if ( a2 )
{
if ( a2->m_objectID == 142 )
{
sub_D153B8((int)&v41, "Unique ID:");
cocos2d::CCPoint::CCPoint(&v39, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v40, &v38, &v39);
v43.x = 0.8;
v43.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xCu,
v43,
9999.0,
v20,
v21,
(std::string)&v41,
&v40,
Float,
Int,
10,
1u,
0,
0,
0,
0,
0);
v22 = &v41[-1].m_textOffset;
if ( &v41[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)&v41[-1].m_caption;
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = (int)v41[-1].m_caption.m_data.m_data;
LODWORD(v41[-1].m_caption.m_data.m_data) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v22);
}
}
}
SetupTriggerPopup::postSetup(a1);
}
return v5;
}