//
// SetupGameplayOffsetPopup::init from 0x100798820 to 0x100798eef (1743 bytes)
//
// 1 xrefs:
// > SetupGameplayOffsetPopup::create @ 0x1007987db
//
// 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
//
bool __fastcall SetupGameplayOffsetPopup::init(
SetupGameplayOffsetPopup *a1,
EffectGameObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
int v4; // r15d
ButtonSprite *v5; // rax
CCMenuItemSpriteExtra *v6; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
char v8; // [rsp+40h] [rbp-140h] BYREF
char v9[15]; // [rsp+41h] [rbp-13Fh] BYREF
void *v10; // [rsp+50h] [rbp-130h]
char v11; // [rsp+58h] [rbp-128h] BYREF
char v12[15]; // [rsp+59h] [rbp-127h] BYREF
void *v13; // [rsp+68h] [rbp-118h]
__int128 v14; // [rsp+70h] [rbp-110h] BYREF
void *v15; // [rsp+80h] [rbp-100h]
char v16; // [rsp+88h] [rbp-F8h] BYREF
_BYTE v17[23]; // [rsp+89h] [rbp-F7h] BYREF
char v18; // [rsp+A0h] [rbp-E0h] BYREF
_BYTE v19[23]; // [rsp+A1h] [rbp-DFh] BYREF
__int128 v20; // [rsp+B8h] [rbp-C8h] BYREF
void *v21; // [rsp+C8h] [rbp-B8h]
__int128 v22; // [rsp+D0h] [rbp-B0h] BYREF
void *v23; // [rsp+E0h] [rbp-A0h]
char v24; // [rsp+E8h] [rbp-98h] BYREF
_BYTE v25[23]; // [rsp+E9h] [rbp-97h] BYREF
__int128 v26; // [rsp+100h] [rbp-80h] BYREF
void *v27; // [rsp+110h] [rbp-70h]
__int128 v28; // [rsp+118h] [rbp-68h] BYREF
void *v29; // [rsp+128h] [rbp-58h]
float v30; // [rsp+130h] [rbp-50h]
float v31; // [rsp+134h] [rbp-4Ch] BYREF
float v32; // [rsp+138h] [rbp-48h]
unsigned __int64 v33; // [rsp+13Ch] [rbp-44h] BYREF
double v34; // [rsp+144h] [rbp-3Ch] BYREF
unsigned __int64 v35; // [rsp+14Ch] [rbp-34h] BYREF
bool v36; // [rsp+157h] [rbp-29h]
double v37; // 0:xmm0_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 240.0, 1);
if ( result )
{
v36 = result;
SetupTriggerPopup::preSetup(a1);
v24 = 30;
strcpy(v25, "Gameplay Offset");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v24);
if ( (v24 & 1) != 0 )
operator delete(*(void **)&v25[15]);
v8 = 4;
strcpy(v9, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v8);
if ( (v8 & 1) != 0 )
operator delete(v10);
v11 = 8;
strcpy(v12, "Help");
v15 = operator new(0x78u);
*(_QWORD *)&v14 = 121;
*((_QWORD *)&v14 + 1) = 114;
strcpy(
(char *)v15,
"Change the offset between the player and the camera center. 0 = player will be placed in the center of the camera.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v11, &v14, (__m128)0x3F800000u);
if ( (v14 & 1) != 0 )
operator delete(v15);
if ( (v11 & 1) != 0 )
operator delete(v13);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v31);
sub_10028CBE0((float *)&v33, (float)(v31 * 0.5) + -80.0, (float)(v32 * 0.5) + 55.0);
v16 = 18;
strcpy(v17, "Offset X:");
sub_10028CBE0((float *)&v35, 0.0, 0.0);
sub_10028CCE0(&v34, &v33, &v35);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
28,
(__int64)&v16,
(float *)&v34,
0,
Int,
0.80000001,
-100.0,
100.0,
10,
0,
0,
28,
0,
2,
0);
if ( (v16 & 1) != 0 )
operator delete(*(void **)&v17[15]);
v18 = 18;
strcpy(v19, "Offset Y:");
sub_10028CBE0((float *)&v35, 0.0, -60.0);
sub_10028CCE0(&v34, &v33, &v35);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
29,
(__int64)&v18,
(float *)&v34,
0,
Int,
0.80000001,
-100.0,
100.0,
10,
0,
0,
29,
0,
2,
0);
if ( (v18 & 1) != 0 )
operator delete(*(void **)&v19[15]);
v30 = ((float (__fastcall *)(SetupGameplayOffsetPopup *, __int64))a1->getValue)(a1, 101);
LOBYTE(v26) = 12;
strcpy((char *)&v26 + 1, "X\nOnly");
sub_10028CBE0((float *)&v35, 105.0, -8.0);
sub_10028CCE0(&v34, &v33, &v35);
v4 = (int)v30;
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 1, (int)v30 == 1, 1, &v26, (__int64)&v34, 0, 0, 0);
if ( (v26 & 1) != 0 )
operator delete(v27);
LOBYTE(v28) = 12;
strcpy((char *)&v28 + 1, "Y\nOnly");
sub_10028CBE0((float *)&v35, 105.0, -68.0);
sub_10028CCE0(&v34, &v33, &v35);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 2, v4 == 2, 1, &v28, (__int64)&v34, 0, 0, 0);
if ( (v28 & 1) != 0 )
operator delete(v29);
LOBYTE(v20) = 18;
strcpy((char *)&v20 + 1, "Dont\nZoom");
sub_10028CBE0((float *)&v35, 180.0, -8.0);
sub_10028CCE0(&v34, &v33, &v35);
SetupTriggerPopup::createToggleValueControl((int)a1, 58, &v20, 1.0, (__int64)&v34, 0, 0, 0);
if ( (v20 & 1) != 0 )
operator delete(v21);
LOBYTE(v22) = 18;
strcpy((char *)&v22 + 1, "Dont\nZoom");
sub_10028CBE0((float *)&v35, 180.0, -68.0);
sub_10028CCE0(&v34, &v33, &v35);
SetupTriggerPopup::createToggleValueControl((int)a1, 59, &v22, 1.0, (__int64)&v34, 0, 0, 0);
if ( (v22 & 1) != 0 )
operator delete(v23);
v5 = sub_100092A60("Default", 90, 0, 0, 0.40000001);
v6 = CCMenuItemSpriteExtra::create(
v5,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupGameplayOffsetPopup::onDefaultValues);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v6);
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0(
(float *)&v35,
(float)((float)(a1->m_width * 0.5) + (float)(v31 * 0.5)) + -40.0,
(float)((float)(0.5 * a1->m_height) + (float)(v32 * 0.5)) + -25.0);
*(cocos2d::CCPoint *)&v37 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v34,
(const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v6->setPosition)(v6, &v34, v37);
SetupTriggerPopup::postSetup(a1);
return v36;
}
return result;
}