//
// SetupRotateCommandPopup::init from 0x4e0cf0 to 0x4e1640 (2384 bytes)
//
// 1 xrefs:
// > SetupRotateCommandPopup::create @ 0x4e16d2
//
// 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 SetupRotateCommandPopup::init(SetupRotateCommandPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
cocos2d::CCPoint v5; // r1
ButtonSprite *v6; // r5
CCMenuItemSpriteExtra *v7; // r9
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v9; // r2
bool v10; // r3
char *v12; // [sp+4h] [bp-78h]
float v13; // [sp+10h] [bp-6Ch]
_BOOL4 v14; // [sp+34h] [bp-48h]
cocos2d::CCMenu *m_buttonMenu; // [sp+3Ch] [bp-40h]
cocos2d::CCSize v16; // [sp+44h] [bp-38h] BYREF
cocos2d::CCPoint v17; // [sp+4Ch] [bp-30h] BYREF
cocos2d::CCPoint v18; // [sp+54h] [bp-28h] BYREF
cocos2d::CCPoint v19; // [sp+5Ch] [bp-20h] BYREF
cocos2d::CCPoint v20; // [sp+64h] [bp-18h] BYREF
_DWORD v21[2]; // [sp+6Ch] [bp-10h] BYREF
v14 = SetupTriggerPopup::init(a1, a2, a3, 440.0, 310.0, 1);
if ( v14 )
{
SetupTriggerPopup::preSetup(a1);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v16, v4);
cocos2d::CCPoint::CCPoint(&v17, v16.width * 0.5, v16.height * 0.5);
sub_776584((int)v21, "Setup Rotate Command");
SetupTriggerPopup::addTitle(a1, (std::string)v21);
sub_774008(v21);
sub_776584((int)v21, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)v21);
sub_774008(v21);
sub_776584((int)&v20, "Help");
sub_776584(
(int)v21,
"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 locations in"
" real-time for the previous 2 options.\n"
"Use Move Time -1 for an infinite action.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v20, (std::string)v21, 1.0);
sub_774008(v21);
sub_774008(&v20);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
sub_776584((int)&v19, "Degrees:");
cocos2d::CCPoint::CCPoint(&v20, -100.0, 100.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
68,
(int)&v19,
(int)v21,
0.8,
0,
1,
10,
0,
(cocos2d::CCFloat *)0xC3B40000,
360.0,
0,
9001,
1,
2,
0);
sub_774008(&v19);
sub_776584((int)&v19, "x360:");
cocos2d::CCPoint::CCPoint(&v20, 105.0, 100.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
69,
(int)&v19,
(int)v21,
0.8,
0,
2,
10,
0,
(cocos2d::CCFloat *)0xC1A00000,
20.0,
0,
9001,
1,
0,
0);
sub_774008(&v19);
sub_776584((int)&v19, "Rot Target ID:");
cocos2d::CCPoint::CCPoint(&v20, -80.0, 90.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
401,
(int)&v19,
(int)v21,
0.8,
1,
2,
10,
1,
(cocos2d::CCFloat *)0xC2C80000,
100.0,
0,
9002,
0,
0,
0);
sub_774008(&v19);
sub_776584((int)&v19, "Rot Offset:");
cocos2d::CCPoint::CCPoint(&v20, 80.0, 90.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
402,
(int)&v19,
(int)v21,
0.8,
1,
1,
10,
1,
(cocos2d::CCFloat *)0xC3B40000,
360.0,
0,
9002,
0,
2,
0);
sub_774008(&v19);
sub_776584((int)&v19, "P1");
cocos2d::CCPoint::CCPoint(&v20, 170.0, 120.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 138, (int)&v19, (int)v21, 0, 0, 9002, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "P2");
cocos2d::CCPoint::CCPoint(&v20, 170.0, 90.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 200, (int)&v19, (int)v21, 0, 0, 9002, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "Aim\nMode");
cocos2d::CCPoint::CCPoint(&v20, -180.0, 48.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 100, (int)&v19, (int)v21, 0, 0, 0, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "Follow\nMode");
cocos2d::CCPoint::CCPoint(&v20, -80.0, 48.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 394, (int)&v19, (int)v21, 0, 0, 0, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "Dynamic\nMode");
cocos2d::CCPoint::CCPoint(&v20, 20.0, 48.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 397, (int)&v19, (int)v21, 0, 0, 0, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "Lock Obj\nRotation");
cocos2d::CCPoint::CCPoint(&v20, 120.0, 48.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 70, (int)&v19, (int)v21, 0, 0, 0, 1.0);
sub_774008(&v19);
sub_776584((int)&v19, "Move Time:");
cocos2d::CCPoint::CCPoint(&v20, -100.0, 0.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
10,
(int)&v19,
(int)v21,
0.8,
0,
1,
10,
0,
nullptr,
10.0,
0,
0,
0,
2,
0);
sub_774008(&v19);
cocos2d::CCPoint::CCPoint(&v20, 105.0, 5.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
LODWORD(v5.x) = v21;
v5.y = 0.8;
SetupTriggerPopup::createEasingControls(a1, v5, 0.0, 9003, (int)v12);
sub_776584((int)&v19, "Easing:");
cocos2d::CCPoint::CCPoint(&v20, 105.0, 0.0);
cocos2d::CCPoint::operator+(v21, &v17, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
403,
(int)&v19,
(int)v21,
0.8,
0,
2,
10,
0,
nullptr,
100.0,
0,
9004,
0,
2,
0);
sub_774008(&v19);
v6 = ButtonSprite::create(
(ButtonSprite *)"Inf",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_04.png",
(const char *)0x41F00000,
v13);
((void (__fastcall *)(ButtonSprite *, int))v6->setScale)(v6, 1056964608);
v21[0] = SetupRotateCommandPopup::onInfiniteDuration;
v21[1] = 0;
v7 = CCMenuItemSpriteExtra::create(
v6,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SetupRotateCommandPopup::onInfiniteDuration, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v7);
setPosition = v7->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v18, -10.0, 0.0);
cocos2d::CCPoint::operator+(&v19, &v17, &v18);
cocos2d::CCNode::convertToNodeSpace(&v20, m_buttonMenu, &v19);
setPosition(v7, &v20);
SetupTriggerPopup::addObjectToGroup(a1, v7, 9004);
SetupTriggerPopup::addObjectToPage(a1, v7, 0);
sub_776584((int)&v18, "Target Group ID:");
cocos2d::CCPoint::CCPoint(&v19, -80.0, -85.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
51,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
0,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "Center Group ID:");
cocos2d::CCPoint::CCPoint(&v19, 80.0, -85.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
71,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
0,
0,
0,
0,
0);
sub_774008(&v18);
cocos2d::CCPoint::CCPoint(&v20, v16.width * 0.5, v16.height * 0.5);
cocos2d::CCPoint::operator=((PlayerObject *)&v17, COERCE_FLOAT(&v20), v9, v10);
sub_776584((int)&v18, "MinX ID:");
cocos2d::CCPoint::CCPoint(&v19, -80.0, 40.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
516,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
1,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "MaxX ID:");
cocos2d::CCPoint::CCPoint(&v19, 80.0, 40.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
518,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
1,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "MinY ID:");
cocos2d::CCPoint::CCPoint(&v19, -80.0, -40.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
517,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
1,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "MaxY ID:");
cocos2d::CCPoint::CCPoint(&v19, 80.0, -40.0);
cocos2d::CCPoint::operator+(&v20, &v17, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
519,
(int)&v18,
(int)&v20,
0.8,
1,
2,
10,
1,
nullptr,
10.0,
1,
0,
0,
0,
0);
sub_774008(&v18);
SetupTriggerPopup::createPageButtons(a1, (float)(a1->m_width * 0.5) + 15.0, 1);
SetupTriggerPopup::goToPage(a1, 0, 0);
SetupRotateCommandPopup::updateControlVisibility(a1);
SetupTriggerPopup::postSetup(a1);
}
return v14;
}