//
// UILayer::init from 0x6f043c to 0x6f0968 (1324 bytes)
//
// 2 xrefs:
// > UILayer::create @ 0x6f0a48
// > ??> @ 0xbdd90
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:51:48 +0000
//
__int64 __fastcall UILayer::init(UILayer *this, GJBaseGameLayer *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w24
int v7; // w21
cocos2d::CCObject *v8; // x0
GameManager *v9; // x0
GameManager *v10; // x0
GameManager *v11; // x0
__int64 v12; // x0
cocos2d::CCObject *v13; // x20
cocos2d::CCDirector *v14; // x0
cocos2d::CCDirector *v15; // x0
const char *v16; // x1
__int64 v17; // x20
__int64 v18; // x0
cocos2d::CCDirector **v19; // x20
cocos2d::CCDirector *v20; // x0
cocos2d::CCDirector *v21; // x0
GameManager *ScreenRight; // x0
float v23; // s0
GameManager *v24; // x0
cocos2d::CCDirector *GameVariable; // x0
float v26; // s8
__int64 (__fastcall *v27)(cocos2d::CCDirector **, float, float); // x21
cocos2d::CCDirector *v28; // x0
float v29; // s0
cocos2d::CCMenu *v30; // x0
__int64 v31; // x0
cocos2d::CCArray *v32; // x0
cocos2d::CCObject *v33; // x0
const char *v34; // x1
cocos2d::CCObject *v35; // x25
cocos2d::CCObject *v36; // x21
const char *v37; // x1
cocos2d::CCObject *v38; // x26
cocos2d::CCObject *v39; // x20
cocos2d::CCArray *v40; // x0
cocos2d::CCArray *v41; // x27
PlatformToolbox *v42; // x0
const char *v43; // x1
cocos2d::CCDirector *v44; // x0
float v45; // s0
cocos2d::CCObject *v46; // x20
void (__fastcall *v47)(cocos2d::CCObject *, _BYTE *); // x21
__int64 v48; // x0
const char *v49; // x1
cocos2d::CCObject *v50; // x20
void (__fastcall *v51)(cocos2d::CCObject *, _BYTE *); // x21
__int64 v52; // x0
float v53; // [xsp+70h] [xbp+70h]
float v54; // [xsp+70h] [xbp+70h]
float v55; // [xsp+70h] [xbp+70h]
__int64 v56; // [xsp+88h] [xbp+88h] BYREF
_BYTE v57[8]; // [xsp+90h] [xbp+90h] BYREF
v57[0] = 0;
v57[1] = 0;
v57[2] = 0;
v57[3] = 0;
v4 = cocos2d::CCLayerColor::initWithColor(this, v57);
v5 = v4;
if ( v4 )
{
*((_QWORD *)this + 75) = a2;
*((_BYTE *)this + 608) = (unsigned __int8)&dword_0 + 1;
v7 = 0;
v8 = (cocos2d::CCObject *)cocos2d::CCArray::create((cocos2d::CCArray *)((char *)&dword_0 + 1));
*((_QWORD *)this + 77) = v8;
v9 = (GameManager *)cocos2d::CCObject::retain(v8);
v10 = (GameManager *)GameManager::sharedState(v9);
v11 = (GameManager *)GameManager::prepareDPadSettings(v10);
do
{
if ( v7 <= 1 )
v12 = GameManager::sharedState(v11) + 1316;
else
v12 = GameManager::sharedState(v11) + 1436;
v13 = (cocos2d::CCObject *)GJUINode::create(v12);
(*(void (__fastcall **)(UILayer *, cocos2d::CCObject *, __int64))(*(_QWORD *)this + 464LL))(this, v13, 100);
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v13 + 344LL))(v13, 0);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 77), v13);
v11 = (GameManager *)(v7 & 0xFFFFFFFD);
if ( (_DWORD)v11 == 1 )
*((_BYTE *)v13 + 385) = 1;
++v7;
}
while ( v7 != 4 );
(*(void (__fastcall **)(UILayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
(*(void (__fastcall **)(UILayer *, __int64))(*(_QWORD *)this + 1072LL))(this, 1);
v14 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(UILayer *, __int64))(*(_QWORD *)this + 1088LL))(this, 1);
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v14);
cocos2d::CCDirector::getWinSize(&v56, v15);
v17 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_pauseBtn_clean_001.png", v16);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 912LL))(v17, 75);
v18 = CCMenuItemSpriteExtra::create(v17, 0, (__int64)this, (__int64)UILayer::onPause, 0);
*((_QWORD *)this + 71) = v18;
*(_DWORD *)(v18 + 412) = 0;
CCMenuItemSpriteExtra::setSizeMult(*((_QWORD *)this + 71), 4.0);
v19 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(*((cocos2d::CCMenu **)this + 71), nullptr);
v20 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(UILayer *, cocos2d::CCDirector **, __int64))(*(_QWORD *)this + 464LL))(
this,
v19,
16);
v21 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v20);
ScreenRight = (GameManager *)cocos2d::CCDirector::getScreenRight(v21);
v53 = v23;
v24 = (GameManager *)GameManager::sharedState(ScreenRight);
GameVariable = (cocos2d::CCDirector *)(unsigned __int8)GameManager::getGameVariable(v24, "0015");
if ( (_BYTE)GameVariable )
{
v44 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(GameVariable);
cocos2d::CCDirector::getScreenLeft(v44);
v26 = v45 + 15.0;
}
else
{
v26 = v53 - 15.0;
}
v27 = *((__int64 (__fastcall **)(cocos2d::CCDirector **, float, float))*v19 + 25);
v28 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v19);
cocos2d::CCDirector::getScreenTop(v28);
v30 = (cocos2d::CCMenu *)v27(v19, v26, v29 - 15.0);
v31 = cocos2d::CCMenu::create(v30);
*((_QWORD *)this + 70) = v31;
v32 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(UILayer *, __int64, __int64))(*(_QWORD *)this + 464LL))(
this,
v31,
16);
v33 = (cocos2d::CCObject *)cocos2d::CCArray::create(v32);
*((_QWORD *)this + 79) = v33;
cocos2d::CCObject::retain(v33);
v35 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_checkpointBtn_001.png",
v34);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 79), v35);
v36 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
(__int64)v35,
0,
(__int64)this,
(__int64)UILayer::onCheck,
0);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**((_QWORD **)this + 70) + 456LL))(
*((_QWORD *)this + 70),
v36);
*((_DWORD *)v36 + 100) = 1066192077;
v38 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_removeCheckBtn_001.png",
v37);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 79), v38);
v39 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
(__int64)v38,
0,
(__int64)this,
(__int64)UILayer::onDeleteCheck,
0);
v40 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD, cocos2d::CCObject *))(**((_QWORD **)this + 70) + 456LL))(
*((_QWORD *)this + 70),
v39);
*((_DWORD *)v39 + 100) = 1066192077;
v41 = (cocos2d::CCArray *)cocos2d::CCArray::create(v40);
cocos2d::CCArray::addObject(v41, v36);
cocos2d::CCArray::addObject(v41, v39);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v57, (const cocos2d::CCPoint *)&unk_155C4B8);
GameToolbox::alignItemsHorisontally((__int64)v41, (__int64)v57, 0, 10.0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v36, 1.5);
CCMenuItemSpriteExtra::setSizeMult((__int64)v39, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 70) + 1272LL))(*((_QWORD *)this + 70), 1);
v42 = (PlatformToolbox *)UILayer::toggleCheckpointsMenu(this);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected(v42) )
{
v46 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"controllerBtn_B_001.png",
v43);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 79), v46);
(*(void (__fastcall **)(cocos2d::CCObject *, cocos2d::CCObject *))(*(_QWORD *)v38 + 456LL))(v38, v46);
v47 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_QWORD *)v46 + 184LL);
v54 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v38 + 328LL))(v38) * 0.5;
v48 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v38 + 328LL))(v38);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v57, v54, (float)(*(float *)(v48 + 4) * 0.5) + -25.0);
v47(v46, v57);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_QWORD *)v46 + 160LL))(v46, 0.8);
v50 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"controllerBtn_X_001.png",
v49);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 79), v50);
(*(void (__fastcall **)(cocos2d::CCObject *, cocos2d::CCObject *))(*(_QWORD *)v35 + 456LL))(v35, v50);
v51 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_QWORD *)v50 + 184LL);
v55 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v35 + 328LL))(v35) * 0.5;
v52 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v35 + 328LL))(v35);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v57, v55, (float)(*(float *)(v52 + 4) * 0.5) + -25.0);
v51(v50, v57);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_QWORD *)v50 + 160LL))(v50, 0.8);
}
UILayer::updateCheckState(this);
UILayer::togglePlatformerMode(this, 0);
}
return v5;
}