//
// SetupTouchTogglePopup::init from 0xaa2dc4 to 0xaa358c (1992 bytes)
//
// 2 xrefs:
// > SetupTouchTogglePopup::create @ 0xaa37e8
// > ??> @ 0xad668
//
// 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 13:00:49 +0000
//
__int64 __fastcall SetupTouchTogglePopup::init(SetupTouchTogglePopup *this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
unsigned __int8 v4; // w0
unsigned int v5; // w23
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
const char *v9; // x2
__int64 v10; // x24
void (__fastcall *v11)(__int64, __int64 *); // x26
const char *v12; // x6
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x27
void (__fastcall *v16)(__int64, __int64 *); // x28
__int64 v17; // x25
__int64 v18; // x0
int v19; // w26
_BOOL4 v20; // w27
__int64 ToggleButton; // x0
char v22; // w1
_BOOL4 v23; // w27
__int64 v24; // x0
char v25; // w1
int v26; // w26
_BOOL4 v27; // w27
__int64 v28; // x0
char v29; // w1
_BOOL4 v30; // w27
__int64 v31; // x0
char v32; // w1
cocos2d::CCNode *v33; // [xsp+98h] [xbp+88h]
__int64 v34; // [xsp+A8h] [xbp+98h] BYREF
_BYTE v35[8]; // [xsp+B0h] [xbp+A0h] BYREF
_BYTE v36[8]; // [xsp+B8h] [xbp+A8h] BYREF
_BYTE v37[8]; // [xsp+C0h] [xbp+B0h] BYREF
_BYTE v38[8]; // [xsp+C8h] [xbp+B8h] BYREF
__int64 v39; // [xsp+D0h] [xbp+C0h] BYREF
__int64 v40[2]; // [xsp+D8h] [xbp+C8h] BYREF
void *v41; // [xsp+E8h] [xbp+D8h]
__int64 v42; // [xsp+F0h] [xbp+E0h] BYREF
__int64 v43; // [xsp+F8h] [xbp+E8h]
void *v44; // [xsp+100h] [xbp+F0h]
v4 = SetupTriggerPopup::init(this, a2, a3, 320.0, 260.0, 1, 0.0);
v5 = v4;
if ( v4 )
{
v7 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(SetupTouchTogglePopup *))(*(_QWORD *)this + 1360LL))(this);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(&v34, v8);
v10 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Touch Toggle", "bigFont.fnt", v9);
(*(void (__fastcall **)(SetupTouchTogglePopup *, __int64))(*(_QWORD *)this + 456LL))(this, v10);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 0.5);
v11 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v39,
*(float *)&v34 * 0.5,
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v34 + 1) * 0.5)) - 16.0);
v11(v10, &v39);
v13 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v12,
30.0);
v14 = CCMenuItemSpriteExtra::create(v13, 0, (__int64)this, 1368, 1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v14);
v40[0] = 0;
v40[1] = 0;
v41 = nullptr;
std::string::__init(v40, "Help", 4u);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(
&v42,
"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);
v15 = InfoAlertButton::create((char *)v40, (char *)&v42, 1.0);
if ( (v42 & 1) != 0 )
operator delete(v44);
if ( (v40[0] & 1) != 0 )
operator delete(v41);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v15);
v16 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v15 + 184LL);
v33 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v38,
18.0 - (float)((float)(*((float *)this + 183) * 0.5) - (float)(*(float *)&v34 * 0.5)),
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v34 + 1) * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(&v39, v33, (const cocos2d::CCPoint *)v38);
v16(v15, &v39);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v35,
(float)(*(float *)&v34 * 0.5) + -50.0,
(float)(*((float *)&v34 + 1) * 0.5) + 45.0);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Group ID", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, (const cocos2d::CCPoint *)v35);
v17 = IDNameInput::create(this, (char *)this + 544, 1, 3, &v42, &v39, 6, 0, 1.0, 0, 0);
if ( (v42 & 1) != 0 )
operator delete(v44);
if ( v17 )
v18 = *(_QWORD *)(v17 + 384);
else
v18 = 0;
*((_QWORD *)this + 127) = v18;
SetupTouchTogglePopup::updateTextInputLabel(this);
SetupTriggerPopup::createMultiTriggerItemsDefaultVertical(this);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Hold Mode", 9u);
v19 = *((unsigned __int8 *)this + 1028);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v39,
(float)(*(float *)&v34 * 0.5) + 50.0,
(float)(*((float *)&v34 + 1) * 0.5) + 45.0);
SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onHoldMode,
0,
v19,
(cocos2d::CCPoint *)&v39);
if ( (v42 & 1) != 0 )
operator delete(v44);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v36,
(float)((float)(*((float *)this + 183) * 0.5) + (float)(*(float *)&v34 * 0.5)) - 70.0,
60.0 - (float)((float)(*((float *)this + 184) * 0.5) - (float)(*((float *)&v34 + 1) * 0.5)));
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Toggle\nOn", 9u);
v20 = *((_DWORD *)this + 258) == 1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, (const cocos2d::CCPoint *)v36);
ToggleButton = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onTouchMode,
0,
v20,
(cocos2d::CCPoint *)&v39);
v22 = v42;
*((_QWORD *)this + 130) = ToggleButton;
if ( (v22 & 1) != 0 )
{
operator delete(v44);
ToggleButton = *((_QWORD *)this + 130);
}
*(_BYTE *)(ToggleButton + 393) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 130) + 72LL))(*((_QWORD *)this + 130), 1);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Toggle\nOff", 0xAu);
v23 = *((_DWORD *)this + 258) == 2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, 0.0, -35.0);
cocos2d::CCPoint::operator+(&v39, v36);
v24 = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onTouchMode,
0,
v23,
(cocos2d::CCPoint *)&v39);
v25 = v42;
*((_QWORD *)this + 131) = v24;
if ( (v25 & 1) != 0 )
{
operator delete(v44);
v24 = *((_QWORD *)this + 131);
}
*(_BYTE *)(v24 + 393) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 131) + 72LL))(*((_QWORD *)this + 131), 2);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Dual\nMode", 9u);
v26 = *((unsigned __int8 *)this + 1056);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v39,
(float)((float)(*((float *)this + 183) * 0.5) + (float)(*(float *)&v34 * 0.5)) - 60.0,
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v34 + 1) * 0.5)) - 20.0);
SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onDualTouchMode,
0,
v26,
(cocos2d::CCPoint *)&v39);
if ( (v42 & 1) != 0 )
operator delete(v44);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v37,
(float)(*(float *)&v34 * 0.5) + -50.0,
(float)(*((float *)&v34 + 1) * 0.5) + -20.0);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "P1\nOnly", 7u);
v27 = *((_DWORD *)this + 259) == 1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, (const cocos2d::CCPoint *)v37);
v28 = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onControlMode,
0,
v27,
(cocos2d::CCPoint *)&v39);
v29 = v42;
*((_QWORD *)this + 133) = v28;
if ( (v29 & 1) != 0 )
{
operator delete(v44);
v28 = *((_QWORD *)this + 133);
}
*(_BYTE *)(v28 + 393) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 133) + 72LL))(*((_QWORD *)this + 133), 1);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "P2\nOnly", 7u);
v30 = *((_DWORD *)this + 259) == 2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, 100.0, 0.0);
cocos2d::CCPoint::operator+(&v39, v37);
v31 = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v42,
(int)SetupTouchTogglePopup::onControlMode,
0,
v30,
(cocos2d::CCPoint *)&v39);
v32 = v42;
*((_QWORD *)this + 134) = v31;
if ( (v32 & 1) != 0 )
{
operator delete(v44);
v31 = *((_QWORD *)this + 134);
}
*(_BYTE *)(v31 + 393) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 134) + 72LL))(*((_QWORD *)this + 134), 2);
*((_BYTE *)this + 744) = 0;
}
return v5;
}