//
// SetupMoveCommandPopup::init from 0x14038e4f0 to 0x14038f946 (5206 bytes)
//
// 2 xrefs:
// > SetupMoveCommandPopup::create @ 0x14038e4a5
// > ??> @ 0x140922f34
//
// 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:31:10 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupMoveCommandPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
_QWORD *v8; // r8
_OWORD *v9; // rcx
const char *v10; // rax
__int64 v11; // rdx
__int64 v12; // rax
struct cocos2d::CCArray *v13; // rbx
cocos2d::CCArray *GroupContainer; // rax
__int64 v15; // rax
struct cocos2d::CCArray *v16; // rbx
cocos2d::CCArray *v17; // rax
__int64 v18; // rax
struct cocos2d::CCArray *v19; // rbx
cocos2d::CCArray *v20; // rax
__int64 v21; // rax
struct cocos2d::CCArray *v22; // rbx
cocos2d::CCArray *v23; // rax
__int64 v24; // rax
int v25; // r8d
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
int v29; // r8d
__int64 v30; // rax
__int64 v31; // rax
int v32; // esi
__int64 v33; // rax
void *v34; // rcx
__int64 v35; // rax
void *v36; // rcx
__int64 v37; // rax
__int64 v38; // rax
__int64 v39; // rax
int v40; // r9d
__int64 v41; // rax
int v42; // r9d
int v43; // ebx
struct cocos2d::CCObject *v44; // rax
__int64 v45; // rdx
struct cocos2d::CCObject *v46; // rax
__int64 v47; // rdx
__int64 v48; // rax
__int64 v49; // rax
__int64 v50; // rax
__int64 v51; // rax
__int64 v52; // rax
__int64 v53; // rax
__int64 v54; // rax
int v55; // r8d
int v56; // r9d
__int64 v57; // rax
void *v58; // rcx
int v59; // eax
int Reserved; // [rsp+20h] [rbp-E0h]
int Reserveda; // [rsp+20h] [rbp-E0h]
__int128 *v62; // [rsp+80h] [rbp-80h] BYREF
__int128 v63; // [rsp+88h] [rbp-78h] BYREF
__int64 v64; // [rsp+98h] [rbp-68h]
__int64 v65; // [rsp+A0h] [rbp-60h]
_BYTE v66[8]; // [rsp+A8h] [rbp-58h] BYREF
void **v67; // [rsp+B0h] [rbp-50h] BYREF
__int128 *v68; // [rsp+B8h] [rbp-48h] BYREF
float v69; // [rsp+C0h] [rbp-40h] BYREF
float v70; // [rsp+C4h] [rbp-3Ch]
void *Block[2]; // [rsp+C8h] [rbp-38h] BYREF
__m128i si128; // [rsp+D8h] [rbp-28h]
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1134231552, 1, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v69);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v66, v69 * 0.5, v70 * 0.5);
v63 = 0;
*(_QWORD *)&v63 = sub_14003D460(0x20u);
v64 = 18;
v65 = 31;
strcpy((char *)v63, "Setup Move Command");
SetupTriggerPopup::addTitle(a1, &v63);
v63 = 0;
v64 = 2;
v65 = 15;
strcpy((char *)&v63, "OK");
SetupTriggerPopup::addCloseButton(a1, &v63);
SetupTriggerPopup::createMultiTriggerItemsCorner(a1);
v62 = &v63;
v63 = 0;
v64 = 0;
v65 = 0;
v8 = sub_14003D460(0x1B0u);
*(_QWORD *)&v63 = v8;
v64 = 417;
v65 = 431;
v9 = v8;
v10 = "Moves a group of objects to another position.\n"
"Easing changes the method used.\n"
"Target Mode moves the group to the position of another group.\n"
"Direction Mode moves the group in the direction of another group. Use Dynamic Mode to update l"
"ocations in real-time for the 2 previous options.\n"
"Small Step changes steps to their actual number, so 1 grid space is 30 instead of 10.";
v11 = 3;
do
{
*v9 = *(_OWORD *)v10;
v9[1] = *((_OWORD *)v10 + 1);
v9[2] = *((_OWORD *)v10 + 2);
v9[3] = *((_OWORD *)v10 + 3);
v9[4] = *((_OWORD *)v10 + 4);
v9[5] = *((_OWORD *)v10 + 5);
v9[6] = *((_OWORD *)v10 + 6);
v9 += 8;
*(v9 - 1) = *((_OWORD *)v10 + 7);
v10 += 128;
--v11;
}
while ( v11 );
*v9 = *(_OWORD *)v10;
v9[1] = *((_OWORD *)v10 + 1);
*((_BYTE *)v9 + 32) = v10[32];
*((_BYTE *)v8 + 417) = 0;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 4;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Help");
SetupTriggerPopup::addHelpButton(a1, Block, &v63);
v68 = &v63;
v64 = 7;
v65 = 15;
v63 = 0x3A582065766F4DuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, -100.0, 100.0);
cocos2d::CCPoint::operator+(v66, &v62, v12);
v13 = (struct cocos2d::CCArray *)((__int64 (__fastcall *)(_DWORD, int, unsigned int, unsigned int, int, char, int, int, char, int, int, _DWORD, int, int, _DWORD, char))SetupTriggerPopup::createValueControlAdvanced)(
a1,
28,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
28,
1,
0,
0);
GroupContainer = (cocos2d::CCArray *)SetupTriggerPopup::getGroupContainer(a1, 9001);
cocos2d::CCArray::addObjectsFromArray(GroupContainer, v13);
v67 = (void **)&v63;
v64 = 7;
v65 = 15;
v63 = 0x3A592065766F4DuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 105.0, 100.0);
cocos2d::CCPoint::operator+(v66, &v62, v15);
v16 = (struct cocos2d::CCArray *)((__int64 (__fastcall *)(_DWORD, int, unsigned int, unsigned int, int, char, int, int, char, int, int, _DWORD, int, int, _DWORD, char))SetupTriggerPopup::createValueControlAdvanced)(
a1,
29,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
29,
1,
0,
0);
v17 = (cocos2d::CCArray *)SetupTriggerPopup::getGroupContainer(a1, 9001);
cocos2d::CCArray::addObjectsFromArray(v17, v16);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Mod X:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -100.0, 100.0);
cocos2d::CCPoint::operator+(v66, &v62, v18);
v19 = (struct cocos2d::CCArray *)((__int64 (__fastcall *)(_DWORD, int, unsigned int, unsigned int, int, char, int, int, char, int, int, _DWORD, int, int, int, char))SetupTriggerPopup::createValueControlAdvanced)(
a1,
143,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
1,
10,
0,
-1082130432,
1065353216,
0,
143,
1,
3,
0);
v20 = (cocos2d::CCArray *)SetupTriggerPopup::getGroupContainer(a1, 9001);
cocos2d::CCArray::addObjectsFromArray(v20, v19);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Mod Y:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 105.0, 100.0);
cocos2d::CCPoint::operator+(v66, &v62, v21);
v22 = (struct cocos2d::CCArray *)((__int64 (__fastcall *)(_DWORD, int, unsigned int, unsigned int, int, char, int, int, char, int, int, _DWORD, int, int, int, char))SetupTriggerPopup::createValueControlAdvanced)(
a1,
144,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
1,
10,
0,
-1082130432,
1065353216,
0,
144,
1,
3,
0);
v23 = (cocos2d::CCArray *)SetupTriggerPopup::getGroupContainer(a1, 9001);
cocos2d::CCArray::addObjectsFromArray(v23, v22);
v67 = (void **)&v63;
v64 = 7;
v65 = 15;
v63 = 0x3A58206B636F4CuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -120.0, 71.0);
cocos2d::CCPoint::operator+(v66, &v62, v24);
SetupTriggerPopup::addInfoLabel(a1, (unsigned int)&v63, v25, (unsigned int)&v62, Reserved, 9001);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Player");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -180.0, 45.0);
cocos2d::CCPoint::operator+(v66, &v62, v26);
SetupTriggerPopup::createToggleValueControl(a1, 58, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 9001, 1065353216);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Camera");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -90.0, 45.0);
cocos2d::CCPoint::operator+(v66, &v62, v27);
SetupTriggerPopup::createToggleValueControl(a1, 141, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 9001, 1065353216);
v67 = (void **)&v63;
v64 = 7;
v65 = 15;
v63 = 0x3A59206B636F4CuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 105.0, 71.0);
cocos2d::CCPoint::operator+(v66, &v62, v28);
SetupTriggerPopup::addInfoLabel(a1, (unsigned int)&v63, v29, (unsigned int)&v62, Reserveda, 9001);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Player");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 35.0, 45.0);
cocos2d::CCPoint::operator+(v66, &v62, v30);
SetupTriggerPopup::createToggleValueControl(a1, 59, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 9001, 1065353216);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Camera");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 125.0, 45.0);
cocos2d::CCPoint::operator+(v66, &v62, v31);
SetupTriggerPopup::createToggleValueControl(a1, 142, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 9001, 1065353216);
*(_OWORD *)Block = 0;
si128 = 0;
Block[0] = sub_14003D460(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836610);
strcpy((char *)Block[0], "Center Group ID:");
v32 = a1 + 544;
if ( !a1 )
v32 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, -100.0, 90.0);
cocos2d::CCPoint::operator+(v66, &v62, v33);
IDNameInput::create(a1, v32, 1, 395, (__int64)Block, (__int64)&v62, 1061997773, 10, 9004, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v34 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v34 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v34 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v34);
}
*(_OWORD *)Block = 0;
si128 = 0;
Block[0] = sub_14003D460(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836640);
strcpy((char *)Block[0], "TargetPos Group ID:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 60.0, 90.0);
cocos2d::CCPoint::operator+(v66, &v62, v35);
IDNameInput::create(a1, v32, 1, 71, (__int64)Block, (__int64)&v62, 1061997773, 10, 9004, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v36 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v36 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v36 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v36);
}
v67 = Block;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 168.0, 105.0);
cocos2d::CCPoint::operator+(v66, &v62, v37);
SetupTriggerPopup::createToggleValueControl(
a1,
138,
(unsigned int)Block,
(unsigned int)&v62,
0,
0,
9004,
1065353216);
v67 = Block;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 168.0, 75.0);
cocos2d::CCPoint::operator+(v66, &v62, v38);
SetupTriggerPopup::createToggleValueControl(
a1,
200,
(unsigned int)Block,
(unsigned int)&v62,
0,
0,
9004,
1065353216);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "X Only");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -70.0, 50.0);
cocos2d::CCPoint::operator+(v66, &v62, v39);
SetupTriggerPopup::createCustomToggleValueControl(a1, 1, 0, v40, (__int64)&v63, (__int64)&v62, 0, 0, 9002);
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Y Only");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 30.0, 50.0);
cocos2d::CCPoint::operator+(v66, &v62, v41);
SetupTriggerPopup::createCustomToggleValueControl(a1, 2, 0, v42, (__int64)&v63, (__int64)&v62, 0, 0, 9002);
v43 = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 101);
v44 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 776), 1);
if ( v44 )
{
LOBYTE(v45) = v43 == 1;
CCMenuItemToggler::toggle((__int64)v44, v45);
}
v46 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 776), 2);
if ( v46 )
{
LOBYTE(v47) = v43 == 2;
CCMenuItemToggler::toggle((__int64)v46, v47);
}
v67 = (void **)&v63;
*((_QWORD *)&v63 + 1) = 58;
v64 = 9;
v65 = 15;
*(_QWORD *)&v63 = 0x65636E6174736944LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 0.0, 50.0);
cocos2d::CCPoint::operator+(v66, &v62, v48);
SetupTriggerPopup::createValueControlAdvanced(
a1,
396,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
2,
10,
0,
-1027080192,
1120403456,
0,
9003,
1,
0,
0);
v67 = (void **)&v63;
v64 = 11;
v65 = 15;
*(_QWORD *)&v63 = 0x4D0A746567726154LL;
*((_QWORD *)&v63 + 1) = 6644847;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -180.0, 5.0);
cocos2d::CCPoint::operator+(v66, &v62, v49);
SetupTriggerPopup::createToggleValueControl(a1, 100, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 0, 1065353216);
v67 = (void **)&v63;
v64 = 14;
v65 = 15;
strcpy((char *)&v63, "Direction\nMode");
HIBYTE(v63) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -90.0, 5.0);
cocos2d::CCPoint::operator+(v66, &v62, v50);
SetupTriggerPopup::createToggleValueControl(a1, 394, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 0, 1065353216);
v67 = (void **)&v63;
*((_QWORD *)&v63 + 1) = 28773;
v64 = 10;
v65 = 15;
*(_QWORD *)&v63 = 0x74530A6C6C616D53LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 35.0, 5.0);
cocos2d::CCPoint::operator+(v66, &v62, v51);
SetupTriggerPopup::createToggleValueControl(a1, 393, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 0, 1065353216);
v67 = (void **)&v63;
v64 = 12;
v65 = 15;
strcpy((char *)&v63, "Dynamic\nMode");
BYTE13(v63) = 0;
HIWORD(v63) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 125.0, 5.0);
cocos2d::CCPoint::operator+(v66, &v62, v52);
SetupTriggerPopup::createToggleValueControl(a1, 397, (unsigned int)&v63, (unsigned int)&v62, 0, 0, 0, 1065353216);
v67 = (void **)&v63;
*((_QWORD *)&v63 + 1) = 14949;
v64 = 10;
v65 = 15;
*(_QWORD *)&v63 = 0x6D69542065766F4DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, -100.0, -35.0);
cocos2d::CCPoint::operator+(v66, &v62, v53);
SetupTriggerPopup::createValueControlAdvanced(
a1,
10,
(unsigned int)&v63,
(unsigned int)&v62,
1061997773,
0,
1,
10,
0,
0,
1092616192,
0,
0,
0,
2,
0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 105.0, -30.0);
cocos2d::CCPoint::operator+(v66, &v62, v54);
SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v62, v55, v56, 0);
*(_OWORD *)Block = 0;
si128 = 0;
Block[0] = sub_14003D460(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836610);
strcpy((char *)Block[0], "Target Group ID:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 125.0, -120.0);
cocos2d::CCPoint::operator+(v66, &v62, v57);
IDNameInput::create(a1, v32, 1, 51, (__int64)Block, (__int64)&v62, 1061997773, 10, 0, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v58 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v58 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v58 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v58);
}
v67 = (void **)&v63;
v63 = 0;
v64 = 6;
v65 = 15;
strcpy((char *)&v63, "Silent");
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v68,
(float)((float)((float)(v69 * 0.5) - (float)(*(float *)(a1 + 732) * 0.5)) + 20.0) + 90.0,
(float)((float)((float)(v70 * 0.5) - (float)(*(float *)(a1 + 736) * 0.5)) + 20.0) + 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 544, (unsigned int)&v63, v59, 0, 0, 0, 1065353216);
*(_BYTE *)(a1 + 1000) = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 393) != 0.0;
SetupMoveCommandPopup::updateControlVisibility(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}