//
// SetupGameplayOffsetPopup::init from 0xb2715c to 0xb277cc (1648 bytes)
//
// 2 xrefs:
// > SetupGameplayOffsetPopup::create @ 0xb27a18
// > ??> @ 0x6d8d0
//
// 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:01:39 +0000
//
__int64 __fastcall SetupGameplayOffsetPopup::init(cocos2d::CCNode **this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
unsigned __int8 v4; // w0
unsigned int v5; // w25
__int64 v7; // x2
__int64 v8; // x3
__int64 v9; // x4
__int64 v10; // x5
const char *v11; // x6
cocos2d::CCDirector *MultiTriggerItemsDefault; // x0
cocos2d::CCDirector *v13; // x0
float v14; // s0
int v15; // w26
unsigned __int8 v16; // w27
bool v17; // w4
__int64 v18; // x5
const char *v19; // x6
__int64 v20; // x0
__int64 v21; // x20
cocos2d::CCNode *v22; // x26
void (__fastcall *v23)(__int64, __int64 *); // x24
__int64 v24; // [xsp+A8h] [xbp+78h] BYREF
_BYTE v25[8]; // [xsp+B0h] [xbp+80h] BYREF
_BYTE v26[8]; // [xsp+B8h] [xbp+88h] BYREF
__int64 v27; // [xsp+C0h] [xbp+90h] BYREF
__int64 v28[2]; // [xsp+C8h] [xbp+98h] BYREF
void *v29; // [xsp+D8h] [xbp+A8h]
__int64 v30; // [xsp+E0h] [xbp+B0h] BYREF
__int64 v31; // [xsp+E8h] [xbp+B8h]
void *v32; // [xsp+F0h] [xbp+C0h]
v4 = SetupTriggerPopup::init((SetupTriggerPopup *)this, a2, a3, 380.0, 240.0, 1u, 0.0);
v5 = v4;
if ( v4 )
{
SetupTriggerPopup::preSetup((SetupTriggerPopup *)this);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Gameplay Offset", 0xFu);
SetupTriggerPopup::addTitle((__int64)this, (__int64)&v30);
if ( (v30 & 1) != 0 )
operator delete(v32);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "OK", 2u);
SetupTriggerPopup::addCloseButton((__int64)this, (__int64)&v30, v7, v8, v9, v10, v11);
if ( (v30 & 1) != 0 )
operator delete(v32);
v28[0] = 0;
v28[1] = 0;
v29 = nullptr;
std::string::__init(v28, "Help", 4u);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(
&v30,
"Change the offset between the player and the camera center. 0 = player will be placed in the center of the camera.",
0x72u);
SetupTriggerPopup::addHelpButton((__int64)this, (char *)v28, (char *)&v30, 1.0);
if ( (v30 & 1) != 0 )
operator delete(v32);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
MultiTriggerItemsDefault = (cocos2d::CCDirector *)SetupTriggerPopup::createMultiTriggerItemsDefault((SetupTriggerPopup *)this);
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(MultiTriggerItemsDefault);
cocos2d::CCDirector::getWinSize(&v24, v13);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
(float)(*(float *)&v24 * 0.5) + -80.0,
(float)(*((float *)&v24 + 1) * 0.5) + 55.0);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Offset X:", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createValueControlAdvanced(
this,
28,
(char *)&v30,
(__int64)&v27,
0,
2,
10,
0,
0.8,
-100.0,
100.0,
0,
28,
0,
2,
0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Offset Y:", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 0.0, -60.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createValueControlAdvanced(
this,
29,
(char *)&v30,
(__int64)&v27,
0,
2,
10,
0,
0.8,
-100.0,
100.0,
0,
29,
0,
2,
0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v14 = (*((float (__fastcall **)(cocos2d::CCNode **, __int64))*this + 183))(this, 101);
v30 = 0;
v15 = (int)v14;
v31 = 0;
v32 = nullptr;
v16 = (int)v14 == 1;
std::string::__init(&v30, "X\nOnly", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 105.0, -8.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
1u,
v16,
1u,
(char *)&v30,
(const cocos2d::CCPoint *)&v27,
0,
0,
0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Y\nOnly", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 105.0, -68.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
2u,
v15 == 2,
1u,
(char *)&v30,
(const cocos2d::CCPoint *)&v27,
0,
0,
0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Dont\nZoom", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 180.0, -8.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x3Au,
&v30,
(const cocos2d::CCPoint *)&v27,
0,
0,
0,
1.0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v30 = 0;
v31 = 0;
v32 = nullptr;
std::string::__init(&v30, "Dont\nZoom", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 180.0, -68.0);
cocos2d::CCPoint::operator+(&v27, v25);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x3Bu,
&v30,
(const cocos2d::CCPoint *)&v27,
0,
0,
0,
1.0);
if ( (v30 & 1) != 0 )
operator delete(v32);
v20 = ButtonSprite::create((ButtonSprite *)"Default", (const char *)&qword_58 + 2, 0, 0, 0.4, v17, v18, v19);
v21 = CCMenuItemSpriteExtra::create(v20, 0, (__int64)this, (__int64)SetupGameplayOffsetPopup::onDefaultValues, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v21);
v22 = *(this + 69);
v23 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v26,
(float)((float)(*((float *)this + 183) * 0.5) + (float)(*(float *)&v24 * 0.5)) - 40.0,
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v24 + 1) * 0.5)) - 25.0);
cocos2d::CCNode::convertToNodeSpace(&v27, v22, (const cocos2d::CCPoint *)v26);
v23(v21, &v27);
SetupTriggerPopup::postSetup((SetupTriggerPopup *)this);
}
return v5;
}