//
// GJDropDownLayer::init from 0x140256e80 to 0x1402572ba (1082 bytes)
//
// 17 xrefs:
// > AccountLayer::create @ 0x14007d6cd
// > AccountLayer::layerHidden @ 0x14007f578
// > GJMoreGamesLayer::create @ 0x14027ffec
// > URLViewLayer::create @ 0x1402a4b57
// > GJSongBrowser::create @ 0x1402b7285
// > GJSongBrowser::init @ 0x1402b730b
// > MenuLayer::onAchievements @ 0x1403358f9
// > MenuLayer::openOptions @ 0x140335b7f
// > MenuLayer::onStats @ 0x140335cb8
// > OptionsLayer::layerHidden @ 0x140373664
// > PlayLayer::showEndLayer @ 0x1403ac87b
// > PlayLayer::showRetryLayer @ 0x1403aca30
// > SongsLayer::create @ 0x140494701
// > ??> @ 0x140684440
// > ??> @ 0x140684454
// > ??> @ 0x140684464
// > ??> @ 0x1406cf9d8
//
// 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 GJDropDownLayer::init(GJDropDownLayer *a1, const char *a2, float a3, bool a4)
{
__int64 v7; // rax
cocos2d::CCTouchDispatcher *v8; // rax
bool result; // al
_BOOL8 v10; // rdx
_BOOL8 v11; // rdx
_BOOL8 v12; // rdx
__int64 v13; // rcx
cocos2d::CCDirector *v14; // rax
cocos2d::CCLayer *v15; // rax
GJDropDownLayer_vtbl *v16; // r8
float v17; // xmm0_4
__int64 v18; // rax
double v19; // xmm0_8
__int64 v20; // rax
GJListLayer *v21; // rax
cocos2d::CCLayer *m_mainLayer; // rcx
float v23; // xmm0_4
GJListLayer_vtbl *v24; // rbx
const cocos2d::CCPoint *v25; // rax
struct cocos2d::CCSprite *v26; // rax
CCMenuItemSpriteExtra *v27; // r14
cocos2d::CCMenu *v28; // rax
cocos2d::CCMenu_vtbl *v29; // rbx
__int64 v30; // rcx
cocos2d::CCDirector *v31; // rax
__int64 v32; // rcx
cocos2d::CCDirector *v33; // rax
float v34; // xmm0_4
const cocos2d::CCPoint *v35; // rax
struct cocos2d::CCSprite *v36; // rdi
float v37; // xmm0_4
cocos2d::CCSprite_vtbl *v38; // rbx
__int64 v39; // rax
float v40; // xmm0_4
cocos2d::CCSprite_vtbl *v41; // rbx
const cocos2d::CCPoint *v42; // rax
struct cocos2d::CCSprite *v43; // rdi
float v44; // xmm0_4
cocos2d::CCSprite_vtbl *v45; // rbx
__int64 v46; // rax
float v47; // xmm0_4
cocos2d::CCSprite_vtbl *v48; // rbx
const cocos2d::CCPoint *v49; // rax
GJDropDownLayer_vtbl *v50; // rax
_BOOL8 v51; // rdx
GJDropDownLayer_vtbl *v52; // rax
__int64 v53; // rdx
__int64 v54; // rcx
int v55; // [rsp+30h] [rbp-48h] BYREF
float v56; // [rsp+38h] [rbp-40h]
v7 = cocos2d::CCDirector::sharedDirector(a1);
v8 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 144LL))(v7);
cocos2d::CCTouchDispatcher::registerForcePrio(v8, a1, 2);
v55 = 2097152000;
result = cocos2d::CCLayerColor::initWithColor(a1, (const struct cocos2d::_ccColor4B *)&v55);
if ( result )
{
LOBYTE(v10) = 1;
a1->setTouchEnabled(a1, v10);
LOBYTE(v11) = 1;
a1->setKeypadEnabled(a1, v11);
LOBYTE(v12) = 1;
a1->setKeyboardEnabled(a1, v12);
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v13);
cocos2d::CCDirector::getWinSize(v14);
v15 = (cocos2d::CCLayer *)cocos2d::CCLayer::create();
v16 = a1->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v15;
v17 = ((float (__fastcall *)(GJDropDownLayer *, cocos2d::CCLayer *))v16->addChild_1)(a1, v15);
cocos2d::CCPoint::CCPoint(v17, 0.0);
v19 = cocos2d::CCPoint::operator=(&a1->m_endPosition, v18);
cocos2d::CCPoint::CCPoint(*(float *)&v19, 0.0);
cocos2d::CCPoint::operator=(&a1->m_startPosition, v20);
a1->m_mainLayer->setPosition_0(a1->m_mainLayer, &a1->m_startPosition);
v21 = GJListLayer::create(nullptr, a2, (cocos2d::ccColor4B)-1275068416, 356.0, a3, 0);
m_mainLayer = a1->m_mainLayer;
a1->m_listLayer = v21;
v23 = ((float (__fastcall *)(cocos2d::CCLayer *, GJListLayer *))m_mainLayer->addChild_1)(m_mainLayer, v21);
v24 = a1->m_listLayer->__vftable;
cocos2d::CCPoint::CCPoint(v23, (float)(v56 - 356.0) * 0.5);
v24->setPosition_0(a1->m_listLayer, v25);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v27 = CCMenuItemSpriteExtra::create(v26, nullptr, a1, (cocos2d::SEL_MenuHandler *)sub_140257638);
HIDWORD(v27->m_pfnSelector.adj) = 1070386381;
v28 = cocos2d::CCMenu::create(v27, 0);
a1->m_buttonMenu = v28;
v29 = v28->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v31 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v30);
cocos2d::CCDirector::getScreenTop(v31);
v33 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v32);
v34 = cocos2d::CCDirector::getScreenLeft(v33) + 24.0;
cocos2d::CCPoint::CCPoint(v34, v34);
v29->setPosition_0(a1->m_buttonMenu, v35);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
a1->m_listLayer->getPosition_0(a1->m_listLayer);
v36 = cocos2d::CCSprite::createWithSpriteFrameName("chain_01_001.png");
v37 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v36,
0xFFFFFFFFLL);
v38 = v36->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v37, 0.5);
v40 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v38->setAnchorPoint)(v36, v39);
v41 = v36->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v40, (float)(v56 * 0.5) - 156.0);
v41->setPosition_0(v36, v42);
v36->setTag(v36, 0);
v43 = cocos2d::CCSprite::createWithSpriteFrameName("chain_01_001.png");
v44 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v43,
0xFFFFFFFFLL);
v45 = v43->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v44, 0.5);
v47 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v45->setAnchorPoint)(v43, v46);
v48 = v43->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v47, (float)(v56 * 0.5) + 156.0);
v48->setPosition_0(v43, v49);
v43->setTag(v43, 1);
v50 = a1->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
LOBYTE(v51) = 1;
a1->m_closeOnHide = 0;
v50->hideLayer(a1, v51);
v52 = a1->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_closeOnHide = 1;
v52->customSetup(a1);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v54, v53) + 197) )
{
if ( !a4 )
GameToolbox::addBackButton(a1->m_mainLayer, v27);
}
return 1;
}
return result;
}