//
// GJDropDownLayer::init from 0x52bd20 to 0x52c048 (808 bytes)
//
// 4 xrefs:
// > GJDropDownLayer::create @ 0x52c0f0
// > GJDropDownLayer::init @ 0x52c134
// > EndLevelLayer::init @ 0x534120
// > RetryLevelLayer::create @ 0x547138
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:52:00 +0000
//
int __fastcall GJDropDownLayer::init(GameToolbox **this, cocos2d::CCLabelBMFont *a2, float a3, int a4)
{
int v7; // r0
cocos2d::CCTouchDispatcher *v8; // r0
int v9; // r8
cocos2d::CCDirector *v10; // r0
cocos2d::CCLayer *WinSize; // r0
GameToolbox *v12; // r0
GameToolbox *v13; // r3
cocos2d::CCLayerColor *v14; // r0
int v15; // r7
void (__fastcall *v16)(int, _DWORD *); // r9
const char *v17; // r1
int v18; // r0
cocos2d::CCMenu *v19; // r9
cocos2d::CCDirector *v20; // r0
cocos2d::CCDirector *v21; // r7
void (__fastcall *v22)(cocos2d::CCDirector *, _BYTE *); // r10
cocos2d::CCDirector *v23; // r0
float v24; // s18
cocos2d::CCDirector *v25; // r0
float v26; // r0
__int64 v27; // r0
float v28; // s16
int v29; // r7
const char *v30; // r1
int v31; // r7
void (__fastcall *v32)(int, _BYTE *); // r10
void (__fastcall *v33)(int, _BYTE *); // r10
GameToolbox *v34; // r3
PlatformToolbox *v35; // r0
cocos2d::CCMenuItem *v36; // r2
int isControllerConnected; // r5
void (__fastcall *v40)(int, _BYTE *); // [sp+Ch] [bp-28h]
void (__fastcall *v41)(int, _BYTE *); // [sp+Ch] [bp-28h]
float v42; // [sp+14h] [bp-20h] BYREF
float v43; // [sp+18h] [bp-1Ch]
_BYTE v44[8]; // [sp+1Ch] [bp-18h] BYREF
_DWORD v45[2]; // [sp+24h] [bp-10h] BYREF
v7 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
v8 = (cocos2d::CCTouchDispatcher *)(*(int (__fastcall **)(int))(*(_DWORD *)v7 + 80))(v7);
cocos2d::CCTouchDispatcher::registerForcePrio(v8, (cocos2d::CCObject *)this, 2, 0);
v45[0] = 2097152000;
v9 = cocos2d::CCLayerColor::initWithColor(this, v45);
if ( v9 )
{
(*((void (__fastcall **)(GameToolbox **, int))*this + 125))(this, 1);
(*((void (__fastcall **)(GameToolbox **, int))*this + 134))(this, 1);
v10 = (cocos2d::CCDirector *)(*((int (__fastcall **)(GameToolbox **, int))*this + 136))(this, 1);
cocos2d::CCDirector::sharedDirector(v10);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v42);
v12 = (GameToolbox *)cocos2d::CCLayer::create(WinSize);
v13 = *this;
*(this + 116) = v12;
(*((void (__fastcall **)(GameToolbox **, GameToolbox *))v13 + 57))(this, v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 0.0, 0.0);
cocos2d::CCPoint::operator=(this + 110, v45);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 0.0, v43);
cocos2d::CCPoint::operator=(this + 112, v45);
(*(void (__fastcall **)(_DWORD, char *))(*(_DWORD *)*(this + 116) + 92))(*(this + 116), (char *)this + 448);
v14 = GJListLayer::create(nullptr, a2, -1275068416, 356.0, a3, 0);
*(this + 115) = v14;
(*(void (__fastcall **)(_DWORD, cocos2d::CCLayerColor *))(*(_DWORD *)*(this + 116) + 228))(*(this + 116), v14);
v15 = (int)*(this + 115);
v16 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v15 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
(float)(v42 - 356.0) * 0.5,
(float)((float)((float)(v43 - a3) * 0.5) - 10.0) + 5.0);
v16(v15, v45);
v18 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_03_001.png", v17);
v45[0] = 660;
v45[1] = 1;
v19 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v18, 0, (int)this, 660, 1);
CCMenuItemSpriteExtra::setSizeMult((int)v19, 1.6);
v20 = (cocos2d::CCDirector *)cocos2d::CCMenu::create(v19, nullptr);
*(this + 114) = v20;
v21 = v20;
v22 = *(void (__fastcall **)(cocos2d::CCDirector *, _BYTE *))(*(_DWORD *)v20 + 92);
v23 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v20);
v24 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v23));
v25 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v24));
v26 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v25));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, v24 + 24.0, v26 - 23.0);
v22(v21, v44);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(*(_DWORD *)*(this + 116) + 232))(*(this + 116), *(this + 114), 10);
v27 = ((__int64 (__fastcall *)(_DWORD))*(_DWORD *)(*(_DWORD *)*(this + 115) + 96))(*(this + 115));
v28 = (float)(a3 + *(float *)(v27 + 4)) + 12.0;
v29 = cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"chain_01_001.png",
(const char *)HIDWORD(v27));
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 116) + 232))(*(this + 116), v29, -1);
v40 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v29 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, 0.5, 0.0);
v40(v29, v44);
v41 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v29 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, (float)(v42 * 0.5) - 156.0, v28);
v41(v29, v44);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v29 + 36))(v29, 0);
v31 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"chain_01_001.png", v30);
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 116) + 232))(*(this + 116), v31, -1);
v32 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v31 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, 0.5, 0.0);
v32(v31, v44);
v33 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v31 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, (float)(v42 * 0.5) + 156.0, v28);
v33(v31, v44);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v31 + 36))(v31, 1);
v34 = *this;
*((_BYTE *)this + 468) = 0;
(*((void (__fastcall **)(GameToolbox **, int))v34 + 167))(this, 1);
*((_BYTE *)this + 468) = 1;
v35 = (PlatformToolbox *)(*((int (__fastcall **)(GameToolbox **))*this + 163))(this);
isControllerConnected = PlatformToolbox::isControllerConnected(v35);
if ( isControllerConnected )
{
if ( !a4 )
GameToolbox::addBackButton(*(this + 116), v19, v36);
return isControllerConnected;
}
}
return v9;
}