//
// SetupTouchTogglePopup::init from 0x62a994 to 0x62af7c (1512 bytes)
//
// 1 xrefs:
// > SetupTouchTogglePopup::create @ 0x62b1c4
//
// 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:55:12 +0000
//
int __fastcall SetupTouchTogglePopup::init(SetupTouchTogglePopup *this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
int v4; // r11
cocos2d::CCDirector *v5; // r0
const char *v6; // r2
int v7; // r5
void (__fastcall *v8)(int, int (__fastcall **)(SetupTouchTogglePopup *, cocos2d::CCObject *)); // r7
ButtonSprite *v9; // r0
int v10; // r0
int v11; // r9
void (__fastcall *v12)(int, int (__fastcall **)(SetupTouchTogglePopup *, cocos2d::CCObject *)); // r10
int v13; // r9
int v14; // r3
int v15; // r9
int v16; // r2
_BOOL4 v17; // r10
_BOOL4 v18; // r10
float v19; // s14
int v20; // r9
int v21; // r2
_BOOL4 v22; // r10
int v23; // r3
_BOOL4 v24; // r7
int v26; // [sp+10h] [bp-A4h]
cocos2d::CCPoint *v27; // [sp+24h] [bp-90h]
float v28; // [sp+2Ch] [bp-88h] BYREF
float v29; // [sp+30h] [bp-84h]
_BYTE v30[8]; // [sp+34h] [bp-80h] BYREF
_BYTE v31[8]; // [sp+3Ch] [bp-78h] BYREF
_BYTE v32[8]; // [sp+44h] [bp-70h] BYREF
_BYTE v33[8]; // [sp+4Ch] [bp-68h] BYREF
_BYTE v34[8]; // [sp+54h] [bp-60h] BYREF
int v35; // [sp+5Ch] [bp-58h]
int v36; // [sp+60h] [bp-54h]
unsigned int (__fastcall *v37)(unsigned int, cocos2d::CCObject *); // [sp+64h] [bp-50h]
int v38; // [sp+68h] [bp-4Ch]
int (__fastcall *v39)(SetupTouchTogglePopup *, cocos2d::CCObject *); // [sp+6Ch] [bp-48h]
int v40; // [sp+70h] [bp-44h]
int (__fastcall *v41)(SetupTouchTogglePopup *, cocos2d::CCObject *); // [sp+74h] [bp-40h]
int v42; // [sp+78h] [bp-3Ch]
unsigned int (__fastcall *v43)(unsigned int, cocos2d::CCObject *); // [sp+7Ch] [bp-38h]
int v44; // [sp+80h] [bp-34h]
int (__fastcall *v45)(SetupTouchTogglePopup *, cocos2d::CCObject *); // [sp+84h] [bp-30h] BYREF
int v46; // [sp+88h] [bp-2Ch]
int (__fastcall *v47)(SetupTouchTogglePopup *, cocos2d::CCObject *); // [sp+8Ch] [bp-28h] BYREF
int v48; // [sp+90h] [bp-24h]
int v49[3]; // [sp+94h] [bp-20h] BYREF
int v50; // [sp+A0h] [bp-14h] BYREF
int v51; // [sp+A4h] [bp-10h]
int v52; // [sp+A8h] [bp-Ch]
v4 = SetupTriggerPopup::init(this, a2, a3, 320.0, 260.0, 1, 0.0);
if ( v4 )
{
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SetupTouchTogglePopup *))(*(_DWORD *)this + 680))(this);
cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v28);
v7 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Touch Toggle", "bigFont.fnt", v6);
(*(void (__fastcall **)(SetupTouchTogglePopup *, int))(*(_DWORD *)this + 228))(this, v7);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v7 + 80))(v7, 1056964608);
v8 = *(void (__fastcall **)(int, int (__fastcall **)(SetupTouchTogglePopup *, cocos2d::CCObject *)))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v47,
v28 * 0.5,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v29 * 0.5)) - 16.0);
v8(v7, &v47);
v9 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
*(float *)&v26);
v35 = 684;
v36 = 1;
v10 = CCMenuItemSpriteExtra::create((int)v9, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v10);
memset(v49, 0, sizeof(v49));
std::string::__init(v49, "Help", 4u);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(
&v50,
"Toggles a group of objects when the player clicks.\n"
"It also functions as a Spawn trigger.\n"
"Alternates between toggling on and off for each click by default. Use Toggle On or Off to limit to either."
"\n"
"Hold Mode toggles on and off for holding and releasing instead of clicking.\n"
"Dual Mode blocks player 2's clicks.",
0x153u);
v11 = InfoAlertButton::create((char *)v49, (int)&v50, 1065353216);
std::string::~string((int)&v50);
std::string::~string((int)v49);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v11);
v12 = *(void (__fastcall **)(int, int (__fastcall **)(SetupTouchTogglePopup *, cocos2d::CCObject *)))(*(_DWORD *)v11 + 92);
v27 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v45,
(float)((float)(v28 * 0.5) - (float)(*((float *)this + 139) * 0.5)) + 18.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v29 * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v47, v27);
v12(v11, &v47);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, (float)(v28 * 0.5) - 50.0, (float)(v29 * 0.5) + 45.0);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Group ID", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const cocos2d::CCPoint *)v30);
v13 = IDNameInput::create((int)this, (int)this + 440, 1, 3, (int)&v50, (int)&v47, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v50);
if ( v13 )
v14 = *(_DWORD *)(v13 + 300);
else
v14 = 0;
*((_DWORD *)this + 178) = v14;
SetupTouchTogglePopup::updateTextInputLabel(this);
SetupTriggerPopup::createMultiTriggerItemsDefaultVertical(this);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Hold Mode", 9u);
v38 = 0;
v15 = *((unsigned __int8 *)this + 720);
v37 = SetupTouchTogglePopup::onHoldMode;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (float)(v28 * 0.5) + 50.0, (float)(v29 * 0.5) + 45.0);
SetupTriggerPopup::createToggleButton(this, &v50, v37, v38, v15, &v47);
std::string::~string((int)&v50);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v31,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v28 * 0.5)) - 70.0,
(float)((float)(v29 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 60.0);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Toggle\nOn", 9u);
v16 = *((_DWORD *)this + 181);
v40 = 0;
v17 = v16 == 1;
v39 = SetupTouchTogglePopup::onTouchMode;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const cocos2d::CCPoint *)v31);
*((_DWORD *)this + 183) = SetupTriggerPopup::createToggleButton(this, &v50, v39, v40, v17, &v47);
std::string::~string((int)&v50);
*(_BYTE *)(*((_DWORD *)this + 183) + 309) = 1;
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 183) + 36))(*((_DWORD *)this + 183));
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Toggle\nOff", 0xAu);
v42 = 0;
v41 = SetupTouchTogglePopup::onTouchMode;
v18 = *((_DWORD *)this + 181) == 2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, 0.0, -35.0);
cocos2d::CCPoint::operator+(&v47, v31, &v45);
*((_DWORD *)this + 184) = SetupTriggerPopup::createToggleButton(this, &v50, v41, v42, v18, &v47);
std::string::~string((int)&v50);
*(_BYTE *)(*((_DWORD *)this + 184) + 309) = 1;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 184) + 36))(*((_DWORD *)this + 184), 2);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Dual\nMode", 9u);
v19 = *((float *)this + 139);
v44 = 0;
v20 = *((unsigned __int8 *)this + 740);
v43 = SetupTouchTogglePopup::onDualTouchMode;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v47,
(float)((float)(v19 * 0.5) + (float)(v28 * 0.5)) - 60.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v29 * 0.5)) - 20.0);
SetupTriggerPopup::createToggleButton(this, &v50, v43, v44, v20, &v47);
std::string::~string((int)&v50);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (float)(v28 * 0.5) - 50.0, (float)(v29 * 0.5) - 20.0);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "P1\nOnly", 7u);
v21 = *((_DWORD *)this + 182) - 1;
v46 = 0;
v22 = v21 == 0;
v45 = SetupTouchTogglePopup::onControlMode;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const cocos2d::CCPoint *)v32);
*((_DWORD *)this + 186) = SetupTriggerPopup::createToggleButton(this, &v50, v45, v46, v22, &v47);
std::string::~string((int)&v50);
*(_BYTE *)(*((_DWORD *)this + 186) + 309) = 1;
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 186) + 36))(*((_DWORD *)this + 186));
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "P2\nOnly", 7u);
v48 = 0;
v23 = *((_DWORD *)this + 182) - 2;
v47 = SetupTouchTogglePopup::onControlMode;
v24 = v23 == 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 100.0, 0.0);
cocos2d::CCPoint::operator+(v34, v32, v33);
*((_DWORD *)this + 187) = SetupTriggerPopup::createToggleButton(this, &v50, v47, v48, v24, v34);
std::string::~string((int)&v50);
*(_BYTE *)(*((_DWORD *)this + 187) + 309) = 1;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 187) + 36))(*((_DWORD *)this + 187), 2);
*((_BYTE *)this + 568) = 0;
}
return v4;
}