//
// UIObjectSettingsPopup::init from 0x5796a0 to 0x579ccc (1580 bytes)
//
// 1 xrefs:
// > UIObjectSettingsPopup::create @ 0x579d76
//
// 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 UIObjectSettingsPopup::init(UIObjectSettingsPopup *a1, UISettingsGameObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
unsigned int v5; // r11
int v6; // r10
bool v7; // r11
cocos2d::CCPoint v9; // [sp+4h] [bp-70h]
cocos2d::CCPoint v10; // [sp+4h] [bp-70h]
cocos2d::CCPoint v11; // [sp+4h] [bp-70h]
cocos2d::CCPoint v12; // [sp+4h] [bp-70h]
cocos2d::CCPoint v13; // [sp+4h] [bp-70h]
cocos2d::CCPoint v14; // [sp+4h] [bp-70h]
cocos2d::CCPoint v15; // [sp+4h] [bp-70h]
cocos2d::CCPoint v16; // [sp+4h] [bp-70h]
_BOOL4 v17; // [sp+30h] [bp-44h]
_BYTE v18[4]; // [sp+40h] [bp-34h] BYREF
cocos2d::CCSize v19; // [sp+44h] [bp-30h] BYREF
cocos2d::CCPoint v20; // [sp+4Ch] [bp-28h] BYREF
cocos2d::CCPoint v21; // [sp+54h] [bp-20h] BYREF
cocos2d::CCPoint v22; // [sp+5Ch] [bp-18h] BYREF
cocos2d::CCPoint v23; // [sp+64h] [bp-10h] BYREF
v17 = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( v17 )
{
SetupTriggerPopup::preSetup(a1);
sub_776584((int)&v23, "UI Object Settings");
SetupTriggerPopup::addTitle((int)a1);
sub_774008(&v23);
sub_776584((int)&v23, "OK");
SetupTriggerPopup::addCloseButton((unsigned int)a1, (ButtonSprite **)&v23);
sub_774008(&v23);
sub_776584((int)&v22, "Help");
sub_776584(
(int)&v23,
"Group ID specify the objects to use for the UI. This is permanent from the start and cannot be edited.\n"
"UI Target is a single object used as a reference for the camera center. Camera Guide is a recommended tool"
".\n"
"XRef and YRef are reference points for aligning the object.\n"
"Relative makes UI positions scale with aspect ratio.");
SetupTriggerPopup::addHelpButton((int)a1, (int)&v22, (int)&v23, 1065353216);
sub_774008(&v23);
sub_774008(&v22);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v19, v4);
cocos2d::CCPoint::CCPoint(&v20, v19.width * 0.5, v19.height * 0.5);
sub_776584((int)&v21, "Group ID:");
cocos2d::CCPoint::CCPoint(&v22, -70.0, 60.0);
cocos2d::CCPoint::operator+(&v23, &v20, &v22);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
51,
(int)&v21,
&v23,
(cocos2d::CCZone *)0x3F4CCCCD,
1,
Int,
10,
1,
nullptr,
9999.0,
0,
0,
0,
0,
0);
sub_774008(&v21);
sub_776584((int)&v21, "UI Target:");
cocos2d::CCPoint::CCPoint(&v22, 70.0, 60.0);
cocos2d::CCPoint::operator+(&v23, &v20, &v22);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
71,
(int)&v21,
&v23,
(cocos2d::CCZone *)0x3F4CCCCD,
1,
Int,
10,
1,
nullptr,
9999.0,
0,
0,
0,
0,
0);
sub_774008(&v21);
cocos2d::CCPoint::CCPoint(&v21, (float)(v19.width * 0.5) - 25.0, (float)(v19.height * 0.5) - 10.0);
v5 = (int)COERCE_FLOAT(((int (__fastcall *)(UIObjectSettingsPopup *, int))a1->getValue)(a1, 385));
v6 = (int)a1->getValue(a1, 386);
sub_776584((int)v18, "XRef:");
cocos2d::CCPoint::CCPoint(&v22, -125.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
SetupTriggerPopup::addInfoLabel(a1, (int)v18, COERCE_INT(0.5), &v23, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Auto");
cocos2d::CCPoint::CCPoint(&v22, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v9.x) = &v23;
LODWORD(v9.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 1, v5 <= 1, 1, (std::string)v18, v9, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Center");
cocos2d::CCPoint::CCPoint(&v22, -25.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v10.x) = &v23;
LODWORD(v10.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 2, v5 == 2, 1, (std::string)v18, v10, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Left");
cocos2d::CCPoint::CCPoint(&v22, 25.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v11.x) = &v23;
LODWORD(v11.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 3, v5 == 3, 1, (std::string)v18, v11, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Right");
cocos2d::CCPoint::CCPoint(&v22, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v12.x) = &v23;
LODWORD(v12.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 4, v5 == 4, 1, (std::string)v18, v12, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Relative");
cocos2d::CCPoint::CCPoint(&v22, 150.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
SetupTriggerPopup::createToggleValueControl(a1, 387, (int)v18, &v23, 1, 0, 0, 1.0);
sub_774008(v18);
v21.y = v21.y - 60.0;
sub_776584((int)v18, "YRef:");
cocos2d::CCPoint::CCPoint(&v22, -125.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
SetupTriggerPopup::addInfoLabel(a1, (int)v18, 1056964608, &v23, 0, 0);
sub_774008(v18);
if ( v6 == 5 )
v7 = v17;
else
v7 = v6 == 0;
sub_776584((int)v18, "Auto");
cocos2d::CCPoint::CCPoint(&v22, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v13.x) = &v23;
LODWORD(v13.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 5, v7, 1, (std::string)v18, v13, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Center");
cocos2d::CCPoint::CCPoint(&v22, -25.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v14.x) = &v23;
LODWORD(v14.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 6, v6 == 6, 1, (std::string)v18, v14, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Bottom");
cocos2d::CCPoint::CCPoint(&v22, 25.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v15.x) = &v23;
LODWORD(v15.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 7, v6 == 7, 1, (std::string)v18, v15, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Top");
cocos2d::CCPoint::CCPoint(&v22, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
LODWORD(v16.x) = &v23;
LODWORD(v16.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 8, v6 == 8, 1, (std::string)v18, v16, 0, 0);
sub_774008(v18);
sub_776584((int)v18, "Relative");
cocos2d::CCPoint::CCPoint(&v22, 150.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
SetupTriggerPopup::createToggleValueControl(a1, 388, (int)v18, &v23, 1, 0, 0, 1.0);
sub_774008(v18);
SetupTriggerPopup::postSetup(a1);
}
return v17;
}