//
// SetupCameraEdgePopup::init from 0x67ede0 to 0x67f45e (1662 bytes)
//
// 1 xrefs:
// > SetupCameraEdgePopup::create @ 0x67f664
//
// 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:56:01 +0000
//
GameManager *__fastcall SetupCameraEdgePopup::init(
cocos2d::CCArray **this,
CameraTriggerGameObject *a2,
cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
ButtonSprite *v5; // r0
int v6; // r0
int v7; // r10
const cocos2d::CCPoint *v8; // r8
void (__fastcall *v9)(int, _DWORD *); // r9
int v10; // r8
cocos2d::CCArray *v11; // r3
cocos2d::CCArray *updated; // r0
cocos2d::CCObject *v13; // r0
int v14; // r0
const cocos2d::CCPoint *v15; // r2
_BOOL4 v16; // r8
int v17; // r10
cocos2d::CCObject *ToggleButton; // r8
int v19; // r3
const cocos2d::CCPoint *v20; // r7
_BOOL4 v21; // r9
int v22; // r10
cocos2d::CCObject *v23; // r6
int v24; // r3
_BOOL4 v25; // r9
const cocos2d::CCPoint *v26; // r7
int v27; // r10
cocos2d::CCObject *v28; // r7
int v29; // r3
_BOOL4 v30; // r9
const cocos2d::CCPoint *v31; // r11
int v32; // r10
cocos2d::CCObject *v33; // r9
ButtonSprite *v34; // r0
int v35; // r6
const cocos2d::CCPoint *v36; // r10
void (__fastcall *v37)(int, _BYTE *); // r9
float v39; // [sp+10h] [bp-ACh]
float v40; // [sp+10h] [bp-ACh]
GameManager *v41; // [sp+34h] [bp-88h]
const cocos2d::CCPoint *v42; // [sp+38h] [bp-84h]
float v43; // [sp+44h] [bp-78h] BYREF
float v44; // [sp+48h] [bp-74h]
_BYTE v45[8]; // [sp+4Ch] [bp-70h] BYREF
_BYTE v46[8]; // [sp+54h] [bp-68h] BYREF
_BYTE v47[8]; // [sp+5Ch] [bp-60h] BYREF
_BYTE v48[8]; // [sp+64h] [bp-58h] BYREF
int v49; // [sp+6Ch] [bp-50h]
int v50; // [sp+70h] [bp-4Ch]
unsigned int (__fastcall *v51)(SetupCameraEdgePopup *, cocos2d::CCObject *); // [sp+74h] [bp-48h]
int v52; // [sp+78h] [bp-44h]
unsigned int (__fastcall *v53)(SetupCameraEdgePopup *, cocos2d::CCObject *); // [sp+7Ch] [bp-40h]
int v54; // [sp+80h] [bp-3Ch]
unsigned int (__fastcall *v55)(SetupCameraEdgePopup *, cocos2d::CCObject *); // [sp+84h] [bp-38h] BYREF
int v56; // [sp+88h] [bp-34h]
unsigned int (__fastcall *v57)(SetupCameraEdgePopup *, cocos2d::CCObject *); // [sp+8Ch] [bp-30h] BYREF
int v58; // [sp+90h] [bp-2Ch]
_DWORD v59[2]; // [sp+94h] [bp-28h] BYREF
int v60[3]; // [sp+9Ch] [bp-20h] BYREF
int v61; // [sp+A8h] [bp-14h] BYREF
int v62; // [sp+ACh] [bp-10h]
int v63; // [sp+B0h] [bp-Ch]
v41 = SetupTriggerPopup::init((SetupTriggerPopup *)this, a2, a3, 300.0, 240.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( v41 )
{
v4 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCArray **))*this + 170))(this);
cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v43);
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Setup Camera Edge", 0x11u);
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v61);
std::string::~string((int)&v61);
v5 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(30.0),
v39);
v49 = 684;
v50 = 1;
v6 = CCMenuItemSpriteExtra::create((int)v5, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v6);
memset(v60, 0, sizeof(v60));
std::string::__init(v60, "Help", 4u);
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(
&v61,
"Makes one of the camera's edges a specified target object.\n"
"Use another trigger with Unlock (Target ID 0) to reset.",
0x82u);
v7 = InfoAlertButton::create((char *)v60, (int)&v61, 1065353216);
std::string::~string((int)&v61);
std::string::~string((int)v60);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v7);
v8 = *(this + 111);
v9 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v57,
(float)((float)(v43 * 0.5) - (float)(*((float *)this + 139) * 0.5)) + 18.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v44 * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v59, v8);
v9(v7, v59);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, (float)(v43 * 0.5) - 30.0, (float)(v44 * 0.5) - 20.0);
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Target ID", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, (const cocos2d::CCPoint *)v45);
v10 = IDNameInput::create((int)this, (int)(this + 110), 1, 51, (int)&v61, (int)v59, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v61);
if ( v10 )
v11 = *(cocos2d::CCArray **)(v10 + 300);
else
v11 = nullptr;
*(this + 178) = v11;
updated = (cocos2d::CCArray *)SetupCameraEdgePopup::updateTextInputLabel((SetupCameraEdgePopup *)this);
v13 = (cocos2d::CCObject *)cocos2d::CCArray::create(updated);
*(this + 181) = v13;
cocos2d::CCObject::retain(v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, v43 * 0.5, (float)(v44 * 0.5) + 50.0);
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Left", 4u);
v14 = (int)*(this + 180) - 1;
v15 = *(this + 111);
v52 = 0;
v16 = v14 == 0;
v42 = v15;
v51 = SetupCameraEdgePopup::onCameraEdge;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v57, v46, &v55);
v17 = (int)*(this + 115);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, 0.0, 2.0);
ToggleButton = GameToolbox::createToggleButton(
(int)&v61,
(int)v51,
v52,
v16,
v42,
(int)&v57,
(int)this,
v17,
0.6,
0.35,
0.0,
(int)v59,
"bigFont.fnt",
1,
0,
nullptr);
std::string::~string((int)&v61);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)ToggleButton + 36))(ToggleButton, 1);
*((_BYTE *)ToggleButton + 309) = 1;
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Right", 5u);
v19 = (int)*(this + 180);
v54 = 0;
v53 = SetupCameraEdgePopup::onCameraEdge;
v20 = *(this + 111);
v21 = v19 == 2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, -25.0, 0.0);
cocos2d::CCPoint::operator+(&v57, v46, &v55);
v22 = (int)*(this + 115);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, 0.0, 2.0);
v23 = GameToolbox::createToggleButton(
(int)&v61,
(int)v53,
v54,
v21,
v20,
(int)&v57,
(int)this,
v22,
0.6,
0.35,
0.0,
(int)v59,
"bigFont.fnt",
1,
0,
nullptr);
std::string::~string((int)&v61);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v23 + 36))(v23, 2);
*((_BYTE *)v23 + 309) = 1;
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Up", 2u);
v24 = (int)*(this + 180);
v56 = 0;
v55 = SetupCameraEdgePopup::onCameraEdge;
v25 = v24 == 3;
v26 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, 25.0, 0.0);
cocos2d::CCPoint::operator+(&v57, v46, v48);
v27 = (int)*(this + 115);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, 0.0, 2.0);
v28 = GameToolbox::createToggleButton(
(int)&v61,
(int)v55,
v56,
v25,
v26,
(int)&v57,
(int)this,
v27,
0.6,
0.35,
0.0,
(int)v59,
"bigFont.fnt",
1,
0,
nullptr);
std::string::~string((int)&v61);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v28 + 36))(v28, 3);
*((_BYTE *)v28 + 309) = 1;
v61 = 0;
v62 = 0;
v63 = 0;
std::string::__init(&v61, "Down", 4u);
v29 = (int)*(this + 180);
v58 = 0;
v57 = SetupCameraEdgePopup::onCameraEdge;
v30 = v29 == 4;
v31 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 75.0, 0.0);
cocos2d::CCPoint::operator+(v48, v46, v47);
v32 = (int)*(this + 115);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, 0.0, 2.0);
v33 = GameToolbox::createToggleButton(
(int)&v61,
(int)v57,
v58,
v30,
v31,
(int)v48,
(int)this,
v32,
0.6,
0.35,
0.0,
(int)v59,
"bigFont.fnt",
1,
0,
nullptr);
std::string::~string((int)&v61);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v33 + 36))(v33, 4);
*((_BYTE *)v33 + 309) = 1;
cocos2d::CCArray::addObject(*(this + 181), ToggleButton);
cocos2d::CCArray::addObject(*(this + 181), v23);
cocos2d::CCArray::addObject(*(this + 181), v28);
cocos2d::CCArray::addObject(*(this + 181), v33);
v34 = ButtonSprite::create(
(ButtonSprite *)"Unlock",
(const char *)&dword_20 + 3,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_05.png",
COERCE_CONST_CHAR_(30.0),
v40);
v59[0] = SetupCameraEdgePopup::onUnlockEdge;
v59[1] = 0;
v35 = CCMenuItemSpriteExtra::create((int)v34, 0, (int)this, (int)SetupCameraEdgePopup::onUnlockEdge, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v35);
v36 = *(this + 111);
v37 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v35 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, (float)(v43 * 0.5) + 100.0, (float)(v44 * 0.5) - 20.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v48, v36);
v37(v35, v48);
SetupTriggerPopup::createMultiTriggerItemsDefault((SetupTriggerPopup *)this);
*((_BYTE *)this + 568) = 0;
}
return v41;
}