//
// UIObjectSettingsPopup::init from 0x10057ce60 to 0x10057d910 (2736 bytes)
//
// 1 xrefs:
// > UIObjectSettingsPopup::create @ 0x10057ce1b
//
// 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 __fastcall UIObjectSettingsPopup::init(UIObjectSettingsPopup *a1, UISettingsGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
int v4; // r12d
int v5; // r13d
__int128 v6; // [rsp+40h] [rbp-210h] BYREF
void *v7; // [rsp+50h] [rbp-200h]
char v8; // [rsp+58h] [rbp-1F8h] BYREF
char v9[15]; // [rsp+59h] [rbp-1F7h] BYREF
void *v10; // [rsp+68h] [rbp-1E8h]
char v11; // [rsp+70h] [rbp-1E0h] BYREF
char v12[15]; // [rsp+71h] [rbp-1DFh] BYREF
void *v13; // [rsp+80h] [rbp-1D0h]
__int128 v14; // [rsp+88h] [rbp-1C8h] BYREF
void *v15; // [rsp+98h] [rbp-1B8h]
char v16; // [rsp+A0h] [rbp-1B0h] BYREF
_BYTE v17[23]; // [rsp+A1h] [rbp-1AFh] BYREF
char v18[16]; // [rsp+B8h] [rbp-198h] BYREF
void *v19; // [rsp+C8h] [rbp-188h]
__int128 v20; // [rsp+D0h] [rbp-180h] BYREF
void *v21; // [rsp+E0h] [rbp-170h]
__int128 v22; // [rsp+E8h] [rbp-168h] BYREF
void *v23; // [rsp+F8h] [rbp-158h]
__int128 v24; // [rsp+100h] [rbp-150h] BYREF
void *v25; // [rsp+110h] [rbp-140h]
__int128 v26; // [rsp+118h] [rbp-138h] BYREF
void *v27; // [rsp+128h] [rbp-128h]
char v28[16]; // [rsp+130h] [rbp-120h] BYREF
void *v29; // [rsp+140h] [rbp-110h]
__int128 v30; // [rsp+148h] [rbp-108h] BYREF
void *v31; // [rsp+158h] [rbp-F8h]
__int128 v32; // [rsp+160h] [rbp-F0h] BYREF
void *v33; // [rsp+170h] [rbp-E0h]
unsigned __int64 v34; // [rsp+178h] [rbp-D8h] BYREF
void *v35[3]; // [rsp+180h] [rbp-D0h] BYREF
char v36; // [rsp+198h] [rbp-B8h] BYREF
_BYTE v37[23]; // [rsp+199h] [rbp-B7h] BYREF
__int128 v38; // [rsp+1B0h] [rbp-A0h] BYREF
void *v39; // [rsp+1C0h] [rbp-90h]
__int128 v40; // [rsp+1C8h] [rbp-88h] BYREF
void *v41; // [rsp+1D8h] [rbp-78h]
__int128 v42; // [rsp+1E0h] [rbp-70h] BYREF
void *v43; // [rsp+1F0h] [rbp-60h]
float v44; // [rsp+1FCh] [rbp-54h]
float v45; // [rsp+200h] [rbp-50h]
float v46; // [rsp+204h] [rbp-4Ch] BYREF
float v47; // [rsp+208h] [rbp-48h]
bool v48; // [rsp+20Fh] [rbp-41h]
unsigned __int64 v49; // [rsp+210h] [rbp-40h] BYREF
unsigned __int64 v50; // [rsp+218h] [rbp-38h] BYREF
unsigned __int64 v51[6]; // [rsp+220h] [rbp-30h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( result )
{
v48 = result;
SetupTriggerPopup::preSetup(a1);
strcpy((char *)v35, "$UI Object Settings");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)v35);
if ( ((__int64)v35[0] & 1) != 0 )
operator delete(v35[2]);
v8 = 4;
strcpy(v9, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v8);
if ( (v8 & 1) != 0 )
operator delete(v10);
v11 = 8;
strcpy(v12, "Help");
v15 = operator new(0x168u);
*(_QWORD *)&v14 = 361;
*((_QWORD *)&v14 + 1) = 355;
strcpy(
(char *)v15,
"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((__int64)a1, (__int64)&v11, &v14, (__m128)0x3F800000u);
if ( (v14 & 1) != 0 )
operator delete(v15);
if ( (v11 & 1) != 0 )
operator delete(v13);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v46);
sub_10028CBE0((float *)&v34, v46 * 0.5, v47 * 0.5);
v16 = 18;
strcpy(v17, "Group ID:");
sub_10028CBE0((float *)v51, -70.0, 60.0);
sub_10028CCE0((double *)&v49, &v34, v51);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
51,
(__int64)&v16,
(float *)&v49,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v16 & 1) != 0 )
operator delete(*(void **)&v17[15]);
v36 = 20;
strcpy(v37, "UI Target:");
sub_10028CBE0((float *)v51, 70.0, 60.0);
sub_10028CCE0((double *)&v49, &v34, v51);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
71,
(__int64)&v36,
(float *)&v49,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v36 & 1) != 0 )
operator delete(*(void **)&v37[15]);
sub_10028CBE0((float *)&v49, (float)(v46 * 0.5) + -25.0, (float)(0.5 * v47) + -10.0);
v44 = ((float (__fastcall *)(UIObjectSettingsPopup *, __int64))a1->getValue)(a1, 385);
v45 = ((float (__fastcall *)(UIObjectSettingsPopup *, __int64))a1->getValue)(a1, 386);
strcpy(v18, "\nXRef:");
sub_10028CBE0((float *)&v50, -125.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::addInfoLabel((__int64)a1, (__int64)v18, (__int64)v51, 0, 0, 0.5);
if ( (v18[0] & 1) != 0 )
operator delete(v19);
LOBYTE(v20) = 8;
strcpy((char *)&v20 + 1, "Auto");
sub_10028CBE0((float *)&v50, -75.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
v4 = (int)v44;
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)a1,
1,
(unsigned int)(int)v44 < 2,
1,
&v20,
(__int64)v51,
1,
0,
0);
if ( (v20 & 1) != 0 )
operator delete(v21);
LOBYTE(v38) = 12;
strcpy((char *)&v38 + 1, "Center");
sub_10028CBE0((float *)&v50, -25.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 2, v4 == 2, 1, &v38, (__int64)v51, 1, 0, 0);
if ( (v38 & 1) != 0 )
operator delete(v39);
LOBYTE(v22) = 8;
strcpy((char *)&v22 + 1, "Left");
sub_10028CBE0((float *)&v50, 25.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 3, v4 == 3, 1, &v22, (__int64)v51, 1, 0, 0);
if ( (v22 & 1) != 0 )
operator delete(v23);
strcpy((char *)&v24, "\nRight");
sub_10028CBE0((float *)&v50, 75.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 4, v4 == 4, 1, &v24, (__int64)v51, 1, 0, 0);
if ( (v24 & 1) != 0 )
operator delete(v25);
LOBYTE(v26) = 16;
strcpy((char *)&v26 + 1, "Relative");
sub_10028CBE0((float *)&v50, 150.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createToggleValueControl((int)a1, 387, &v26, 1.0, (__int64)v51, 1, 0, 0);
if ( (v26 & 1) != 0 )
operator delete(v27);
*((float *)&v49 + 1) = *((float *)&v49 + 1) + -60.0;
strcpy(v28, "\nYRef:");
sub_10028CBE0((float *)&v50, -125.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::addInfoLabel((__int64)a1, (__int64)v28, (__int64)v51, 0, 0, 0.5);
v5 = (int)v45;
if ( (v28[0] & 1) != 0 )
operator delete(v29);
LOBYTE(v30) = 8;
strcpy((char *)&v30 + 1, "Auto");
sub_10028CBE0((float *)&v50, -75.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)a1,
5,
v5 == 0 || v5 == 5,
1,
&v30,
(__int64)v51,
1,
0,
0);
if ( (v30 & 1) != 0 )
operator delete(v31);
LOBYTE(v40) = 12;
strcpy((char *)&v40 + 1, "Center");
sub_10028CBE0((float *)&v50, -25.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 6, v5 == 6, 1, &v40, (__int64)v51, 1, 0, 0);
if ( (v40 & 1) != 0 )
operator delete(v41);
LOBYTE(v42) = 12;
strcpy((char *)&v42 + 1, "Bottom");
sub_10028CBE0((float *)&v50, 25.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 7, v5 == 7, 1, &v42, (__int64)v51, 1, 0, 0);
if ( (v42 & 1) != 0 )
operator delete(v43);
LOBYTE(v6) = 6;
*(_DWORD *)((char *)&v6 + 1) = 7368532;
sub_10028CBE0((float *)&v50, 75.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createCustomToggleValueControl((__int64)a1, 8, v5 == 8, 1, &v6, (__int64)v51, 1, 0, 0);
if ( (v6 & 1) != 0 )
operator delete(v7);
LOBYTE(v32) = 16;
strcpy((char *)&v32 + 1, "Relative");
sub_10028CBE0((float *)&v50, 150.0, 0.0);
sub_10028CCE0((double *)v51, &v49, &v50);
SetupTriggerPopup::createToggleValueControl((int)a1, 388, &v32, 1.0, (__int64)v51, 1, 0, 0);
if ( (v32 & 1) != 0 )
operator delete(v33);
SetupTriggerPopup::postSetup(a1);
return v48;
}
return result;
}