//
// SetupPersistentItemTriggerPopup::init from 0x100583510 to 0x1005839ce (1214 bytes)
//
// 1 xrefs:
// > SetupPersistentItemTriggerPopup::create @ 0x1005834ce
//
// 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 SetupPersistentItemTriggerPopup::init(
SetupPersistentItemTriggerPopup *a1,
ItemTriggerGameObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
bool v4; // r15
char v5; // [rsp+38h] [rbp-118h] BYREF
char v6[15]; // [rsp+39h] [rbp-117h] BYREF
void *v7; // [rsp+48h] [rbp-108h]
char v8; // [rsp+50h] [rbp-100h] BYREF
char v9[15]; // [rsp+51h] [rbp-FFh] BYREF
void *v10; // [rsp+60h] [rbp-F0h]
__int128 v11; // [rsp+68h] [rbp-E8h] BYREF
void *v12; // [rsp+78h] [rbp-D8h]
__int128 v13; // [rsp+80h] [rbp-D0h] BYREF
void *v14; // [rsp+90h] [rbp-C0h]
__int128 v15; // [rsp+98h] [rbp-B8h] BYREF
void *v16; // [rsp+A8h] [rbp-A8h]
__int128 v17; // [rsp+B0h] [rbp-A0h] BYREF
void *v18; // [rsp+C0h] [rbp-90h]
unsigned __int64 v19; // [rsp+C8h] [rbp-88h] BYREF
_BYTE v20[24]; // [rsp+D0h] [rbp-80h] BYREF
char v21; // [rsp+E8h] [rbp-68h] BYREF
char v22[15]; // [rsp+E9h] [rbp-67h] BYREF
void *v23; // [rsp+F8h] [rbp-58h]
__int128 v24; // [rsp+100h] [rbp-50h] BYREF
void *v25; // [rsp+110h] [rbp-40h]
float v26; // [rsp+118h] [rbp-38h] BYREF
float v27; // [rsp+11Ch] [rbp-34h]
unsigned __int64 v28; // [rsp+120h] [rbp-30h] BYREF
unsigned __int64 v29; // [rsp+128h] [rbp-28h] BYREF
unsigned __int64 v30[4]; // [rsp+130h] [rbp-20h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 300.0, 230.0, 1);
if ( result )
{
v4 = result;
SetupTriggerPopup::preSetup(a1);
strcpy(v20, "*Persistent Item Setup");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)v20);
if ( (v20[0] & 1) != 0 )
operator delete(*(void **)&v20[16]);
v5 = 4;
strcpy(v6, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v5);
if ( (v5 & 1) != 0 )
operator delete(v7);
v8 = 8;
strcpy(v9, "Help");
v12 = operator new(0xE0u);
*(_QWORD *)&v11 = 225;
*((_QWORD *)&v11 + 1) = 222;
strcpy(
(char *)v12,
"Lets you set ItemID to be Persistent. This means it does not reset upon player death, but only on "
"level exit.\n"
"TargetAll targets all persistent Item IDs.\n"
"Reset resets the target item(s) to 0.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v8, &v11, (__m128)0x3F800000u);
if ( (v11 & 1) != 0 )
operator delete(v12);
if ( (v8 & 1) != 0 )
operator delete(v10);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v26);
sub_10028CBE0((float *)&v19, v26 * 0.5, v27 * 0.5);
v21 = 14;
strcpy(v22, "Item ID");
sub_10028CBE0((float *)v30, -40.0, 40.0);
sub_10028CCE0((double *)&v29, &v19, v30);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
80,
(__int64)&v21,
(float *)&v29,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v21 & 1) != 0 )
operator delete(v23);
strcpy((char *)&v13, "\nTimer");
sub_10028CBE0((float *)v30, 80.0, 40.0);
sub_10028CCE0((double *)&v29, &v19, v30);
SetupTriggerPopup::createToggleValueControl((int)a1, 494, &v13, 1.0, (__int64)&v29, 1, 0, 0);
if ( (v13 & 1) != 0 )
operator delete(v14);
sub_10028CBE0((float *)&v29, v26 * 0.5, (float)(0.5 * v27) + -23.0);
LOBYTE(v24) = 20;
strcpy((char *)&v24 + 1, "Persistent");
sub_10028CBE0((float *)&v28, -80.0, 0.0);
sub_10028CCE0((double *)v30, &v29, &v28);
SetupTriggerPopup::createToggleValueControl((int)a1, 491, &v24, 1.0, (__int64)v30, 1, 0, 0);
if ( (v24 & 1) != 0 )
operator delete(v25);
LOBYTE(v15) = 18;
strcpy((char *)&v15 + 1, "TargetAll");
sub_10028CBE0((float *)&v28, 0.0, 0.0);
sub_10028CCE0((double *)v30, &v29, &v28);
SetupTriggerPopup::createToggleValueControl((int)a1, 492, &v15, 1.0, (__int64)v30, 1, 0, 0);
if ( (v15 & 1) != 0 )
operator delete(v16);
strcpy((char *)&v17, "\nReset");
sub_10028CBE0((float *)&v28, 80.0, 0.0);
sub_10028CCE0((double *)v30, &v29, &v28);
SetupTriggerPopup::createToggleValueControl((int)a1, 493, &v17, 1.0, (__int64)v30, 1, 0, 0);
if ( (v17 & 1) != 0 )
operator delete(v18);
SetupTriggerPopup::postSetup(a1);
return v4;
}
return result;
}