//
// SetupGameplayOffsetPopup::init from 0x1405d7160 to 0x1405d78a2 (1858 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x1401bbb1c
// > ??> @ 0x14092ea90
//
// This function is hookable on this platform (idp: pc, 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 11:34:57 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupGameplayOffsetPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
int v10; // ebx
__int64 v11; // rax
int v12; // r8d
int v13; // r9d
__int64 v14; // rax
int v15; // r8d
int v16; // r9d
__int64 v17; // rax
__int64 v18; // rax
int v19; // eax
cocos2d::CCObject *v20; // rsi
__int64 v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
__int64 v24; // rax
float v25; // [rsp+88h] [rbp-80h] BYREF
float v26; // [rsp+8Ch] [rbp-7Ch]
__int128 *v27; // [rsp+90h] [rbp-78h] BYREF
__int128 *v28; // [rsp+98h] [rbp-70h] BYREF
__int128 *v29; // [rsp+A0h] [rbp-68h] BYREF
__int128 v30; // [rsp+A8h] [rbp-60h] BYREF
__int64 v31; // [rsp+B8h] [rbp-50h]
__int64 v32; // [rsp+C0h] [rbp-48h]
__int128 v33; // [rsp+C8h] [rbp-40h] BYREF
__int64 v34; // [rsp+D8h] [rbp-30h]
__int64 v35; // [rsp+E0h] [rbp-28h]
char v36; // [rsp+180h] [rbp+78h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1131413504, 1, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v31 = 15;
v32 = 15;
strcpy((char *)&v30, "Gameplay Offset");
SetupTriggerPopup::addTitle(a1, &v30);
v30 = 0;
v31 = 2;
v32 = 15;
strcpy((char *)&v30, "OK");
SetupTriggerPopup::addCloseButton(a1, &v30);
v27 = &v30;
v30 = 0;
v31 = 0;
v32 = 0;
*(_QWORD *)&v30 = sub_14003D460(0x80u);
v31 = 114;
v32 = 127;
strcpy(
(char *)v30,
"Change the offset between the player and the camera center. 0 = player will be placed in the center of the camera.");
v33 = 0;
v34 = 4;
v35 = 15;
strcpy((char *)&v33, "Help");
SetupTriggerPopup::addHelpButton(a1, &v33, &v30);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, (float)(v25 * 0.5) - 80.0, (float)(v26 * 0.5) + 55.0);
v28 = &v30;
v31 = 9;
v32 = 15;
*(_QWORD *)&v30 = *(_QWORD *)"Offset X:";
*((_QWORD *)&v30 + 1) = (unsigned __int8)aOffsetX[8];
BYTE9(v30) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v36, &v27, v8);
SetupTriggerPopup::createValueControlAdvanced(
a1,
28,
(unsigned int)&v30,
(unsigned int)&v27,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
28,
0,
2,
0);
v29 = &v30;
v31 = 9;
v32 = 15;
*(_QWORD *)&v30 = *(_QWORD *)"Offset Y:";
*((_QWORD *)&v30 + 1) = (unsigned __int8)aOffsetY[8];
BYTE9(v30) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 0.0, -60.0);
cocos2d::CCPoint::operator+(&v36, &v27, v9);
SetupTriggerPopup::createValueControlAdvanced(
a1,
29,
(unsigned int)&v30,
(unsigned int)&v27,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
29,
0,
2,
0);
v10 = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 101);
v29 = &v30;
v30 = 0;
v31 = 6;
v32 = 15;
strcpy((char *)&v30, "X\nOnly");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 105.0, -8.0);
cocos2d::CCPoint::operator+(&v36, &v27, v11);
LOBYTE(v12) = v10 == 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 1, v12, v13, (__int64)&v30, (__int64)&v27, 0, 0, 0);
v29 = &v30;
v30 = 0;
v31 = 6;
v32 = 15;
strcpy((char *)&v30, "Y\nOnly");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 105.0, -68.0);
cocos2d::CCPoint::operator+(&v36, &v27, v14);
LOBYTE(v15) = v10 == 2;
SetupTriggerPopup::createCustomToggleValueControl(a1, 2, v15, v16, (__int64)&v30, (__int64)&v27, 0, 0, 0);
v29 = &v30;
*((_QWORD *)&v30 + 1) = 109;
v31 = 9;
v32 = 15;
*(_QWORD *)&v30 = 0x6F6F5A0A746E6F44LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 180.0, -8.0);
cocos2d::CCPoint::operator+(&v36, &v27, v17);
SetupTriggerPopup::createToggleValueControl(a1, 58, (unsigned int)&v30, (unsigned int)&v27, 0, 0, 0, 1065353216);
v29 = &v30;
*((_QWORD *)&v30 + 1) = 109;
v31 = 9;
v32 = 15;
*(_QWORD *)&v30 = 0x6F6F5A0A746E6F44LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 180.0, -68.0);
cocos2d::CCPoint::operator+(&v36, &v27, v18);
SetupTriggerPopup::createToggleValueControl(a1, 59, (unsigned int)&v30, (unsigned int)&v27, 0, 0, 0, 1065353216);
v19 = (unsigned int)ButtonSprite::create_1(
(int)"Default",
90,
0,
0.40000001,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v20 = CCMenuItemSpriteExtra::create(v19, 0, a1, (__int64)SetupGameplayOffsetPopup::onDefaultValues);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v20);
v21 = *(_QWORD *)v20;
v22 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v29,
(float)((float)(*(float *)(a1 + 732) * 0.5) + (float)(v25 * 0.5)) - 40.0,
(float)((float)(*(float *)(a1 + 736) * 0.5) + (float)(v26 * 0.5)) - 25.0);
cocos2d::CCNode::convertToNodeSpace(v22, &v28, v23);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v21 + 184))(v20, v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}