//
// SetupTransformPopup::init from 0x1405fb030 to 0x1405fbad7 (2727 bytes)
//
// 3 xrefs:
// > SetupTransformPopup::create @ 0x1405fafee
// > ??> @ 0x14092f72c
// > ??> @ 0x14092f738
//
// 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:35:09 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupTransformPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
_QWORD *v8; // r9
_QWORD *v9; // rcx
const char *v10; // rdx
__int64 v11; // r8
__int128 v12; // xmm0
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
int v19; // r8d
int v20; // r9d
__int64 v21; // rax
__int64 v22; // rdi
__int64 v23; // rax
void *v24; // rcx
__int64 v25; // rax
void *v26; // rcx
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // [rsp+80h] [rbp-88h]
__int64 v30; // [rsp+80h] [rbp-88h]
__int128 *v31; // [rsp+88h] [rbp-80h] BYREF
__int128 v32; // [rsp+90h] [rbp-78h] BYREF
__int64 v33; // [rsp+A0h] [rbp-68h]
__int64 v34; // [rsp+A8h] [rbp-60h]
_BYTE v35[8]; // [rsp+B0h] [rbp-58h] BYREF
__int128 *v36; // [rsp+B8h] [rbp-50h] BYREF
__int128 *v37; // [rsp+C0h] [rbp-48h] BYREF
float v38[2]; // [rsp+C8h] [rbp-40h] BYREF
void *Block[2]; // [rsp+D0h] [rbp-38h] BYREF
__m128i si128; // [rsp+E0h] [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, v38);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, v38[0] * 0.5, v38[1] * 0.5);
v32 = 0;
*(_QWORD *)&v32 = sub_14003D460(0x20u);
v33 = 19;
v34 = 31;
strcpy((char *)v32, "Setup Scale Command");
SetupTriggerPopup::addTitle(a1, &v32);
v32 = 0;
v33 = 2;
v34 = 15;
strcpy((char *)&v32, "OK");
SetupTriggerPopup::addCloseButton(a1, &v32);
SetupTriggerPopup::createMultiTriggerItemsCorner(a1);
v31 = &v32;
v32 = 0;
v33 = 0;
v34 = 0;
v8 = sub_14003D460(0x1E0u);
*(_QWORD *)&v32 = v8;
v33 = 477;
v34 = 479;
v9 = v8;
v10 = "Scales a specific Target Group ID.\n"
"Center Group ID specifies a target object to use as the center. If none is set, all objects use their "
"own center.\n"
"Duration specifies how long the scaling lasts.\n"
"Div by Value X/Y divides the current scale by the values.\n"
"Only Move makes the objects move as if they were scaled.\n"
"Relative Rotation rotates the X- and Y-axis too.\n"
"Relative Scale bases scaling on the reference object.";
v11 = 3;
do
{
*(_OWORD *)v9 = *(_OWORD *)v10;
*((_OWORD *)v9 + 1) = *((_OWORD *)v10 + 1);
*((_OWORD *)v9 + 2) = *((_OWORD *)v10 + 2);
*((_OWORD *)v9 + 3) = *((_OWORD *)v10 + 3);
*((_OWORD *)v9 + 4) = *((_OWORD *)v10 + 4);
*((_OWORD *)v9 + 5) = *((_OWORD *)v10 + 5);
*((_OWORD *)v9 + 6) = *((_OWORD *)v10 + 6);
v9 += 16;
*((_OWORD *)v9 - 1) = *((_OWORD *)v10 + 7);
v10 += 128;
--v11;
}
while ( v11 );
*(_OWORD *)v9 = *(_OWORD *)v10;
*((_OWORD *)v9 + 1) = *((_OWORD *)v10 + 1);
*((_OWORD *)v9 + 2) = *((_OWORD *)v10 + 2);
*((_OWORD *)v9 + 3) = *((_OWORD *)v10 + 3);
*((_OWORD *)v9 + 4) = *((_OWORD *)v10 + 4);
v9[10] = *((_QWORD *)v10 + 10);
*((_DWORD *)v9 + 22) = *((_DWORD *)v10 + 22);
*((_BYTE *)v9 + 92) = v10[92];
*((_BYTE *)v8 + 477) = 0;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 4;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Help");
SetupTriggerPopup::addHelpButton(a1, Block, &v32);
v37 = &v32;
v12 = 0;
v33 = 9;
v34 = 15;
*(_QWORD *)&v12 = 0x766F4D0A796C6E4FLL;
v32 = v12;
WORD4(v32) = 101;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v36,
110.0 - (float)(*(float *)(a1 + 732) * 0.5),
50.0 - (float)(*(float *)(a1 + 736) * 0.5));
cocos2d::CCPoint::operator+(v35, &v31, v13);
SetupTriggerPopup::createToggleValueControl(a1, 133, (unsigned int)&v32, (unsigned int)&v31, 0, 0, 0, 1065353216);
v36 = &v32;
HIWORD(v32) = 0;
v33 = 7;
v34 = 15;
qmemcpy(&v32, "ScaleX", 6);
*(_QWORD *)((char *)&v32 + 6) = (unsigned __int8)aScalex[6];
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, -100.0, 105.0);
cocos2d::CCPoint::operator+(v35, &v31, v14);
SetupTriggerPopup::createValueControlAdvanced(
a1,
150,
(unsigned int)&v32,
(unsigned int)&v31,
1063675494,
0,
1,
10,
0,
1056964608,
0x40000000,
0,
0,
0,
3,
0,
v31);
v36 = &v32;
HIWORD(v32) = 0;
v33 = 7;
v34 = 15;
qmemcpy(&v32, "ScaleY", 6);
*(_QWORD *)((char *)&v32 + 6) = (unsigned __int8)aScaley[6];
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 105.0, 105.0);
cocos2d::CCPoint::operator+(v35, &v31, v15);
LOBYTE(v29) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
151,
(unsigned int)&v32,
(unsigned int)&v31,
1063675494,
0,
1,
10,
0,
1056964608,
0x40000000,
0,
0,
0,
3,
v29);
v36 = &v32;
v33 = 14;
v34 = 15;
strcpy((char *)&v32, "Div by Value X");
HIBYTE(v32) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, -150.0, 50.0);
cocos2d::CCPoint::operator+(v35, &v31, v16);
SetupTriggerPopup::createToggleValueControl(a1, 153, (unsigned int)&v32, (unsigned int)&v31, 0, 0, 0, 1065353216);
v36 = &v32;
v33 = 14;
v34 = 15;
strcpy((char *)&v32, "Div by Value Y");
HIBYTE(v32) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 55.0, 50.0);
cocos2d::CCPoint::operator+(v35, &v31, v17);
SetupTriggerPopup::createToggleValueControl(a1, 154, (unsigned int)&v32, (unsigned int)&v31, 0, 0, 0, 1065353216);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, -100.0, 20.0);
cocos2d::CCPoint::operator+(v35, &v31, v18);
SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v31, v19, v20, 0);
v36 = &v32;
v33 = 9;
v34 = 15;
*(_QWORD *)&v32 = *(_QWORD *)"Duration:";
*((_QWORD *)&v32 + 1) = (unsigned __int8)aDuration[8];
BYTE9(v32) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, -100.0, -45.0);
cocos2d::CCPoint::operator+(v35, &v31, v21);
LOBYTE(v30) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
10,
(unsigned int)&v32,
(unsigned int)&v31,
1063675494,
0,
1,
10,
0,
0,
1092616192,
0,
0,
0,
2,
v30);
*(_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:");
v22 = a1 + 544;
if ( !a1 )
v22 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, 115.0, -20.0);
cocos2d::CCPoint::operator+(v35, &v31, v23);
IDNameInput::create(a1, v22, 1, 71, (__int64)Block, (const struct cocos2d::CCPoint *)&v31, 1063675494, 6, 0, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v24 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v24 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v24 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v24);
}
*(_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 *)&v36, 115.0, -90.0);
cocos2d::CCPoint::operator+(v35, &v31, v25);
IDNameInput::create(a1, v22, 1, 51, (__int64)Block, (const struct cocos2d::CCPoint *)&v31, 1063675494, 6, 0, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v26 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v26 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v26 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v26);
}
v36 = &v32;
v33 = 14;
v34 = 15;
strcpy((char *)&v32, "Relative\nScale");
HIBYTE(v32) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 50.0, 20.0 - (float)(*(float *)(a1 + 736) * 0.5));
cocos2d::CCPoint::operator+(v35, &v31, v27);
SetupTriggerPopup::createToggleValueControl(a1, 577, (unsigned int)&v32, (unsigned int)&v31, 0, 0, 0, 1065353216);
v36 = &v32;
v32 = 0;
v33 = 0;
v34 = 0;
*(_QWORD *)&v32 = sub_14003D460(0x20u);
v33 = 17;
v34 = 31;
strcpy((char *)v32, "Relative\nRotation");
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v37,
(float)(*(float *)(a1 + 732) * 0.5) - 85.0,
20.0 - (float)(*(float *)(a1 + 736) * 0.5));
cocos2d::CCPoint::operator+(v35, &v31, v28);
SetupTriggerPopup::createToggleValueControl(a1, 452, (unsigned int)&v32, (unsigned int)&v31, 0, 0, 0, 1065353216);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}