//
// SetupRotateCommandPopup::init from 0x1403adee0 to 0x1403af18f (4783 bytes)
//
// 3 xrefs:
// > SetupRotateCommandPopup::create @ 0x1403ade9e
// > ??> @ 0x140923b34
// > ??> @ 0x140923b40
//
// 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:22 +0000
//
// Hidden C++ exception states: #wind=5
char __fastcall SetupRotateCommandPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
_BYTE *v8; // rax
_BYTE *v9; // rcx
const char *v10; // rdx
__int64 v11; // r8
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
void *v15; // rcx
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax
int v25; // r8d
int v26; // r9d
__int64 v27; // rax
cocos2d::CCObject *v28; // rbx
struct cocos2d::CCObject *v29; // rdi
__int64 v30; // rax
__int64 v31; // rbx
__int64 v32; // rax
cocos2d::CCArray *GroupContainer; // rax
cocos2d::CCArray *PageContainer; // rax
__int64 v35; // rax
void *v36; // rcx
__int64 v37; // rax
void *v38; // rcx
__int64 v39; // rax
__int64 v40; // rax
void *v41; // rcx
__int64 v42; // rax
void *v43; // rcx
__int64 v44; // rax
void *v45; // rcx
__int64 v46; // rax
void *v47; // rcx
void **v48; // [rsp+80h] [rbp-80h] BYREF
_BYTE v49[8]; // [rsp+88h] [rbp-78h] BYREF
void **v50; // [rsp+90h] [rbp-70h] BYREF
__int128 *v51; // [rsp+98h] [rbp-68h] BYREF
__int128 v52; // [rsp+A0h] [rbp-60h] BYREF
__int64 v53; // [rsp+B0h] [rbp-50h]
__int64 v54; // [rsp+B8h] [rbp-48h]
float v55; // [rsp+C0h] [rbp-40h] BYREF
float v56; // [rsp+C4h] [rbp-3Ch]
void *Block[2]; // [rsp+C8h] [rbp-38h] BYREF
__int64 v58; // [rsp+D8h] [rbp-28h]
unsigned __int64 v59; // [rsp+E0h] [rbp-20h]
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, &v55);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, v55 * 0.5, v56 * 0.5);
*(_OWORD *)Block = 0;
v58 = 0;
v59 = 0;
Block[0] = sub_14003D460(0x20u);
v58 = 20;
v59 = 31;
strcpy((char *)Block[0], "Setup Rotate Command");
SetupTriggerPopup::addTitle(a1, Block);
*(_OWORD *)Block = 0;
v58 = 2;
v59 = 15;
strcpy((char *)Block, "OK");
SetupTriggerPopup::addCloseButton(a1, Block);
v48 = Block;
*(_OWORD *)Block = 0;
v58 = 0;
v59 = 0;
v8 = sub_14003D460(0x1D0u);
Block[0] = v8;
v58 = 455;
v59 = 463;
v9 = v8;
v10 = "Rotates a group of objects a given amount of degrees.\n"
"Target Group ID is the group of objects being rotated.\n"
"Center Group ID defines the center to rotate around.\n"
"Aim Mode rotates the objects to face a given target object.\n"
"Follow Mode follows the rotation of a given target object. Use Dynamic Mode to update location"
"s in real-time for the previous 2 options.\n"
"Use Move Time -1 for an infinite action.";
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 += 128;
*((_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);
*((_DWORD *)v9 + 16) = *((_DWORD *)v10 + 16);
*((_WORD *)v9 + 34) = *((_WORD *)v10 + 34);
v9[70] = v10[70];
v8[455] = 0;
v52 = 0;
v53 = 4;
v54 = 15;
strcpy((char *)&v52, "Help");
SetupTriggerPopup::addHelpButton(a1, &v52, Block);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
v51 = &v52;
v53 = 8;
v54 = 15;
v52 = 0x3A73656572676544uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -100.0, 100.0);
cocos2d::CCPoint::operator+(v49, &v48, v12);
SetupTriggerPopup::createValueControlAdvanced(
a1,
68,
(unsigned int)&v52,
(unsigned int)&v48,
1061997773,
0,
1,
10,
0,
-1011613696,
1135869952,
0,
9001,
1,
2,
0);
v50 = Block;
*(_OWORD *)Block = 0;
v58 = 5;
v59 = 15;
strcpy((char *)Block, "x360:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 105.0, 100.0);
cocos2d::CCPoint::operator+(v49, &v48, v13);
SetupTriggerPopup::createValueControlAdvanced(
a1,
69,
(unsigned int)Block,
(unsigned int)&v48,
1061997773,
0,
2,
10,
0,
-1046478848,
1101004800,
0,
9001,
1,
0,
0);
v58 = 14;
v59 = 15;
strcpy((char *)Block, "Rot Target ID:");
HIBYTE(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -80.0, 90.0);
cocos2d::CCPoint::operator+(v49, &v48, v14);
IDNameInput::create(a1, a1 + 544, 1, 401, (__int64)Block, (__int64)&v48, 1061997773, 6, 9002, 0, 0);
if ( v59 > 0xF )
{
v15 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
v50 = Block;
v58 = 11;
v59 = 15;
Block[0] = (void *)0x7366664F20746F52LL;
Block[1] = (void *)3830885;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 80.0, 90.0);
cocos2d::CCPoint::operator+(v49, &v48, v16);
SetupTriggerPopup::createValueControlAdvanced(
a1,
402,
(unsigned int)Block,
(unsigned int)&v48,
1061997773,
1,
1,
10,
1,
-1011613696,
1135869952,
0,
9002,
0,
2,
0);
v50 = (void **)&v52;
v52 = 0;
v53 = 2;
v54 = 15;
strcpy((char *)&v52, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 170.0, 120.0);
cocos2d::CCPoint::operator+(v49, &v48, v17);
SetupTriggerPopup::createToggleValueControl(a1, 138, (unsigned int)&v52, (unsigned int)&v48, 0, 0, 9002, 1065353216);
v50 = (void **)&v52;
v52 = 0;
v53 = 2;
v54 = 15;
strcpy((char *)&v52, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 170.0, 90.0);
cocos2d::CCPoint::operator+(v49, &v48, v18);
SetupTriggerPopup::createToggleValueControl(a1, 200, (unsigned int)&v52, (unsigned int)&v48, 0, 0, 9002, 1065353216);
v50 = (void **)&v52;
v53 = 8;
v54 = 15;
v52 = 0x65646F4D0A6D6941uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, -180.0, 48.0);
cocos2d::CCPoint::operator+(v49, &v48, v19);
SetupTriggerPopup::createToggleValueControl(a1, 100, (unsigned int)&v52, (unsigned int)&v48, 0, 0, 0, 1065353216);
v50 = Block;
v58 = 11;
v59 = 15;
Block[0] = (void *)0x4D0A776F6C6C6F46LL;
Block[1] = (void *)6644847;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, -80.0, 48.0);
cocos2d::CCPoint::operator+(v49, &v48, v20);
SetupTriggerPopup::createToggleValueControl(a1, 394, (unsigned int)Block, (unsigned int)&v48, 0, 0, 0, 1065353216);
v50 = Block;
v58 = 12;
v59 = 15;
strcpy((char *)Block, "Dynamic\nMode");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 20.0, 48.0);
cocos2d::CCPoint::operator+(v49, &v48, v21);
SetupTriggerPopup::createToggleValueControl(a1, 397, (unsigned int)Block, (unsigned int)&v48, 0, 0, 0, 1065353216);
v50 = Block;
*(_OWORD *)Block = 0;
v58 = 0;
v59 = 0;
Block[0] = sub_14003D460(0x20u);
v58 = 17;
v59 = 31;
strcpy((char *)Block[0], "Lock Obj\nRotation");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 120.0, 48.0);
cocos2d::CCPoint::operator+(v49, &v48, v22);
SetupTriggerPopup::createToggleValueControl(a1, 70, (unsigned int)Block, (unsigned int)&v48, 0, 0, 0, 1065353216);
v50 = Block;
Block[1] = (void *)14949;
v58 = 10;
v59 = 15;
Block[0] = (void *)0x6D69542065766F4DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, -100.0, 0.0);
cocos2d::CCPoint::operator+(v49, &v48, v23);
SetupTriggerPopup::createValueControlAdvanced(
a1,
10,
(unsigned int)Block,
(unsigned int)&v48,
1061997773,
0,
1,
10,
0,
0,
1092616192,
0,
0,
0,
2,
0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 105.0, 5.0);
cocos2d::CCPoint::operator+(v49, &v48, v24);
SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v48, v25, v26, 9003);
v50 = Block;
Block[1] = nullptr;
v58 = 7;
v59 = 15;
Block[0] = (void *)0x3A676E69736145LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 105.0, 0.0);
cocos2d::CCPoint::operator+(v49, &v48, v27);
SetupTriggerPopup::createValueControlAdvanced(
a1,
403,
(unsigned int)Block,
(unsigned int)&v48,
1061997773,
0,
2,
10,
0,
0,
1120403456,
0,
9004,
0,
2,
0);
v50 = (void **)operator new(0x2C8u);
v28 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v50);
if ( v28 )
{
if ( ButtonSprite::init_1(
(__int64)v28,
(__int64)&unk_14077FE68,
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_04.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v28);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v28 + 8LL))(v28, 1);
v28 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v28 + 160LL))(v28);
v29 = CCMenuItemSpriteExtra::create((int)v28, 0, a1, (__int64)SetupRotateCommandPopup::onInfiniteDuration);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v29);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -10.0, 0.0);
cocos2d::CCPoint::operator+(v49, &v48, v30);
v31 = *(_QWORD *)v29;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v51, &v48);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v31 + 184))(v29, v32);
GroupContainer = (cocos2d::CCArray *)SetupTriggerPopup::getGroupContainer(a1, 9004);
cocos2d::CCArray::addObject(GroupContainer, v29);
PageContainer = (cocos2d::CCArray *)SetupTriggerPopup::getPageContainer(a1, 0);
cocos2d::CCArray::addObject(PageContainer, v29);
*(_OWORD *)Block = 0;
v58 = 0;
v59 = 0;
Block[0] = sub_14003D460(0x20u);
v58 = 16;
v59 = 31;
strcpy((char *)Block[0], "Target Group ID:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -80.0, -85.0);
cocos2d::CCPoint::operator+(v49, &v48, v35);
IDNameInput::create(a1, a1 + 544, 1, 51, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 0, 0);
if ( v59 > 0xF )
{
v36 = Block[0];
if ( v59 + 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);
}
*(_OWORD *)Block = 0;
v58 = 0;
v59 = 0;
Block[0] = sub_14003D460(0x20u);
v58 = 16;
v59 = 31;
strcpy((char *)Block[0], "Center Group ID:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 80.0, -85.0);
cocos2d::CCPoint::operator+(v49, &v48, v37);
IDNameInput::create(a1, a1 + 544, 1, 71, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 0, 0);
if ( v59 > 0xF )
{
v38 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v38 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v38 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v38);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, v55 * 0.5, v56 * 0.5);
cocos2d::CCPoint::operator=(v49, v39);
Block[1] = nullptr;
v58 = 8;
v59 = 15;
Block[0] = (void *)0x3A444920586E694DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -80.0, 40.0);
cocos2d::CCPoint::operator+(v49, &v48, v40);
IDNameInput::create(a1, a1 + 544, 1, 516, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 1, 0);
if ( v59 > 0xF )
{
v41 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v41 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v41 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v41);
}
Block[1] = nullptr;
v58 = 8;
v59 = 15;
Block[0] = (void *)0x3A4449205878614DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 80.0, 40.0);
cocos2d::CCPoint::operator+(v49, &v48, v42);
IDNameInput::create(a1, a1 + 544, 1, 518, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 1, 0);
if ( v59 > 0xF )
{
v43 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v43 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v43 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v43);
}
Block[1] = nullptr;
v58 = 8;
v59 = 15;
Block[0] = (void *)0x3A444920596E694DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -80.0, -40.0);
cocos2d::CCPoint::operator+(v49, &v48, v44);
IDNameInput::create(a1, a1 + 544, 1, 517, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 1, 0);
if ( v59 > 0xF )
{
v45 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v45 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v45 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v45);
}
Block[1] = nullptr;
v58 = 8;
v59 = 15;
Block[0] = (void *)0x3A4449205978614DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 80.0, -40.0);
cocos2d::CCPoint::operator+(v49, &v48, v46);
IDNameInput::create(a1, a1 + 544, 1, 519, (__int64)Block, (__int64)&v48, 1061997773, 6, 0, 1, 0);
if ( v59 > 0xF )
{
v47 = Block[0];
if ( v59 + 1 >= 0x1000 )
{
v47 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v47 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v47);
}
SetupTriggerPopup::createPageButtons(a1);
SetupTriggerPopup::goToPage(a1, 0, 0);
SetupRotateCommandPopup::updateControlVisibility(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}