//
// SetupAdvFollowRetargetPopup::init from 0x1404082a0 to 0x1404088d6 (1590 bytes)
//
// 3 xrefs:
// > SetupAdvFollowRetargetPopup::create @ 0x14040825e
// > ??> @ 0x1406d89cc
// > ??> @ 0x1406d89d8
//
// 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 SetupAdvFollowRetargetPopup::init(
SetupAdvFollowRetargetPopup *a1,
AdvancedFollowEditObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
_QWORD *v5; // r9
_QWORD *v6; // rcx
const char *v7; // rdx
__int64 v8; // r8
double v9; // xmm0_8
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
char v12; // [rsp+80h] [rbp-88h]
__int64 v13; // [rsp+80h] [rbp-88h]
float v14; // [rsp+88h] [rbp-80h]
_QWORD v15[2]; // [rsp+90h] [rbp-78h] BYREF
__int128 *v16; // [rsp+A0h] [rbp-68h]
__int128 v17; // [rsp+A8h] [rbp-60h] BYREF
__int64 v18; // [rsp+B8h] [rbp-50h]
__int64 v19; // [rsp+C0h] [rbp-48h]
__int128 v20; // [rsp+C8h] [rbp-40h] BYREF
__int64 v21; // [rsp+D8h] [rbp-30h]
__int64 v22; // [rsp+E0h] [rbp-28h]
char v23; // [rsp+140h] [rbp+38h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 240.0, 1);
if ( result )
{
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
v17 = 0;
v18 = 2;
v19 = 15;
strcpy((char *)&v17, "OK");
SetupTriggerPopup::addCloseButton(a1, &v17);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v17 = 0;
v18 = 0;
v19 = 15;
*(_QWORD *)&v17 = sub_14003AA10(0x20u);
v18 = 27;
v19 = 31;
strcpy((char *)v17, "Re-Target AdvFollow Trigger");
SetupTriggerPopup::addTitle(a1, &v17);
v15[0] = &v17;
v17 = 0;
v18 = 0;
v19 = 15;
v5 = sub_14003AA10(0x120u);
*(_QWORD *)&v17 = v5;
v18 = 279;
v19 = 287;
v6 = v5;
v7 = "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. ";
v8 = 2;
do
{
*(_OWORD *)v6 = *(_OWORD *)v7;
*((_OWORD *)v6 + 1) = *((_OWORD *)v7 + 1);
*((_OWORD *)v6 + 2) = *((_OWORD *)v7 + 2);
*((_OWORD *)v6 + 3) = *((_OWORD *)v7 + 3);
*((_OWORD *)v6 + 4) = *((_OWORD *)v7 + 4);
*((_OWORD *)v6 + 5) = *((_OWORD *)v7 + 5);
*((_OWORD *)v6 + 6) = *((_OWORD *)v7 + 6);
v6 += 16;
*((_OWORD *)v6 - 1) = *((_OWORD *)v7 + 7);
v7 += 128;
--v8;
}
while ( v8 );
*(_OWORD *)v6 = *(_OWORD *)v7;
*((_DWORD *)v6 + 4) = *((_DWORD *)v7 + 4);
*((_WORD *)v6 + 10) = *((_WORD *)v7 + 10);
*((_BYTE *)v6 + 22) = v7[22];
*((_BYTE *)v5 + 279) = 0;
v20 = 0;
v21 = 4;
v22 = 15;
strcpy((char *)&v20, "Help");
v9 = SetupTriggerPopup::addHelpButton(a1, &v20, &v17);
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
cocos2d::CCPoint::CCPoint(*(float *)&v9, v14 * 0.5);
v15[1] = &v17;
HIWORD(v17) = 0;
v18 = 11;
v19 = 15;
qmemcpy(&v17, "Target GID", 10);
*(_DWORD *)((char *)&v17 + 10) = (unsigned __int8)aTargetGid[10];
cocos2d::CCPoint::CCPoint(1.1446081e24, -88.0);
cocos2d::CCPoint::operator+(&v23, v15);
v12 = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
51,
(unsigned int)&v17,
(unsigned int)v15,
1061997773,
1,
2,
6,
1,
0,
1065353216,
0,
0,
0,
2,
v12);
v16 = &v17;
HIWORD(v17) = 0;
v18 = 11;
v19 = 15;
qmemcpy(&v17, "Follow GID", 10);
*(_DWORD *)((char *)&v17 + 10) = (unsigned __int8)aFollowGid[10];
cocos2d::CCPoint::CCPoint(1.1433279e27, 88.0);
cocos2d::CCPoint::operator+(&v23, v15);
LOBYTE(v13) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
71,
(unsigned int)&v17,
(unsigned int)v15,
1061997773,
1,
2,
6,
1,
0,
1065353216,
0,
0,
0,
2,
v13);
v16 = &v20;
v20 = 0;
v21 = 2;
v22 = 15;
strcpy((char *)&v20, "P1");
cocos2d::CCPoint::CCPoint(0.0, 18.0);
cocos2d::CCPoint::operator+(&v23, v15);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
138,
(unsigned int)&v20,
(unsigned int)v15,
0,
0,
0,
1065353216);
v16 = &v20;
v20 = 0;
v21 = 2;
v22 = 15;
strcpy((char *)&v20, "P2");
cocos2d::CCPoint::CCPoint(0.0, 78.0);
cocos2d::CCPoint::operator+(&v23, v15);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
200,
(unsigned int)&v20,
(unsigned int)v15,
0,
0,
0,
1065353216);
v16 = &v20;
v20 = 0;
v21 = 1;
v22 = 15;
LOWORD(v20) = 67;
cocos2d::CCPoint::CCPoint(0.0, 138.0);
cocos2d::CCPoint::operator+(&v23, v15);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
201,
(unsigned int)&v20,
(unsigned int)v15,
0,
0,
0,
1065353216);
v16 = &v17;
v17 = 0;
v18 = 0;
v19 = 15;
*(_QWORD *)&v17 = sub_14003AA10(0x20u);
v18 = 17;
v19 = 31;
strcpy((char *)v17, "Target\nControl ID");
cocos2d::CCPoint::CCPoint(1.1446081e24, -120.0);
cocos2d::CCPoint::operator+(&v23, v15);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
535,
(unsigned int)&v17,
(unsigned int)v15,
0,
2,
0,
1065353216);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
return 1;
}
return result;
}