//
// SetupItemEditTriggerPopup::init from 0x1005aac40 to 0x1005abc09 (4041 bytes)
//
// 1 xrefs:
// > sub_1005AAB30 @ 0x1005aabff
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:32:37 +0000
//
__int64 __fastcall SetupItemEditTriggerPopup::init(float *a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
__int64 v4; // rbx
unsigned __int64 *v5; // r14
float *v6; // r14
__int64 v7; // rax
__int64 v8; // r15
int v9; // ebx
int v10; // r14d
__int64 v11; // r15
int v12; // ebx
__int64 v13; // r15
int v14; // ebx
float *v15; // rbx
int v16; // r15d
float *v17; // r12
float v18; // xmm0_4
float v19; // xmm1_4
unsigned int v20; // r14d
float v21; // xmm0_4
int v22; // ecx
_QWORD **v23; // rbx
_QWORD *v24; // r14
unsigned __int64 *v25; // rax
void *v26; // rbx
__int64 v27; // r14
void *v28; // rbx
__int64 v29; // rax
__int64 v30; // rbx
__int128 v31; // [rsp+38h] [rbp-228h] BYREF
void *v32; // [rsp+48h] [rbp-218h]
__int128 v33; // [rsp+50h] [rbp-210h] BYREF
void *v34; // [rsp+60h] [rbp-200h]
void *v35[3]; // [rsp+68h] [rbp-1F8h] BYREF
char v36; // [rsp+80h] [rbp-1E0h] BYREF
char v37[15]; // [rsp+81h] [rbp-1DFh] BYREF
void *v38; // [rsp+90h] [rbp-1D0h]
__int128 v39; // [rsp+98h] [rbp-1C8h] BYREF
void *v40; // [rsp+A8h] [rbp-1B8h]
__int128 v41; // [rsp+B0h] [rbp-1B0h] BYREF
void *v42; // [rsp+C0h] [rbp-1A0h]
__int128 v43; // [rsp+C8h] [rbp-198h] BYREF
void *v44; // [rsp+D8h] [rbp-188h]
__int128 v45; // [rsp+E0h] [rbp-180h] BYREF
void *v46; // [rsp+F0h] [rbp-170h]
__int128 v47; // [rsp+F8h] [rbp-168h] BYREF
void *v48; // [rsp+108h] [rbp-158h]
__int128 v49; // [rsp+110h] [rbp-150h] BYREF
void *v50; // [rsp+120h] [rbp-140h]
__int128 v51; // [rsp+128h] [rbp-138h] BYREF
void *v52; // [rsp+138h] [rbp-128h]
__int128 v53; // [rsp+140h] [rbp-120h] BYREF
void *v54; // [rsp+150h] [rbp-110h]
std::string v55; // [rsp+158h] [rbp-108h] BYREF
__int128 v56; // [rsp+170h] [rbp-F0h] BYREF
void *v57; // [rsp+180h] [rbp-E0h]
__int128 v58; // [rsp+188h] [rbp-D8h] BYREF
void *v59; // [rsp+198h] [rbp-C8h]
__int128 v60; // [rsp+1A0h] [rbp-C0h] BYREF
void *v61; // [rsp+1B0h] [rbp-B0h]
__int128 v62; // [rsp+1B8h] [rbp-A8h] BYREF
void *v63; // [rsp+1C8h] [rbp-98h]
__int128 v64; // [rsp+1D0h] [rbp-90h] BYREF
void *v65; // [rsp+1E0h] [rbp-80h]
unsigned __int64 v66; // [rsp+1E8h] [rbp-78h] BYREF
unsigned __int64 v67; // [rsp+1F0h] [rbp-70h] BYREF
unsigned int v68; // [rsp+1F8h] [rbp-68h]
unsigned __int64 v69; // [rsp+1FCh] [rbp-64h] BYREF
unsigned __int8 v70; // [rsp+207h] [rbp-59h]
unsigned __int64 v71; // [rsp+208h] [rbp-58h] BYREF
unsigned __int64 v72[2]; // [rsp+210h] [rbp-50h] BYREF
void *v73; // [rsp+220h] [rbp-40h]
float *v74; // [rsp+228h] [rbp-38h]
unsigned __int64 v75[6]; // [rsp+230h] [rbp-30h] BYREF
result = SetupTriggerPopup::init((__int64)a1, a2, a3, 1, 420.0, 300.0, 0.0);
if ( (_BYTE)result )
{
v70 = result;
SetupTriggerPopup::preSetup(a1);
strcpy((char *)v35, "\"Item Edit Trigger");
v4 = SetupTriggerPopup::addTitle((__int64)a1, (__int64)v35);
v74 = a1;
if ( ((__int64)v35[0] & 1) != 0 )
operator delete(v35[2]);
v5 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 192LL))(v4);
sub_100278250((float *)&v67, -85.0, 0.0);
sub_100278350((double *)v72, v5, &v67);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v4 + 184LL))(v4, v72);
v36 = 4;
strcpy(v37, "OK");
v6 = v74;
SetupTriggerPopup::addCloseButton((__int64)v74, (__int64)&v36);
if ( (v36 & 1) != 0 )
operator delete(v38);
LOBYTE(v39) = 8;
strcpy((char *)&v39 + 1, "Help");
v42 = operator new(0x1C8u);
*(_QWORD *)&v41 = 457;
*((_QWORD *)&v41 + 1) = 449;
strcpy(
(char *)v42,
"Edits Target ItemID using operations on ItemID1 and ItemID2.\n"
"Use Item, Timer, Points, Time, or Att to specify type.\n"
"The first operator button sets the interaction with target.\n"
"The second sets interaction between the two initial IDs.\n"
"The third sets how Mod interacts with the equation.\n"
"Button 4/5 are used to force the values positive or negative.\n"
"Click the NA button to switch to different rounding functions.");
SetupTriggerPopup::addHelpButton((__int64)v6, &v39, &v41, 0.80000001);
if ( (v41 & 1) != 0 )
operator delete(v42);
if ( (v39 & 1) != 0 )
operator delete(v40);
sub_10021B1F0(v6, (__int64)&v39);
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v67, v7);
sub_100278250((float *)&v71, *(float *)&v67 * 0.5, (float)(*((float *)&v67 + 1) * 0.5) + 58.0);
v8 = (unsigned int)(int)(*(float (__fastcall **)(float *, __int64))(*(_QWORD *)v6 + 1464LL))(v6, 476);
v9 = sub_100912CA0(v8);
LOBYTE(v72[0]) = 14;
strcpy((char *)v72 + 1, "ItemID1");
sub_100278250((float *)&v69, -105.0, 45.0);
sub_100278350((double *)v75, &v71, &v69);
v10 = (_DWORD)v74 + 544;
IDNameInput::create((_DWORD)v74, (_DWORD)v74 + 544, v9, 80, (unsigned int)v72, (unsigned int)v75, 6, 0, 0, 1);
if ( (v72[0] & 1) != 0 )
operator delete(v73);
LOBYTE(v43) = 8;
strcpy((char *)&v43 + 1, "Item");
sub_100278250((float *)v75, 20.0, 45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 1u, v8 == 1, 1, &v43, (__int64)v72, 1, 0, 0);
if ( (v43 & 1) != 0 )
operator delete(v44);
strcpy((char *)&v45, "\nTimer");
sub_100278250((float *)v75, 62.0, 45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 2u, v8 == 2, 1, &v45, (__int64)v72, 1, 0, 0);
if ( (v45 & 1) != 0 )
operator delete(v46);
LOBYTE(v60) = 12;
strcpy((char *)&v60 + 1, "Points");
sub_100278250((float *)v75, 104.0, 45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 3u, v8 == 3, 1, &v60, (__int64)v72, 1, 0, 0);
if ( (v60 & 1) != 0 )
operator delete(v61);
LOBYTE(v47) = 8;
strcpy((char *)&v47 + 1, "Time");
sub_100278250((float *)v75, 146.0, 45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 4u, v8 == 4, 1, &v47, (__int64)v72, 1, 0, 0);
if ( (v47 & 1) != 0 )
operator delete(v48);
LOBYTE(v31) = 6;
*(_DWORD *)((char *)&v31 + 1) = 7631937;
sub_100278250((float *)v75, 188.0, 45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 5u, v8 == 5, 1, &v31, (__int64)v72, 1, 0, 0);
if ( (v31 & 1) != 0 )
operator delete(v32);
v11 = (unsigned int)(int)(*(float (__fastcall **)(float *, __int64))(*(_QWORD *)v74 + 1464LL))(v74, 477);
v12 = sub_100912CA0(v11);
LOBYTE(v72[0]) = 14;
strcpy((char *)v72 + 1, "ItemID2");
sub_100278250((float *)&v69, -105.0, 0.0);
sub_100278350((double *)v75, &v71, &v69);
IDNameInput::create((_DWORD)v74, v10, v12, 95, (unsigned int)v72, (unsigned int)v75, 6, 0, 0, 1);
if ( (v72[0] & 1) != 0 )
operator delete(v73);
LOBYTE(v49) = 8;
strcpy((char *)&v49 + 1, "Item");
sub_100278250((float *)v75, 20.0, 0.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 0x65u, v11 == 1, 1, &v49, (__int64)v72, 1, 0, 0);
if ( (v49 & 1) != 0 )
operator delete(v50);
strcpy((char *)&v51, "\nTimer");
sub_100278250((float *)v75, 62.0, 0.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 0x66u, v11 == 2, 1, &v51, (__int64)v72, 1, 0, 0);
if ( (v51 & 1) != 0 )
operator delete(v52);
LOBYTE(v62) = 12;
strcpy((char *)&v62 + 1, "Points");
sub_100278250((float *)v75, 104.0, 0.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 0x67u, v11 == 3, 1, &v62, (__int64)v72, 1, 0, 0);
if ( (v62 & 1) != 0 )
operator delete(v63);
LOBYTE(v53) = 8;
strcpy((char *)&v53 + 1, "Time");
sub_100278250((float *)v75, 146.0, 0.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 0x68u, v11 == 4, 1, &v53, (__int64)v72, 1, 0, 0);
if ( (v53 & 1) != 0 )
operator delete(v54);
LOBYTE(v33) = 6;
*(_DWORD *)((char *)&v33 + 1) = 7631937;
sub_100278250((float *)v75, 188.0, 0.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v74, 0x69u, v11 == 5, 1, &v33, (__int64)v72, 1, 0, 0);
if ( (v33 & 1) != 0 )
operator delete(v34);
v55.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)8;
strcpy(v55.__r_.__value_.__s.__data_, "Mod:");
sub_100278250((float *)v75, -105.0, -45.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)v74,
479,
&v55,
(__int64)v72,
0,
1u,
0.80000001,
-2.0,
2.0,
0xAu,
0,
0,
0,
1u,
3u,
0);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
v13 = (unsigned int)(int)(*(float (__fastcall **)(float *, __int64))(*(_QWORD *)v74 + 1464LL))(v74, 478);
v14 = sub_100912CA0(v13);
LOBYTE(v72[0]) = 26;
strcpy((char *)v72 + 1, "Target\nItemID");
sub_100278250((float *)&v69, -105.0, -90.0);
sub_100278350((double *)v75, &v71, &v69);
IDNameInput::create((_DWORD)v74, v10, v14, 51, (unsigned int)v72, (unsigned int)v75, 6, 0, 0, 1);
if ( (v72[0] & 1) != 0 )
operator delete(v73);
LOBYTE(v56) = 8;
strcpy((char *)&v56 + 1, "Item");
sub_100278250((float *)v75, 20.0, -90.0);
v15 = v74;
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v15, 0x3E9u, v13 == 1, 1, &v56, (__int64)v72, 1, 0, 0);
if ( (v56 & 1) != 0 )
operator delete(v57);
strcpy((char *)&v58, "\nTimer");
sub_100278250((float *)v75, 62.0, -90.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v15, 0x3EAu, v13 == 2, 1, &v58, (__int64)v72, 1, 0, 0);
if ( (v58 & 1) != 0 )
operator delete(v59);
LOBYTE(v64) = 12;
strcpy((char *)&v64 + 1, "Points");
sub_100278250((float *)v75, 104.0, -90.0);
sub_100278350((double *)v72, &v71, v75);
SetupTriggerPopup::createCustomToggleValueControl(v15, 0x3EBu, v13 == 3, 1, &v64, (__int64)v72, 1, 0, 0);
if ( (v64 & 1) != 0 )
operator delete(v65);
sub_100278250((float *)v75, 2.0, 2.0);
v16 = 0;
v17 = v74;
do
{
v22 = 480;
if ( (unsigned int)(v16 - 1) <= 5 )
v22 = dword_100A0D484[v16 - 1];
v68 = v22;
v23 = (_QWORD **)sub_100059E30((__int64)"+", 15, 15, 1, 1.0);
((void (__fastcall *)(_QWORD **, float))(*v23)[20])(v23, 0.80000001);
(*(void (__fastcall **)(_QWORD *, float))(*v23[78] + 160LL))(v23[78], 1.1);
v24 = v23[78];
v25 = (unsigned __int64 *)(*(__int64 (__fastcall **)(_QWORD *))(*v24 + 192LL))(v24);
sub_100278350((double *)v72, v25, v75);
(*(void (__fastcall **)(_QWORD *, unsigned __int64 *))(*v24 + 184LL))(v24, v72);
v26 = CCMenuItemSpriteExtra::create(
(__int64)v23,
0,
(__int64)v17,
(__int64)SetupItemEditTriggerPopup::onOpButton,
0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v26 + 72LL))(v26, v68);
(*(void (__fastcall **)(_QWORD, void *))(**((_QWORD **)v17 + 69) + 456LL))(*((_QWORD *)v17 + 69), v26);
v27 = *((_QWORD *)v17 + 69);
if ( (unsigned int)v16 > 4 )
{
v18 = (float)((float)(v16 - 2) * 42.0) + 20.0;
v19 = -90.0;
}
else
{
v18 = (float)((float)v16 * 42.0) + 20.0;
v19 = -45.0;
}
sub_100278250((float *)&v66, v18, v19);
sub_100278350((double *)&v69, &v71, &v66);
cocos2d::CCNode::convertToNodeSpace((double *)v72, v27, (unsigned int *)&v69);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v26 + 184LL))(v26, v72);
v20 = v68;
v21 = (*(float (__fastcall **)(float *, _QWORD))(*(_QWORD *)v17 + 1464LL))(v17, v68);
SetupItemEditTriggerPopup::updateOpButton(v17, v26, (unsigned int)(int)v21, v20);
++v16;
}
while ( v16 != 7 );
sub_100278250((float *)&v69, *(float *)&v67 * 0.5, (float)(0.5 * *((float *)&v67 + 1)) + -82.0);
sub_100278270((__int64)v72, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v28 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square01.png", v72);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v28 + 912LL))(v28, 50);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v28 + 960LL))(v28, &unk_100A0D29C);
sub_100278260((float *)v72, 1520.0, 140.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v28 + 320LL))(v28, v72);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**((_QWORD **)v17 + 73) + 464LL))(*((_QWORD *)v17 + 73), v28, 1);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v28 + 184LL))(v28, &v69);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v28 + 160LL))(v28, 0.25);
v29 = cocos2d::CCLabelBMFont::create_3("T = (A + B) x M", "goldFont.fnt");
*((_QWORD *)v17 + 127) = v29;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)v17 + 73) + 464LL))(*((_QWORD *)v17 + 73), v29, 2);
v30 = *((_QWORD *)v17 + 127);
sub_100278250((float *)&v66, 0.0, 1.0);
sub_100278350((double *)v72, &v69, &v66);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v30 + 184LL))(v30, v72);
SetupItemEditTriggerPopup::updateFormulaLabel(v17);
SetupTriggerPopup::postSetup(v17);
return v70;
}
return result;
}