//
// StarInfoPopup::init from 0x900450 to 0x900e0c (2492 bytes)
//
// 2 xrefs:
// > StarInfoPopup::create @ 0x900f54
// > ??> @ 0xb7bb8
//
// 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 StarInfoPopup::init(
StarInfoPopup *a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
bool a11)
{
cocos2d::CCDirector *v13; // x0
cocos2d::CCNode *v14; // x20
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x21
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCMenu *v17; // x0
char *v18; // x1
const char *v19; // x20
cocos2d::CCString *v20; // x0
cocos2d::CCLabelBMFont *v21; // x20
void *v22; // x0
void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
float v24; // s0
int v25; // w21
unsigned int v26; // w20
int v27; // w0
GJDifficultySprite *v28; // x23
cocos2d::CCLabelBMFont *v29; // x20
cocos2d::CCArray **p_m_pTargetArray; // x0
void (__fastcall *v31)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
const char *v32; // x1
__int64 v33; // x2
__int64 v34; // x3
bool v35; // w4
__int64 v36; // x5
const char *v37; // x6
cocos2d::CCString *v38; // x0
cocos2d::CCLabelBMFont *v39; // x20
char *v40; // x0
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCString *v42; // x0
cocos2d::CCLabelBMFont *v43; // x20
char *v44; // x0
void (__fastcall *v45)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCString *v46; // x0
cocos2d::CCLabelBMFont *v47; // x20
void *v48; // x0
void (__fastcall *v49)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCNode *v50; // x0
CCMenuItemSpriteExtra *v51; // x20
cocos2d::CCMenu *m_buttonMenu; // x21
void (__fastcall *v53)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
char *v54; // x21
unsigned int *v55; // x20
int v56; // w0
unsigned int *p_m_nExtraKerning; // x1
int m_nExtraKerning; // w2
unsigned int *v59; // x1
int v60; // w2
unsigned int *v61; // x1
int v62; // w2
unsigned int *v63; // x1
int v64; // w2
unsigned int *v65; // x1
int v66; // w2
char v74; // [xsp+AFh] [xbp+AFh]
float v75; // [xsp+B8h] [xbp+B8h]
float v76; // [xsp+BCh] [xbp+BCh]
const char *v77; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v78; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v79; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCLabelBMFont *v80; // [xsp+D8h] [xbp+D8h] BYREF
cocos2d::CCPoint v81; // [xsp+E0h] [xbp+E0h] BYREF
char *v82; // [xsp+E8h] [xbp+E8h] BYREF
char *v83; // [xsp+F0h] [xbp+F0h] BYREF
cocos2d::CCRect v84; // [xsp+F8h] [xbp+F8h] BYREF
cocos2d::CCPoint v85; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v86; // 0:x2.16
cocos2d::CCRect v87; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v74 = FLAlertLayer::init(a1, 0x4Bu);
if ( v74 )
{
v13 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v13);
cocos2d::CCRect::CCRect(&v84, 0.0, 0.0, 80.0, 80.0);
v14 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square02.png",
(const char *)&v84,
v87);
setContentSize = v14->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v84, 380.0, 210.0);
setContentSize(v14, (const cocos2d::CCSize *)&v84);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, -1);
setPosition = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v84.origin, v75 * 0.5, v76 * 0.5);
setPosition(v14, &v84.origin);
v17 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v17;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v17, 10);
if ( a11 )
v18 = "Platformer";
else
v18 = "Classic";
sub_D153B8((int)&v77, v18);
v19 = v77;
GameToolbox::pointsToString((GameToolbox *)(unsigned int)(a3 + a4 + a5 + a6 + a7), &v78);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s: %s", v19, v78);
cocos2d::CCString::getCString(v20);
v21 = cocos2d::CCLabelBMFont::create();
v22 = (void *)(v78 - 24);
if ( (__int64 *)(v78 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v59 = (unsigned int *)(v78 - 8);
do
v60 = __ldaxr(v59);
while ( __stlxr(v60 - 1, v59) );
}
else
{
v60 = *(_DWORD *)(v78 - 8);
*(_DWORD *)(v78 - 8) = v60 - 1;
}
if ( v60 <= 0 )
operator delete(v22);
}
a1->m_mainLayer->addChild(a1->m_mainLayer, v21);
v21->setScale(v21, 0.7);
v23 = v21->setPosition;
cocos2d::CCPoint::CCPoint(&v84.origin, v75 * 0.5, (float)((float)(v76 * 0.5) + 105.0) - 20.0);
v23(v21, &v84.origin);
v24 = (float)(v75 * 0.5) - 147.5;
v25 = 0;
cocos2d::CCPoint::CCPoint(&v79, v24, (float)(v76 * 0.5) + 25.0);
do
{
cocos2d::CCPoint::CCPoint(&v84.origin, (float)v25 * 59.0, 0.0);
cocos2d::CCPoint::operator+(&v82, &v79, &v84);
switch ( v25 )
{
case 1:
v26 = a3;
v27 = v25;
break;
case 2:
v26 = a4;
v27 = v25;
break;
case 3:
v26 = a5;
v27 = v25;
break;
case 4:
v26 = a6;
v27 = v25;
break;
case 5:
v26 = a7;
v27 = v25;
break;
default:
v26 = a2;
v27 = -1;
break;
}
v28 = GJDifficultySprite::create(v27, Long);
v28->setScale(v28, 0.9);
v28->setPosition(v28, (const cocos2d::CCPoint *)&v82);
a1->m_mainLayer->addChild(a1->m_mainLayer, v28);
GameToolbox::pointsToString((GameToolbox *)v26, (__int64 *)&v80);
v29 = cocos2d::CCLabelBMFont::create();
p_m_pTargetArray = &v80[-1].m_pTargetArray;
if ( &v80[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_nExtraKerning = (unsigned int *)&v80[-1].m_nExtraKerning;
do
m_nExtraKerning = __ldaxr(p_m_nExtraKerning);
while ( __stlxr(m_nExtraKerning - 1, p_m_nExtraKerning) );
}
else
{
m_nExtraKerning = v80[-1].m_nExtraKerning;
v80[-1].m_nExtraKerning = m_nExtraKerning - 1;
}
if ( m_nExtraKerning <= 0 )
operator delete(p_m_pTargetArray);
}
v29->setScale(v29, 0.6);
a1->m_mainLayer->addChild(a1->m_mainLayer, v29);
v31 = v29->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v83, 0.0, -40.0);
cocos2d::CCPoint::operator+(&v84, &v82, &v83);
v31(v29, &v84.origin);
++v25;
}
while ( v25 != 6 );
cocos2d::CCPoint::CCPoint(
&v81,
(float)((float)(v75 * 0.5) + 190.0) - 12.0,
(float)((float)(v76 * 0.5) + -105.0) + 14.0);
if ( a9 > 0 )
{
GameToolbox::pointsToString((GameToolbox *)(unsigned int)a9, (__int64 *)&v82);
v38 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Gauntlet: %s", v82);
cocos2d::CCString::getCString(v38);
v39 = cocos2d::CCLabelBMFont::create();
v40 = v82 - 24;
if ( v82 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v65 = (unsigned int *)(v82 - 8);
do
v66 = __ldaxr(v65);
while ( __stlxr(v66 - 1, v65) );
}
else
{
v66 = *((_DWORD *)v82 - 2);
*((_DWORD *)v82 - 2) = v66 - 1;
}
if ( v66 <= 0 )
operator delete(v40);
}
a1->m_mainLayer->addChild(a1->m_mainLayer, v39);
v39->setScale(v39, 0.4);
setAnchorPoint = v39->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v84.origin, 1.0, 0.0);
setAnchorPoint(v39, &v84.origin);
v39->setPosition(v39, &v81);
v81.y = v81.y + 16.0;
}
if ( a8 > 0 )
{
GameToolbox::pointsToString((GameToolbox *)(unsigned int)a8, (__int64 *)&v83);
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Daily: %s", v83);
cocos2d::CCString::getCString(v42);
v43 = cocos2d::CCLabelBMFont::create();
v44 = v83 - 24;
if ( v83 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v63 = (unsigned int *)(v83 - 8);
do
v64 = __ldaxr(v63);
while ( __stlxr(v64 - 1, v63) );
}
else
{
v64 = *((_DWORD *)v83 - 2);
*((_DWORD *)v83 - 2) = v64 - 1;
}
if ( v64 <= 0 )
operator delete(v44);
}
a1->m_mainLayer->addChild(a1->m_mainLayer, v43);
v43->setScale(v43, 0.4);
v45 = v43->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v84.origin, 1.0, 0.0);
v45(v43, &v84.origin);
v43->setPosition(v43, &v81);
v81.y = v81.y + 16.0;
}
if ( a10 > 0 )
{
GameToolbox::pointsToString((GameToolbox *)(unsigned int)a10, (__int64 *)&v84);
v46 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Map: %s",
*(const char **)&v84.origin);
cocos2d::CCString::getCString(v46);
v47 = cocos2d::CCLabelBMFont::create();
v48 = (void *)(*(_QWORD *)&v84.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v84.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v61 = (unsigned int *)(*(_QWORD *)&v84.origin - 8LL);
do
v62 = __ldaxr(v61);
while ( __stlxr(v62 - 1, v61) );
}
else
{
v62 = *(_DWORD *)(*(_QWORD *)&v84.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v84.origin - 8LL) = v62 - 1;
}
if ( v62 <= 0 )
operator delete(v48);
}
a1->m_mainLayer->addChild(a1->m_mainLayer, v47);
v47->setScale(v47, 0.4);
v49 = v47->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v84.origin, 1.0, 0.0);
v49(v47, &v84.origin);
v47->setPosition(v47, &v81);
v81.y = v81.y + 16.0;
}
v50 = (cocos2d::CCNode *)ButtonSprite::create((ButtonSprite *)"OK", v32, v33, v34, v35, v36, v37);
v86.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v86.adj = (size_t)StarInfoPopup::onClose;
v51 = CCMenuItemSpriteExtra::create(v50, nullptr, v86);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v51);
m_buttonMenu = a1->m_buttonMenu;
v53 = v51->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v83, v75 * 0.5, (float)((float)(v76 * 0.5) + -105.0) + 25.0);
v85 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v83);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v53)(v51, &v84, v85.x, v85.y);
v54 = (char *)(v77 - 24);
if ( v77 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v55 = (unsigned int *)(v77 - 8);
do
v56 = __ldaxr(v55);
while ( __stlxr(v56 - 1, v55) );
}
else
{
v56 = *((_DWORD *)v77 - 2);
*((_DWORD *)v77 - 2) = v56 - 1;
}
if ( v56 <= 0 )
operator delete(v54);
}
}
return v74;
}