//
// SelectListIconLayer::init from 0xa78bf4 to 0xa7913c (1352 bytes)
//
// 2 xrefs:
// > SelectListIconLayer::create @ 0xa7921c
// > ??> @ 0x754e0
//
// 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 SelectListIconLayer::init(SelectListIconLayer *a1, int a2)
{
int v5; // w19
unsigned int v6; // w25
cocos2d::CCDirector *v7; // x0
cocos2d::CCLayer *v8; // x0
cocos2d::CCNode *v9; // x20
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x21
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCLabelBMFont *v12; // x20
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCArray *v14; // x0
cocos2d::CCArray *v15; // x0
cocos2d::CCArray *v16; // x0
cocos2d::CCArray *v17; // x27
cocos2d::CCMenu *v18; // x0
cocos2d::CCLayer *m_mainLayer; // x3
cocos2d::CCMenu *m_buttonMenu; // x20
cocos2d::CCSprite *v21; // x21
CCMenuItemSpriteExtra *v22; // x20
void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
char *v24; // x0
unsigned int *v25; // x1
int v26; // w2
const char *v27; // x6
cocos2d::CCNode *v28; // x0
CCMenuItemSpriteExtra *v29; // x19
cocos2d::CCMenu *v30; // x21
void (__fastcall *v31)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
char v32; // [xsp+9Fh] [xbp+9Fh]
float v33; // [xsp+A8h] [xbp+A8h]
float v34; // [xsp+ACh] [xbp+ACh]
_BYTE v35[8]; // [xsp+B0h] [xbp+B0h] BYREF
const char *v36; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCPoint v37; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCRect v38; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v39; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v40; // 0:x2.16
cocos2d::SEL_MenuHandler v41; // 0:x2.16
cocos2d::CCRect v42; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v38.origin.x = -1.034e-25;
v32 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v38);
if ( v32 )
{
v5 = 0;
FLAlertLayer::incrementForcePrio(a1);
a1->m_currentDifficulty = a2;
v6 = 0;
a1->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v7);
v8 = cocos2d::CCLayer::create();
a1->m_mainLayer = v8;
a1->addChild(a1, v8);
cocos2d::CCRect::CCRect(&v38, 0.0, 0.0, 80.0, 80.0);
v9 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v38,
v42);
setContentSize = v9->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v38, 360.0, 240.0);
setContentSize(v9, (const cocos2d::CCSize *)&v38);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v9, -1);
setPosition = v9->setPosition;
cocos2d::CCPoint::CCPoint(&v38.origin, v33 * 0.5, v34 * 0.5);
setPosition(v9, &v38.origin);
v12 = cocos2d::CCLabelBMFont::create();
v13 = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v38.origin, v33 * 0.5, (float)((float)(v34 * 0.5) + 120.0) - 20.0);
v13(v12, &v38.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v12);
v14 = (cocos2d::CCArray *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v12->setScale)(v12, 0.8);
v15 = (cocos2d::CCArray *)cocos2d::CCArray::create(v14);
a1->m_difficulties = v15;
cocos2d::CCObject::retain(v15);
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
v18 = cocos2d::CCMenu::create();
m_mainLayer = a1->m_mainLayer;
a1->m_buttonMenu = v18;
m_mainLayer->addChild_0(m_mainLayer, v18, 10);
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v38.origin, v33 * 0.5, (float)((float)(v34 * 0.5) + 30.0) + 5.0);
cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v38.origin);
while ( 1 )
{
GJLevelList::frameForListDifficulty(v5, 1, (__int64)&v36);
v21 = cocos2d::CCSprite::createWithSpriteFrameName(v36);
cocos2d::CCArray::addObject(a1->m_difficulties, v21);
v21->setScale(v21, 1.0);
v40.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v40.adj = (size_t)SelectListIconLayer::onSelect;
v22 = CCMenuItemSpriteExtra::create(v21, nullptr, v40);
v21->setTag(v21, v6);
v22->setTag(v22, v6);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22);
cocos2d::CCArray::addObject(v17, v22);
v23 = v22->setPosition;
cocos2d::CCPoint::CCPoint(
&v37,
(float)((float)((float)(v5 % 6) * 52.0) + -156.0) + 26.0,
floorf((float)(v5 / 6)) * -60.0);
cocos2d::CCPoint::operator+(&v38, v35, &v37);
v23(v22, &v38.origin);
v24 = (char *)(v36 - 24);
if ( v36 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v36 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *((_DWORD *)v36 - 2);
*((_DWORD *)v36 - 2) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v24);
}
if ( ++v5 == 12 )
break;
if ( v5 == 11 )
v6 = -1;
else
v6 = v5;
}
a1->m_joystickConnected = -1;
cocos2d::CCArray::removeAllObjects(v17);
v28 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v27,
30.0);
v41.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v41.adj = (size_t)SelectListIconLayer::onClose;
v29 = CCMenuItemSpriteExtra::create(v28, nullptr, v41);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v29);
v30 = a1->m_buttonMenu;
v31 = v29->setPosition;
cocos2d::CCPoint::CCPoint(&v37, v33 * 0.5, (float)((float)(v34 * 0.5) + -120.0) + 25.0);
v39 = cocos2d::CCNode::convertToNodeSpace(v30, &v37);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v31)(v29, &v38, v39.x, v39.y);
SelectListIconLayer::onSelect(a1, nullptr);
a1->m_noElasticity = 1;
}
return v32;
}