//
// UIPOptionsLayer::init from 0x5d8284 to 0x5d8670 (1004 bytes)
//
// 0 xrefs:
//
// 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:54:10 +0000
//
int __fastcall UIPOptionsLayer::init(cocos2d::CCPoint **this)
{
int v2; // r10
void (__fastcall *v3)(cocos2d::CCPoint **, _DWORD *); // r3
cocos2d::CCDirector *v4; // r0
cocos2d::CCMenu *WinSize; // r0
cocos2d::CCPoint *v6; // r0
ButtonSprite *v7; // r0
int v8; // r7
ButtonSprite *v9; // r0
int v10; // r11
int v11; // r9
GameManager *v12; // r0
cocos2d::CCNode *v13; // r0
float v14; // s18
cocos2d::CCPoint *v15; // r0
const char *v16; // r1
cocos2d::CCObject *v17; // r9
const char *v18; // r1
cocos2d::CCObject *v19; // r8
cocos2d::CCArray *v20; // r0
cocos2d::CCArray *v21; // r6
GameManager *v22; // r0
int v23; // r0
cocos2d::CCDirector *v24; // r0
float v25; // s17
cocos2d::CCDirector *v26; // r0
float v27; // r0
float v29; // [sp+10h] [bp-74h]
float v30; // [sp+10h] [bp-74h]
cocos2d::CCPoint *v31; // [sp+34h] [bp-50h]
cocos2d::CCPoint *v32; // [sp+34h] [bp-50h]
void (__fastcall *v33)(int, _DWORD *); // [sp+3Ch] [bp-48h]
float v34; // [sp+40h] [bp-44h] BYREF
float v35; // [sp+44h] [bp-40h]
_BYTE v36[8]; // [sp+48h] [bp-3Ch] BYREF
float v37[2]; // [sp+50h] [bp-34h] BYREF
_BYTE v38[8]; // [sp+58h] [bp-2Ch] BYREF
int v39; // [sp+60h] [bp-24h]
int v40; // [sp+64h] [bp-20h]
_DWORD v41[2]; // [sp+68h] [bp-1Ch] BYREF
int v42[3]; // [sp+70h] [bp-14h] BYREF
v2 = SetupTriggerPopup::init((SetupTriggerPopup *)this, nullptr, nullptr, 400.0, 280.0, 1, 0.0);
if ( v2 )
{
SetupTriggerPopup::preSetup((SetupTriggerPopup *)this);
v3 = *((void (__fastcall **)(cocos2d::CCPoint **, _DWORD *))*this + 152);
LOWORD(v41[0]) = 17459;
BYTE2(v41[0]) = -103;
v3(this, v41);
v4 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCPoint **, int))*this + 146))(this, 255);
*((_BYTE *)this + 468) = 1;
cocos2d::CCDirector::sharedDirector(v4);
WinSize = (cocos2d::CCMenu *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v34);
v6 = (cocos2d::CCPoint *)cocos2d::CCMenu::create(WinSize);
*(this + 111) = v6;
(*(void (__fastcall **)(_DWORD, cocos2d::CCPoint *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v6, 10);
v7 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(30.0),
v29);
v39 = 684;
v40 = 1;
v8 = CCMenuItemSpriteExtra::create((int)v7, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v8);
v33 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v8 + 92);
v31 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, (float)(v34 * 0.5) - 40.0, v35 - 30.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v41, v31);
v33(v8, v41);
v9 = ButtonSprite::create(
(ButtonSprite *)"Reset",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_05.png",
COERCE_CONST_CHAR_(30.0),
v30);
v41[0] = UIPOptionsLayer::onReset;
v41[1] = 0;
v10 = CCMenuItemSpriteExtra::create((int)v9, 0, (int)this, (int)UIPOptionsLayer::onReset, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v10);
v32 = *(cocos2d::CCPoint **)(*(_DWORD *)v10 + 92);
v11 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 96))(v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 80.0, 0.0);
cocos2d::CCPoint::operator+(v38, v11, v37);
((void (__fastcall *)(int, _BYTE *))v32)(v10, v38);
SetupTriggerPopup::toggleBG((SetupTriggerPopup *)this, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v34 * 0.5, v35 - 70.0);
memset(v42, 0, sizeof(v42));
std::string::__init(v42, "Opacity:", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 0.0, -75.0);
cocos2d::CCPoint::operator+(v38, v36, v37);
SetupTriggerPopup::createValueControlAdvanced(
this,
-29,
v42,
v38,
1061997773,
0,
1,
4,
0,
0,
1065353216,
0,
0,
1,
2,
0);
v12 = (GameManager *)std::string::~string((int)v42);
v13 = (cocos2d::CCNode *)(GameManager::sharedState(v12) + 1316);
v14 = *(float *)v13 * 255.0;
v15 = (cocos2d::CCPoint *)cocos2d::CCNode::create(v13);
*(this + 179) = v15;
(*(void (__fastcall **)(cocos2d::CCPoint *, void *))(*(_DWORD *)v15 + 160))(v15, &unk_D2C4B0);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), *(this + 179), 9);
v17 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_checkpointBtn_001.png",
v16);
(*(void (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v17 + 456))(
v17,
(unsigned __int8)(unsigned int)v14);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 179) + 228))(*(this + 179), v17);
v19 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_removeCheckBtn_001.png",
v18);
(*(void (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v19 + 456))(
v19,
(unsigned __int8)(unsigned int)v14);
v20 = (cocos2d::CCArray *)(*(int (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 179) + 228))(
*(this + 179),
v19);
v21 = (cocos2d::CCArray *)cocos2d::CCArray::create(v20);
cocos2d::CCArray::addObject(v21, v17);
v22 = (GameManager *)cocos2d::CCArray::addObject(v21, v19);
v23 = GameManager::sharedState(v22);
v24 = (cocos2d::CCDirector *)cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v37,
(const cocos2d::CCPoint *)(v23 + 1308));
if ( v37[0] == 0.0 && v37[1] == 0.0 )
{
v25 = v34 * 0.5;
v26 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
v27 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v26));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v25, v27 + 40.0);
cocos2d::CCPoint::operator=(v37, v38);
}
(*(void (__fastcall **)(_DWORD, float *))(*(_DWORD *)*(this + 179) + 92))(*(this + 179), v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, (const cocos2d::CCPoint *)&unk_D2C4B8);
GameToolbox::alignItemsHorisontally(*(float *)&v21, 10.0, (int)v38, 0);
SetupTriggerPopup::postSetup((SetupTriggerPopup *)this);
}
return v2;
}