//
// ControlSlotsPopup::init from 0x7a3bfc to 0x7a3eba (702 bytes)
//
// 1 xrefs:
// > ControlSlotsPopup::create @ 0x7a3f8c
//
// 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:56 +0000
//
GameManager *__fastcall ControlSlotsPopup::init(cocos2d::CCPoint **this, TouchControlEditLayer *a2, bool a3)
{
cocos2d::CCDirector *v6; // r0
float v7; // s19
float v8; // s18
float v9; // s19
float v10; // s18
const char *v11; // r6
cocos2d::CCString *v12; // r0
ButtonSprite *CString; // r0
ButtonSprite *v14; // r0
int v15; // r11
float v16; // s17
cocos2d::CCString *v17; // r0
ButtonSprite *v18; // r0
ButtonSprite *v19; // r0
int v20; // r0
const char *v21; // r1
int v22; // r10
const cocos2d::CCPoint *v23; // r11
const char *v24; // r1
int v25; // r6
int v26; // r5
const cocos2d::CCPoint *v27; // r9
void (__fastcall *v28)(int, _BYTE *); // r6
GameManager *v30; // [sp+10h] [bp-74h]
float v31; // [sp+10h] [bp-74h]
void (__fastcall *v32)(int, _DWORD *); // [sp+1Ch] [bp-68h]
void (__fastcall *v33)(int, _DWORD *); // [sp+1Ch] [bp-68h]
cocos2d::CCPoint *v34; // [sp+34h] [bp-50h]
float v35[2]; // [sp+38h] [bp-4Ch] BYREF
_BYTE v36[8]; // [sp+40h] [bp-44h] BYREF
_BYTE v37[8]; // [sp+48h] [bp-3Ch] BYREF
_BYTE v38[8]; // [sp+50h] [bp-34h] BYREF
_DWORD (*v39)(ControlSlotsPopup *__hidden, cocos2d::CCObject *); // [sp+58h] [bp-2Ch]
int v40; // [sp+5Ch] [bp-28h]
_DWORD (*v41)(ControlSlotsPopup *__hidden, cocos2d::CCObject *); // [sp+60h] [bp-24h]
int v42; // [sp+64h] [bp-20h]
_DWORD v43[2]; // [sp+68h] [bp-1Ch] BYREF
int v44[3]; // [sp+70h] [bp-14h] BYREF
v30 = SetupTriggerPopup::init((SetupTriggerPopup *)this, nullptr, nullptr, 240.0, 200.0, &byte_7, 0.0);
if ( v30 )
{
SetupTriggerPopup::preSetup((SetupTriggerPopup *)this);
qmemcpy(v43, "PWi", 3);
v6 = (cocos2d::CCDirector *)SetupTriggerPopup::setCustomBGColor((int)this, (int)v43);
*(this + 178) = a2;
*((_BYTE *)this + 716) = a3;
cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v35);
v7 = v35[0];
v8 = v35[1];
memset(v44, 0, sizeof(v44));
std::string::__init(v44, "Control Slots", 0xDu);
v9 = v7 * 0.5;
v10 = v8 * 0.5;
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)v44);
v11 = (_BYTE *)(&dword_0 + 1);
std::string::~string((int)v44);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v9, v10 + 25.0);
do
{
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Save %i", v11);
CString = (ButtonSprite *)cocos2d::CCString::getCString(v12);
v14 = ButtonSprite::create(
CString,
(const char *)&word_32,
0,
0.7,
1,
"goldFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(28.0),
*(float *)&v30);
v39 = ControlSlotsPopup::onSave;
v40 = 0;
v15 = CCMenuItemSpriteExtra::create((int)v14, 0, (int)this, (int)ControlSlotsPopup::onSave, 0);
(*(void (__fastcall **)(int, const char *))(*(_DWORD *)v15 + 36))(v15, v11);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v15);
v32 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v15 + 92);
v34 = *(this + 111);
v16 = (float)(int)(v11 - 1) * -42.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, -45.0, v16);
cocos2d::CCPoint::operator+(v38, v36, v37);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v43, v34);
v32(v15, v43);
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Load %i", v11);
v18 = (ButtonSprite *)cocos2d::CCString::getCString(v17);
v19 = ButtonSprite::create(
v18,
(const char *)&word_32,
0,
0.7,
1,
"goldFont.fnt",
"GJ_button_02.png",
COERCE_CONST_CHAR_(28.0),
v31);
v41 = ControlSlotsPopup::onLoad;
v42 = 0;
v20 = CCMenuItemSpriteExtra::create((int)v19, 0, (int)this, (int)ControlSlotsPopup::onLoad, 0);
v21 = v11++;
v22 = v20;
(*(void (__fastcall **)(int, const char *))(*(_DWORD *)v20 + 36))(v20, v21);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v22);
v23 = *(this + 111);
v33 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 45.0, v16);
cocos2d::CCPoint::operator+(v38, v36, v37);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v43, v23);
v33(v22, v43);
}
while ( v11 != (const char *)&byte_4 );
v25 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v24);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 80))(v25, 1060320051);
v43[0] = 684;
v43[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 *)v37,
v9 - (float)(*((float *)this + 139) * 0.5),
v10 + (float)(*((float *)this + 140) * 0.5));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v38, v27);
v28(v26, v38);
SetupTriggerPopup::postSetup((SetupTriggerPopup *)this);
}
return v30;
}