//
// SetupRotatePopup::init from 0x4f8db4 to 0x4f9074 (704 bytes)
//
// 1 xrefs:
// > SetupRotatePopup::create @ 0x4f9232
//
// 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 SetupRotatePopup::init(SetupRotatePopup *a1, EnhancedGameObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
float v5; // s15
float v6; // r0
float v7; // s16
bool v8; // r11
bool v9; // r11
_BOOL4 v10; // r2
cocos2d::CCPoint v12; // [sp+4h] [bp-68h]
cocos2d::CCPoint v13; // [sp+4h] [bp-68h]
cocos2d::CCPoint v14; // [sp+4h] [bp-68h]
_BOOL4 v15; // [sp+30h] [bp-3Ch]
_BYTE v16[4]; // [sp+40h] [bp-2Ch] BYREF
cocos2d::CCSize v17; // [sp+44h] [bp-28h] BYREF
cocos2d::CCPoint v18; // [sp+4Ch] [bp-20h] BYREF
cocos2d::CCPoint v19; // [sp+54h] [bp-18h] BYREF
_BYTE v20[8]; // [sp+5Ch] [bp-10h] BYREF
v15 = SetupTriggerPopup::init(a1, (EffectGameObject *)a2, a3, 300.0, 240.0, 1);
if ( v15 )
{
SetupTriggerPopup::preSetup(a1);
sub_776584((int)v20, "Edit Rotate Action");
SetupTriggerPopup::addTitle(a1, (std::string)v20);
sub_774008(v20);
sub_776584((int)v20, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)v20);
sub_774008(v20);
sub_776584((int)&v19, "Help");
sub_776584(
(int)v20,
"Default uses the default rotation values.\n"
"Custom lets you specify degrees per second.\n"
"Disable stops rotation completely.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v19, (std::string)v20, 1.0);
sub_774008(v20);
sub_774008(&v19);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v17, v4);
cocos2d::CCPoint::CCPoint(&v18, v17.width * 0.5, (float)(v17.height * 0.5) + 50.0);
v5 = COERCE_FLOAT(((int (__fastcall *)(SetupRotatePopup *, int))a1->getValue)(a1, 98));
v6 = COERCE_FLOAT(((int (__fastcall *)(SetupRotatePopup *, int))a1->getValue)(a1, 97));
v7 = v6;
v8 = v5 == 0.0 && v6 == 0.0;
sub_776584((int)v16, "Default");
cocos2d::CCPoint::CCPoint(&v19, -70.0, 0.0);
cocos2d::CCPoint::operator+(v20, &v18, &v19);
LODWORD(v12.x) = v20;
LODWORD(v12.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 0, v8, 1, (std::string)v16, v12, 0, 0);
sub_774008(v16);
v9 = v5 == 0.0 && v7 != 0.0;
sub_776584((int)v16, "Custom");
cocos2d::CCPoint::CCPoint(&v19, 0.0, 0.0);
cocos2d::CCPoint::operator+(v20, &v18, &v19);
LODWORD(v13.x) = v20;
LODWORD(v13.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 2, v9, 1, (std::string)v16, v13, 0, 0);
sub_774008(v16);
sub_776584((int)v16, "Disable");
cocos2d::CCPoint::CCPoint(&v19, 70.0, 0.0);
cocos2d::CCPoint::operator+(v20, &v18, &v19);
LODWORD(v14.x) = v20;
LODWORD(v14.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 1, v5 != 0.0, 1, (std::string)v16, v14, 0, 0);
sub_774008(v16);
sub_776584((int)v16, "Degrees/s:");
cocos2d::CCPoint::CCPoint(&v19, 0.0, -60.0);
cocos2d::CCPoint::operator+(v20, &v18, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
97,
(int)v16,
(int)v20,
0.8,
0,
2,
4,
0,
(cocos2d::CCFloat *)0xC3B40000,
360.0,
0,
2,
0,
3,
0);
sub_774008(v16);
v10 = v5 == 0.0 && v7 != 0.0;
a1->toggleGroup(a1, 2, v10);
SetupTriggerPopup::postSetup(a1);
}
return v15;
}