//
// SetupGameplayOffsetPopup::init from 0x140442040 to 0x140442767 (1831 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x14011c4d8
// > ??> @ 0x1406da424
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=3
bool SetupGameplayOffsetPopup::init(SetupGameplayOffsetPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
double v5; // xmm0_8
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
int v8; // ebx
int v9; // r8d
int v10; // r9d
int v11; // r8d
int v12; // r9d
ButtonSprite *v13; // rax
CCMenuItemSpriteExtra *v14; // rdi
CCMenuItemSpriteExtra_vtbl *v15; // rbx
struct cocos2d::CCPoint v16; // rax
char v17; // [rsp+80h] [rbp-88h]
__int64 v18; // [rsp+80h] [rbp-88h]
float v19; // [rsp+88h] [rbp-80h]
__int128 *v20; // [rsp+90h] [rbp-78h] BYREF
__int128 *v21; // [rsp+98h] [rbp-70h] BYREF
__int128 *v22; // [rsp+A0h] [rbp-68h]
__int128 v23; // [rsp+A8h] [rbp-60h] BYREF
__int64 v24; // [rsp+B8h] [rbp-50h]
__int64 v25; // [rsp+C0h] [rbp-48h]
__int128 v26; // [rsp+C8h] [rbp-40h] BYREF
__int64 v27; // [rsp+D8h] [rbp-30h]
__int64 v28; // [rsp+E0h] [rbp-28h]
char v29; // [rsp+170h] [rbp+68h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 240.0, 1);
if ( result )
{
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
v24 = 15;
v25 = 15;
strcpy((char *)&v23, "Gameplay Offset");
SetupTriggerPopup::addTitle(a1, &v23);
v23 = 0;
v24 = 2;
v25 = 15;
strcpy((char *)&v23, "OK");
SetupTriggerPopup::addCloseButton(a1, &v23);
v20 = &v23;
v23 = 0;
v24 = 0;
v25 = 15;
*(_QWORD *)&v23 = sub_14003AA10(0x80u);
v24 = 114;
v25 = 127;
strcpy(
(char *)v23,
"Change the offset between the player and the camera center. 0 = player will be placed in the center of the camera.");
v26 = 0;
v27 = 4;
v28 = 15;
strcpy((char *)&v26, "Help");
v5 = SetupTriggerPopup::addHelpButton(a1, &v26, &v23);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7);
cocos2d::CCPoint::CCPoint(*(float *)&v5, (float)(v19 * 0.5) - 80.0);
v21 = &v23;
v24 = 9;
v25 = 15;
*(_QWORD *)&v23 = *(_QWORD *)"Offset X:";
*((_QWORD *)&v23 + 1) = (unsigned __int8)aOffsetX[8];
BYTE9(v23) = 0;
cocos2d::CCPoint::CCPoint(1.825414e31, 0.0);
cocos2d::CCPoint::operator+(&v29, &v20);
v17 = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
28,
(unsigned int)&v23,
(unsigned int)&v20,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
28,
0,
2,
v17);
v22 = &v23;
v24 = 9;
v25 = 15;
*(_QWORD *)&v23 = *(_QWORD *)"Offset Y:";
*((_QWORD *)&v23 + 1) = (unsigned __int8)aOffsetY[8];
BYTE9(v23) = 0;
cocos2d::CCPoint::CCPoint(1.825414e31, 0.0);
cocos2d::CCPoint::operator+(&v29, &v20);
LOBYTE(v18) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
29,
(unsigned int)&v23,
(unsigned int)&v20,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
29,
0,
2,
v18);
v8 = (int)a1->getValue(a1, 101);
v22 = &v23;
v23 = 0;
v24 = 6;
v25 = 15;
strcpy((char *)&v23, "X\nOnly");
cocos2d::CCPoint::CCPoint(0.0, 105.0);
cocos2d::CCPoint::operator+(&v29, &v20);
LOBYTE(v9) = v8 == 1;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 1, v9, v10, (__int64)&v23, (__int64)&v20, 0, 0, 0);
v22 = &v23;
v23 = 0;
v24 = 6;
v25 = 15;
strcpy((char *)&v23, "Y\nOnly");
cocos2d::CCPoint::CCPoint(0.0, 105.0);
cocos2d::CCPoint::operator+(&v29, &v20);
LOBYTE(v11) = v8 == 2;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 2, v11, v12, (__int64)&v23, (__int64)&v20, 0, 0, 0);
v22 = &v23;
*((_QWORD *)&v23 + 1) = 109;
v24 = 9;
v25 = 15;
*(_QWORD *)&v23 = 0x6F6F5A0A746E6F44LL;
cocos2d::CCPoint::CCPoint(7.5562951e31, 180.0);
cocos2d::CCPoint::operator+(&v29, &v20);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
58,
(unsigned int)&v23,
(unsigned int)&v20,
0,
0,
0,
1065353216);
v22 = &v23;
*((_QWORD *)&v23 + 1) = 109;
v24 = 9;
v25 = 15;
*(_QWORD *)&v23 = 0x6F6F5A0A746E6F44LL;
cocos2d::CCPoint::CCPoint(7.5562951e31, 180.0);
cocos2d::CCPoint::operator+(&v29, &v20);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
59,
(unsigned int)&v23,
(unsigned int)&v20,
0,
0,
0,
1065353216);
v13 = ButtonSprite::create_1("Default", 90, 0, 0.40000001, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v14 = CCMenuItemSpriteExtra::create(
v13,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)SetupGameplayOffsetPopup::onDefaultValues);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v14);
v15 = v14->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v19 * 0.5, (float)((float)(a1->m_width * 0.5) + (float)(v19 * 0.5)) - 40.0);
v16 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v21);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v15->setPosition_0)(v14, v16);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
return 1;
}
return result;
}