//
// CreatorSettingsPopup::init from 0x7659dc to 0x765c68 (652 bytes)
//
// 1 xrefs:
// > CreatorSettingsPopup::create @ 0x765ed4
//
// 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:59:07 +0000
//
GameManager *__fastcall CreatorSettingsPopup::init(
cocos2d::CCPoint **this,
GJGameLevel *a2,
CreatorSettingsDelegate *a3)
{
GameManager *v6; // r8
cocos2d::CCDirector *v7; // r0
float v8; // s18
float v9; // s16
float v10; // s18
float v11; // s16
GJGameLevel *v12; // r0
_BOOL4 v13; // r5
int v14; // r3
int v15; // r5
int v16; // r5
ButtonSprite *v17; // r0
int v18; // r10
float v19; // s15
const char *v20; // r1
ButtonSprite *v21; // r0
int v22; // r5
const cocos2d::CCPoint *v23; // r11
void (__fastcall *v24)(int, _DWORD *); // r10
int v25; // r5
int v26; // r6
const cocos2d::CCPoint *v27; // r11
void (__fastcall *v28)(int, _BYTE *); // r10
cocos2d::CCPoint *v30; // [sp+10h] [bp-4Ch]
cocos2d::CCPoint *v31; // [sp+10h] [bp-4Ch]
void (__fastcall *v32)(int, _DWORD *); // [sp+14h] [bp-48h]
float v33[2]; // [sp+18h] [bp-44h] BYREF
_BYTE v34[8]; // [sp+20h] [bp-3Ch] BYREF
_BYTE v35[8]; // [sp+28h] [bp-34h] BYREF
_DWORD (*v36)(CreatorSettingsPopup *__hidden, cocos2d::CCObject *); // [sp+30h] [bp-2Ch]
int v37; // [sp+34h] [bp-28h]
_DWORD v38[2]; // [sp+38h] [bp-24h] BYREF
_DWORD v39[2]; // [sp+40h] [bp-1Ch] BYREF
int v40[3]; // [sp+48h] [bp-14h] BYREF
v6 = SetupTriggerPopup::init((SetupTriggerPopup *)this, nullptr, nullptr, 300.0, 200.0, &byte_7, 0.0);
if ( v6 )
{
SetupTriggerPopup::preSetup((SetupTriggerPopup *)this);
qmemcpy(v39, "PWi", 3);
v7 = (cocos2d::CCDirector *)SetupTriggerPopup::setCustomBGColor((int)this, (int)v39);
*(this + 182) = a3;
*(this + 181) = a2;
cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v33);
v8 = v33[0];
v9 = v33[1];
memset(v40, 0, sizeof(v40));
std::string::__init(v40, "Creator Settings", 0x10u);
v10 = v8 * 0.5;
v11 = v9 * 0.5;
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)v40);
std::string::~string((int)v40);
v12 = *(this + 181);
if ( v12 && GJGameLevel::isPlatformer(v12) )
{
v14 = (int)*(this + 181);
if ( *(_BYTE *)(v14 + 824) )
{
v13 = 1;
}
else
{
v15 = *(unsigned __int8 *)(v14 + 1328);
if ( (v15 & 1) != 0 )
v16 = *(_DWORD *)(v14 + 1332);
else
v16 = v15 >> 1;
v13 = v16 != 0;
}
}
else
{
v13 = 0;
}
v17 = ButtonSprite::create(
(ButtonSprite *)"Description",
(const char *)&dword_78,
0,
0.8,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
*(float *)&v30);
v36 = CreatorSettingsPopup::onDescription;
v37 = 0;
v18 = CCMenuItemSpriteExtra::create((int)v17, 0, (int)this, (int)CreatorSettingsPopup::onDescription, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v18);
v31 = *(this + 111);
if ( v13 )
v19 = v11 + 15.0;
else
v19 = v11 - 10.0;
v32 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v10, v19);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v39, v31);
v32(v18, v39);
if ( v13 )
{
v21 = ButtonSprite::create(
(ButtonSprite *)"Controls",
(const char *)&dword_78,
0,
0.8,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
*(float *)&v31);
v38[0] = CreatorSettingsPopup::onControls;
v38[1] = 0;
v22 = CCMenuItemSpriteExtra::create((int)v21, 0, (int)this, (int)CreatorSettingsPopup::onControls, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v22);
v23 = *(this + 111);
v24 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, v10, v11 - 35.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v39, v23);
v24(v22, v39);
}
v25 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v20);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 80))(v25, 1060320051);
v39[0] = 684;
v39[1] = 1;
v26 = CCMenuItemSpriteExtra::create(v25, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v26);
v27 = *(this + 111);
v28 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v26 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v34,
v10 - (float)(*((float *)this + 139) * 0.5),
v11 + (float)(*((float *)this + 140) * 0.5));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v35, v27);
v28(v26, v35);
SetupTriggerPopup::postSetup((SetupTriggerPopup *)this);
}
return v6;
}