//
// SetupItemCompareTriggerPopup::init from 0x1005ad370 to 0x1005ae450 (4320 bytes)
//
// 1 xrefs:
// > sub_1005AD260 @ 0x1005ad32f
//
// 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:38 +0000
//
__int64 __fastcall SetupItemCompareTriggerPopup::init(float *a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
__int64 v4; // r14
unsigned __int64 *v5; // r15
__int64 v6; // rax
__int64 v7; // r15
int v8; // r12d
unsigned int v9; // r15d
int v10; // r12d
unsigned int v11; // edx
int v12; // r14d
__int64 v13; // r13
int v14; // r14d
unsigned int v15; // r13d
float v16; // xmm0_4
unsigned int v17; // r13d
unsigned int v18; // edx
__int64 v19; // rsi
int v20; // r14d
_QWORD **v21; // r15
_QWORD *v22; // rbx
unsigned __int64 *v23; // rax
float *v24; // rbx
__int64 *v25; // r15
__int64 v26; // rax
void *v27; // r15
__int64 v28; // rax
__int64 v29; // r15
unsigned __int64 v30; // [rsp+38h] [rbp-228h] BYREF
float *v31; // [rsp+40h] [rbp-220h]
__int64 v32; // [rsp+48h] [rbp-218h]
__int128 v33; // [rsp+50h] [rbp-210h] BYREF
void *v34; // [rsp+60h] [rbp-200h]
__int128 v35; // [rsp+68h] [rbp-1F8h] BYREF
void *v36; // [rsp+78h] [rbp-1E8h]
char v37; // [rsp+80h] [rbp-1E0h] BYREF
char v38[15]; // [rsp+81h] [rbp-1DFh] BYREF
void *v39; // [rsp+90h] [rbp-1D0h]
__int128 v40; // [rsp+98h] [rbp-1C8h] BYREF
void *v41; // [rsp+A8h] [rbp-1B8h]
__int128 v42; // [rsp+B0h] [rbp-1B0h] BYREF
void *v43; // [rsp+C0h] [rbp-1A0h]
__int128 v44; // [rsp+C8h] [rbp-198h] BYREF
void *v45; // [rsp+D8h] [rbp-188h]
__int128 v46; // [rsp+E0h] [rbp-180h] BYREF
void *v47; // [rsp+F0h] [rbp-170h]
__int128 v48; // [rsp+F8h] [rbp-168h] BYREF
void *v49; // [rsp+108h] [rbp-158h]
__int128 v50; // [rsp+110h] [rbp-150h] BYREF
void *v51; // [rsp+120h] [rbp-140h]
__int128 v52; // [rsp+128h] [rbp-138h] BYREF
void *v53; // [rsp+138h] [rbp-128h]
__int128 v54; // [rsp+140h] [rbp-120h] BYREF
void *v55; // [rsp+150h] [rbp-110h]
std::string v56; // [rsp+158h] [rbp-108h] BYREF
std::string v57; // [rsp+170h] [rbp-F0h] BYREF
char v58; // [rsp+188h] [rbp-D8h] BYREF
_BYTE v59[23]; // [rsp+189h] [rbp-D7h] BYREF
__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]
std::string v64; // [rsp+1D0h] [rbp-90h] BYREF
unsigned int v65; // [rsp+1ECh] [rbp-74h]
unsigned int v66; // [rsp+1F0h] [rbp-70h]
int v67; // [rsp+1F4h] [rbp-6Ch]
float v68; // [rsp+1F8h] [rbp-68h]
unsigned __int64 v69; // [rsp+1FCh] [rbp-64h] BYREF
unsigned __int64 v70; // [rsp+204h] [rbp-5Ch] BYREF
unsigned __int8 v71; // [rsp+20Fh] [rbp-51h]
unsigned __int64 v72; // [rsp+210h] [rbp-50h] BYREF
unsigned __int64 v73[2]; // [rsp+218h] [rbp-48h] BYREF
void *v74; // [rsp+228h] [rbp-38h]
unsigned __int64 v75[6]; // [rsp+230h] [rbp-30h] BYREF
result = SetupTriggerPopup::init((__int64)a1, a2, a3, 1, 430.0, 310.0, 0.0);
if ( (_BYTE)result )
{
v71 = result;
SetupTriggerPopup::preSetup(a1);
v58 = 24;
strcpy(v59, "Item Compare");
v4 = SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v58);
if ( (v58 & 1) != 0 )
operator delete(*(void **)&v59[15]);
v5 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 192LL))(v4);
sub_100278250((float *)&v69, -85.0, 0.0);
sub_100278350((double *)v73, v5, &v69);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v4 + 184LL))(v4, v73);
v37 = 4;
strcpy(v38, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v37);
if ( (v37 & 1) != 0 )
operator delete(v39);
LOBYTE(v40) = 8;
strcpy((char *)&v40 + 1, "Help");
v43 = operator new(0x218u);
*(_QWORD *)&v42 = 537;
*((_QWORD *)&v42 + 1) = 532;
strcpy(
(char *)v43,
"Activates TrueID or FalseID based on comparison of ItemID1 and ItemID2.\n"
"Use Item, Timer, Points, Time, or Att to specify type.\n"
"Mod1 and Mod2 are modifiers for the two Item IDs.\n"
"The first operator button sets interaction between ItemID1 and Mod 1 and similar for the second.\n"
"The third sets how the two values are compared.\n"
"Button 4/5 can be used to force values positive or negative.\n"
"Tol allows the result to be off a certain amount.\n"
"Click NA to switch to different rounding functions.");
SetupTriggerPopup::addHelpButton((__int64)a1, &v40, &v42, 1.0);
if ( (v42 & 1) != 0 )
operator delete(v43);
if ( (v40 & 1) != 0 )
operator delete(v41);
sub_10021B1F0(a1, (__int64)&v40);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v69, v6);
sub_100278250((float *)&v72, *(float *)&v69 * 0.5, (float)(*((float *)&v69 + 1) * 0.5) + 66.0);
v7 = (unsigned int)(int)(*(float (__fastcall **)(float *, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 476);
v8 = sub_100912CA0(v7);
LOBYTE(v73[0]) = 14;
strcpy((char *)v73 + 1, "ItemID1");
sub_100278250((float *)&v70, -105.0, 42.0);
sub_100278350((double *)v75, &v72, &v70);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, v8, 80, (unsigned int)v73, (unsigned int)v75, 6, 0, 0, 1);
if ( (v73[0] & 1) != 0 )
operator delete(v74);
SetupTriggerPopup::toggleLimitValue((__int64)a1, 80, 1);
LOBYTE(v44) = 8;
strcpy((char *)&v44 + 1, "Item");
sub_100278250((float *)v75, 20.0, 43.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 1u, v7 == 1, 1, &v44, (__int64)v73, 1, 0, 0);
if ( (v44 & 1) != 0 )
operator delete(v45);
strcpy((char *)&v46, "\nTimer");
sub_100278250((float *)v75, 62.0, 43.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 2u, v7 == 2, 1, &v46, (__int64)v73, 1, 0, 0);
if ( (v46 & 1) != 0 )
operator delete(v47);
LOBYTE(v60) = 12;
strcpy((char *)&v60 + 1, "Points");
sub_100278250((float *)v75, 104.0, 43.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 3u, v7 == 3, 1, &v60, (__int64)v73, 1, 0, 0);
if ( (v60 & 1) != 0 )
operator delete(v61);
LOBYTE(v48) = 8;
strcpy((char *)&v48 + 1, "Time");
sub_100278250((float *)v75, 146.0, 43.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 4u, v7 == 4, 1, &v48, (__int64)v73, 1, 0, 0);
if ( (v48 & 1) != 0 )
operator delete(v49);
LOBYTE(v33) = 6;
*(_DWORD *)((char *)&v33 + 1) = 7631937;
sub_100278250((float *)v75, 188.0, 43.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 5u, v7 == 5, 1, &v33, (__int64)v73, 1, 0, 0);
if ( (v33 & 1) != 0 )
operator delete(v34);
v9 = (int)(*(float (__fastcall **)(float *, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 477);
v10 = sub_100912CA0(v9);
LOBYTE(v73[0]) = 14;
strcpy((char *)v73 + 1, "ItemID2");
sub_100278250((float *)&v70, -105.0, 0.0);
sub_100278350((double *)v75, &v72, &v70);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, v10, 95, (unsigned int)v73, (unsigned int)v75, 6, 0, 0, 1);
if ( (v73[0] & 1) != 0 )
operator delete(v74);
SetupTriggerPopup::toggleLimitValue((__int64)a1, 95, 1);
LOBYTE(v50) = 8;
strcpy((char *)&v50 + 1, "Item");
sub_100278250((float *)v75, 20.0, -1.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 0x65u, v9 == 1, 1, &v50, (__int64)v73, 1, 0, 0);
if ( (v50 & 1) != 0 )
operator delete(v51);
strcpy((char *)&v52, "\nTimer");
sub_100278250((float *)v75, 62.0, -1.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 0x66u, v9 == 2, 1, &v52, (__int64)v73, 1, 0, 0);
if ( (v52 & 1) != 0 )
operator delete(v53);
LOBYTE(v62) = 12;
strcpy((char *)&v62 + 1, "Points");
sub_100278250((float *)v75, 104.0, -1.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 0x67u, v9 == 3, 1, &v62, (__int64)v73, 1, 0, 0);
if ( (v62 & 1) != 0 )
operator delete(v63);
LOBYTE(v54) = 8;
strcpy((char *)&v54 + 1, "Time");
sub_100278250((float *)v75, 146.0, -1.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 0x68u, v9 == 4, 1, &v54, (__int64)v73, 1, 0, 0);
if ( (v54 & 1) != 0 )
operator delete(v55);
LOBYTE(v35) = 6;
*(_DWORD *)((char *)&v35 + 1) = 7631937;
sub_100278250((float *)v75, 188.0, -1.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createCustomToggleValueControl(a1, 0x69u, v9 == 5, 1, &v35, (__int64)v73, 1, 0, 0);
if ( (v35 & 1) != 0 )
operator delete(v36);
strcpy((char *)&v56, "\nMod1:");
sub_100278250((float *)v75, -105.0, -42.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
479,
&v56,
(__int64)v73,
0,
1u,
0.80000001,
-2.0,
2.0,
0xAu,
0,
0,
0,
1u,
3u,
0);
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v56.__r_.__value_.__l.__data_);
strcpy((char *)&v57, "\nMod2:");
sub_100278250((float *)v75, 105.0, -42.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
483,
&v57,
(__int64)v73,
0,
1u,
0.80000001,
-2.0,
2.0,
0xAu,
0,
0,
0,
1u,
3u,
0);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
LOBYTE(v73[0]) = 12;
strcpy((char *)v73 + 1, "TrueID");
sub_100278250((float *)&v70, -105.0, -84.0);
sub_100278350((double *)v75, &v72, &v70);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, 1, 51, (unsigned int)v73, (unsigned int)v75, 6, 0, 0, 1);
if ( (v73[0] & 1) != 0 )
operator delete(v74);
LOBYTE(v73[0]) = 14;
strcpy((char *)v73 + 1, "FalseID");
sub_100278250((float *)&v70, 105.0, -84.0);
sub_100278350((double *)v75, &v72, &v70);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, 1, 71, (unsigned int)v73, (unsigned int)v75, 6, 0, 0, 1);
if ( (v73[0] & 1) != 0 )
operator delete(v74);
v64.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)12;
strcpy(v64.__r_.__value_.__s.__data_, "Tol+-:");
sub_100278250((float *)v75, -105.0, -126.0);
sub_100278350((double *)v73, &v72, v75);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
484,
&v64,
(__int64)v73,
0,
1u,
0.80000001,
0.0,
1.0,
0xAu,
0,
0,
0,
1u,
3u,
0);
if ( (*(_BYTE *)&v64.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v64.__r_.__value_.__l.__data_);
sub_100278250((float *)v75, 2.0, 2.0);
v11 = -1;
v12 = -250;
v31 = a1;
do
{
v67 = v12;
if ( v11 > 5 )
{
v68 = 0.0;
v17 = 480;
}
else
{
v17 = dword_100A0D484[v11];
v68 = flt_100A0D49C[v11];
}
v18 = v11 + 1;
v19 = 50;
if ( v18 < 5 )
v19 = 15;
v20 = v18;
v21 = (_QWORD **)sub_100059E30((__int64)"+", v19, 15, 1, 0.40000001);
((void (__fastcall *)(_QWORD **, float))(*v21)[20])(v21, 0.80000001);
(*(void (__fastcall **)(_QWORD *, float))(*v21[78] + 160LL))(v21[78], 1.1);
v22 = v21[78];
v23 = (unsigned __int64 *)(*(__int64 (__fastcall **)(_QWORD *))(*v22 + 192LL))(v22);
sub_100278350((double *)v73, v23, v75);
(*(void (__fastcall **)(_QWORD *, unsigned __int64 *))(*v22 + 184LL))(v22, v73);
v24 = v31;
v25 = (__int64 *)CCMenuItemSpriteExtra::create(
(__int64)v21,
0,
(__int64)v31,
(__int64)SetupItemCompareTriggerPopup::onOpButton,
0);
v26 = *v25;
v65 = v17;
(*(void (__fastcall **)(__int64 *, _QWORD))(v26 + 72))(v25, v17);
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)v24 + 69) + 456LL))(*((_QWORD *)v24 + 69), v25);
v66 = v20;
if ( (unsigned int)v20 < 5 )
{
v13 = *((_QWORD *)v24 + 69);
sub_100278250((float *)&v30, (float)((float)v20 * 42.0) + 20.0, -125.0);
sub_100278350((double *)&v70, &v72, &v30);
cocos2d::CCNode::convertToNodeSpace((double *)v73, v13, (unsigned int *)&v70);
(*(void (__fastcall **)(__int64 *, unsigned __int64 *))(*v25 + 184))(v25, v73);
v14 = v67;
}
else
{
v32 = *((_QWORD *)v24 + 69);
v14 = v67;
sub_100278250(
(float *)&v70,
v68 + (float)((float)v67 + (float)((float)(*(float *)&v69 * 0.5) + 75.0)),
(float)((float)(*((float *)&v69 + 1) * 0.5) + -60.0) + -35.0);
cocos2d::CCNode::convertToNodeSpace((double *)v73, v32, (unsigned int *)&v70);
(*(void (__fastcall **)(__int64 *, unsigned __int64 *))(*v25 + 184))(v25, v73);
}
v15 = v65;
v16 = (*(float (__fastcall **)(float *, _QWORD))(*(_QWORD *)v24 + 1464LL))(v24, v65);
SetupItemCompareTriggerPopup::updateOpButton(v24, v25, (unsigned int)(int)v16, v15);
v12 = v14 + 50;
v11 = v66;
}
while ( v66 != 6 );
sub_100278250((float *)&v70, (float)(*(float *)&v69 * 0.5) + -80.0, (float)(0.5 * *((float *)&v69 + 1)) + -95.0);
sub_100278270((__int64)v73, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v27 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square01.png", v73);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v27 + 912LL))(v27, 50);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v27 + 960LL))(v27, &unk_100A0D29C);
sub_100278260((float *)v73, 960.0, 88.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v27 + 320LL))(v27, v73);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**((_QWORD **)v24 + 73) + 464LL))(*((_QWORD *)v24 + 73), v27, 1);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v27 + 184LL))(v27, &v70);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v27 + 160LL))(v27, 0.25);
v28 = cocos2d::CCLabelBMFont::create_3(" ", "goldFont.fnt");
*((_QWORD *)v24 + 127) = v28;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)v24 + 73) + 464LL))(*((_QWORD *)v24 + 73), v28, 2);
v29 = *((_QWORD *)v24 + 127);
sub_100278250((float *)&v30, 0.0, 1.0);
sub_100278350((double *)v73, &v70, &v30);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v29 + 184LL))(v29, v73);
SetupItemCompareTriggerPopup::updateFormulaLabel(v24);
SetupTriggerPopup::postSetup(v24);
return v71;
}
return result;
}