//
// SetupAdvFollowRetargetPopup::init from 0x10030b800 to 0x10030bd74 (1396 bytes)
//
// 1 xrefs:
// > SetupAdvFollowRetargetPopup::create @ 0x10030b7bb
//
// 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 SetupAdvFollowRetargetPopup::init(
SetupAdvFollowRetargetPopup *a1,
AdvancedFollowEditObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
bool v4; // r15
__int128 v5; // [rsp+38h] [rbp-128h] BYREF
void *v6; // [rsp+48h] [rbp-118h]
char v7; // [rsp+50h] [rbp-110h] BYREF
char v8[15]; // [rsp+51h] [rbp-10Fh] BYREF
void *__p; // [rsp+60h] [rbp-100h]
_QWORD v10[2]; // [rsp+68h] [rbp-F8h] BYREF
void *v11; // [rsp+78h] [rbp-E8h]
char v12; // [rsp+80h] [rbp-E0h] BYREF
char v13[15]; // [rsp+81h] [rbp-DFh] BYREF
void *v14; // [rsp+90h] [rbp-D0h]
__int128 v15; // [rsp+98h] [rbp-C8h] BYREF
void *v16; // [rsp+A8h] [rbp-B8h]
__int128 v17; // [rsp+B0h] [rbp-B0h] BYREF
void *v18; // [rsp+C0h] [rbp-A0h]
__int128 v19; // [rsp+C8h] [rbp-98h] BYREF
void *v20; // [rsp+D8h] [rbp-88h]
_BYTE v21[24]; // [rsp+E0h] [rbp-80h] BYREF
float v22[2]; // [rsp+F8h] [rbp-68h] BYREF
char v23; // [rsp+100h] [rbp-60h] BYREF
_BYTE v24[23]; // [rsp+101h] [rbp-5Fh] BYREF
char v25; // [rsp+118h] [rbp-48h] BYREF
_BYTE v26[23]; // [rsp+119h] [rbp-47h] BYREF
unsigned __int64 v27; // [rsp+130h] [rbp-30h] BYREF
double v28; // [rsp+138h] [rbp-28h] BYREF
unsigned __int64 v29[4]; // [rsp+140h] [rbp-20h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 240.0, 1);
if ( result )
{
v4 = result;
SetupTriggerPopup::preSetup(a1);
v7 = 4;
strcpy(v8, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v7);
if ( (v7 & 1) != 0 )
operator delete(__p);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v11 = operator new(0x20u);
v10[0] = 33;
v10[1] = 27;
strcpy((char *)v11, "Re-Target AdvFollow Trigger");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)v10);
if ( (v10[0] & 1) != 0 )
operator delete(v11);
v12 = 8;
strcpy(v13, "Help");
v16 = operator new(0x118u);
*(_QWORD *)&v15 = 281;
*((_QWORD *)&v15 + 1) = 279;
strcpy(
(char *)v16,
"Lets you change the target of an active Advanced Follow trigger.\n"
"Target GID is the objects that follow Follow GID.\n"
"You can also follow the player using P1 and P2 or the center of the screen using C.\n"
"View the editor guide for more details. ");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v12, &v15, (__m128)0x3F800000u);
if ( (v15 & 1) != 0 )
operator delete(v16);
if ( (v12 & 1) != 0 )
operator delete(v14);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v22);
sub_10028CBE0((float *)&v27, v22[0] * 0.5, (float)(0.5 * v22[1]) + 30.0);
v23 = 22;
strcpy(v24, "Target GID:");
sub_10028CBE0((float *)v29, -88.0, 0.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
51,
(__int64)&v23,
(float *)&v28,
1,
Int,
0.80000001,
0.0,
1.0,
6,
1,
0,
0,
0,
2,
0);
if ( (v23 & 1) != 0 )
operator delete(*(void **)&v24[15]);
v25 = 22;
strcpy(v26, "Follow GID:");
sub_10028CBE0((float *)v29, 88.0, 0.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
71,
(__int64)&v25,
(float *)&v28,
1,
Int,
0.80000001,
0.0,
1.0,
6,
1,
0,
0,
0,
2,
0);
if ( (v25 & 1) != 0 )
operator delete(*(void **)&v26[15]);
LOBYTE(v17) = 4;
strcpy((char *)&v17 + 1, "P1");
sub_10028CBE0((float *)v29, 18.0, -56.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createToggleValueControl((int)a1, 138, &v17, 1.0, (__int64)&v28, 0, 0, 0);
if ( (v17 & 1) != 0 )
operator delete(v18);
LOBYTE(v19) = 4;
strcpy((char *)&v19 + 1, "P2");
sub_10028CBE0((float *)v29, 78.0, -56.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createToggleValueControl((int)a1, 200, &v19, 1.0, (__int64)&v28, 0, 0, 0);
if ( (v19 & 1) != 0 )
operator delete(v20);
LOWORD(v5) = 17154;
BYTE2(v5) = 0;
sub_10028CBE0((float *)v29, 138.0, -56.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createToggleValueControl((int)a1, 201, &v5, 1.0, (__int64)&v28, 0, 0, 0);
if ( (v5 & 1) != 0 )
operator delete(v6);
strcpy(v21, "\"Target\nControl ID");
sub_10028CBE0((float *)v29, -120.0, -56.0);
sub_10028CCE0(&v28, &v27, v29);
SetupTriggerPopup::createToggleValueControl((int)a1, 535, (__int128 *)v21, 1.0, (__int64)&v28, 0, 2, 0);
if ( (v21[0] & 1) != 0 )
operator delete(*(void **)&v21[16]);
SetupTriggerPopup::postSetup(a1);
return v4;
}
return result;
}