//
// SetupItemCompareTriggerPopup::init from 0xb7df74 to 0xb7f008 (4244 bytes)
//
// 2 xrefs:
// > SetupItemCompareTriggerPopup::create @ 0xb7f294
// > ??> @ 0x87c10
//
// This function is hookable on this platform (idp: arm, 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 13:02:27 +0000
//
__int64 __fastcall SetupItemCompareTriggerPopup::init(
SetupItemCompareTriggerPopup *this,
ItemTriggerGameObject *a2,
cocos2d::CCArray *a3)
{
__int64 v5; // x23
void (__fastcall *v6)(__int64, __int64 *); // x24
__int64 v7; // x25
__int64 v8; // x2
__int64 v9; // x3
__int64 v10; // x4
__int64 v11; // x5
const char *v12; // x6
cocos2d::CCDirector *MultiTriggerItemsDefaultHorizontal; // x0
cocos2d::CCDirector *v14; // x0
unsigned int v15; // w23
int v16; // w1
unsigned int v17; // w26
unsigned int v18; // w23
int v19; // w1
unsigned int v20; // w26
int v21; // w27
bool v22; // w4
__int64 v23; // x5
const char *v24; // x6
cocos2d::CCNode *v25; // x24
void (__fastcall *v26)(CCMenuItemSpriteExtra *, __int64 *); // x26
float v27; // s0
unsigned int v28; // w23
float v29; // s9
const char *v30; // x1
_QWORD **v31; // x22
_QWORD *v32; // x26
void (__fastcall *v33)(_QWORD *, __int64 *); // x24
__int64 v34; // x0
CCMenuItemSpriteExtra *v35; // x22
cocos2d::CCNode *v36; // x26
void (__fastcall *v37)(CCMenuItemSpriteExtra *, __int64 *); // x24
__int64 v38; // x22
void (__fastcall *v39)(__int64, __int64 *); // x23
const char *v40; // x2
__int64 v41; // x0
__int64 v42; // x22
void (__fastcall *v43)(__int64, __int64 *); // x23
int v44; // [xsp+8h] [xbp-28h]
int v45; // [xsp+8h] [xbp-28h]
int v46; // [xsp+8h] [xbp-28h]
unsigned __int8 v47; // [xsp+DFh] [xbp+AFh]
__int64 v48; // [xsp+F0h] [xbp+C0h] BYREF
_BYTE v49[8]; // [xsp+F8h] [xbp+C8h] BYREF
_BYTE v50[8]; // [xsp+100h] [xbp+D0h] BYREF
_BYTE v51[8]; // [xsp+108h] [xbp+D8h] BYREF
__int64 v52; // [xsp+110h] [xbp+E0h] BYREF
__int64 v53[2]; // [xsp+118h] [xbp+E8h] BYREF
__int64 v54[2]; // [xsp+128h] [xbp+F8h] BYREF
void *v55; // [xsp+138h] [xbp+108h]
__int64 v56; // [xsp+140h] [xbp+110h] BYREF
__int64 v57; // [xsp+148h] [xbp+118h]
void *v58; // [xsp+150h] [xbp+120h]
v47 = SetupTriggerPopup::init(this, a2, a3, 430.0, 310.0, 1u, 0.0);
if ( v47 )
{
SetupTriggerPopup::preSetup(this);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Item Compare", 0xCu);
v5 = SetupTriggerPopup::addTitle((__int64)this, (__int64)&v56);
if ( (v56 & 1) != 0 )
operator delete(v58);
v6 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v5 + 184LL);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 192LL))(v5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -85.0, 0.0);
cocos2d::CCPoint::operator+(v53, v7);
v6(v5, v53);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "OK", 2u);
SetupTriggerPopup::addCloseButton((__int64)this, (__int64)&v56, v8, v9, v10, v11, v12);
if ( (v56 & 1) != 0 )
operator delete(v58);
v54[0] = 0;
v54[1] = 0;
v55 = nullptr;
std::string::__init(v54, "Help", 4u);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(
&v56,
"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.",
0x214u);
SetupTriggerPopup::addHelpButton((__int64)this, (char *)v54, (char *)&v56, 1.0);
if ( (v56 & 1) != 0 )
operator delete(v58);
if ( (v54[0] & 1) != 0 )
operator delete(v55);
MultiTriggerItemsDefaultHorizontal = (cocos2d::CCDirector *)SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(this);
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(MultiTriggerItemsDefaultHorizontal);
cocos2d::CCDirector::getWinSize(&v48, v14);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, *(float *)&v48 * 0.5, (float)(*((float *)&v48 + 1) * 0.5) + 66.0);
v15 = (int)(*(float (__fastcall **)(SetupItemCompareTriggerPopup *, __int64))(*(_QWORD *)this + 1464LL))(this, 476);
v17 = IDNameInput::idNameTypeForItemValueType((IDNameInput *)v15, v16);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "ItemID1", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -105.0, 42.0);
cocos2d::CCPoint::operator+(v53, v49);
IDNameInput::create(this, (char *)this + 544, v17, 80, &v56, v53, 6, 0, 0.8, 0, 1);
if ( (v56 & 1) != 0 )
operator delete(v58);
SetupTriggerPopup::toggleLimitValue((__int64 **)this, 80, 1);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Item", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 20.0, 43.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
1u,
v15 == 1,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Timer", 5u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 62.0, 43.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
2u,
v15 == 2,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Points", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 104.0, 43.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
3u,
v15 == 3,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Time", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 146.0, 43.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
4u,
v15 == 4,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Att", 3u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 188.0, 43.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
5u,
v15 == 5,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v18 = (int)(*(float (__fastcall **)(SetupItemCompareTriggerPopup *, __int64))(*(_QWORD *)this + 1464LL))(this, 477);
v20 = IDNameInput::idNameTypeForItemValueType((IDNameInput *)v18, v19);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "ItemID2", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -105.0, 0.0);
cocos2d::CCPoint::operator+(v53, v49);
LOBYTE(v44) = 1;
IDNameInput::create(this, (char *)this + 544, v20, 95, &v56, v53, 6, 0, 0.8, 0, v44);
if ( (v56 & 1) != 0 )
operator delete(v58);
SetupTriggerPopup::toggleLimitValue((__int64 **)this, 95, 1);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Item", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 20.0, -1.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
0x65u,
v18 == 1,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Timer", 5u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 62.0, -1.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
0x66u,
v18 == 2,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Points", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 104.0, -1.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
0x67u,
v18 == 3,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Time", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 146.0, -1.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
0x68u,
v18 == 4,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Att", 3u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 188.0, -1.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createCustomToggleValueControl(
(__int64)this,
0x69u,
v18 == 5,
1u,
(char *)&v56,
(const cocos2d::CCPoint *)v53,
1u,
0,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Mod1:", 5u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -105.0, -42.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
479,
(char *)&v56,
(__int64)v53,
0,
1,
10,
0,
0.8,
-2.0,
2.0,
0,
0,
1,
3,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Mod2:", 5u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 105.0, -42.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
483,
(char *)&v56,
(__int64)v53,
0,
1,
10,
0,
0.8,
-2.0,
2.0,
0,
0,
1,
3,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "TrueID", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -105.0, -84.0);
cocos2d::CCPoint::operator+(v53, v49);
LOBYTE(v45) = 1;
IDNameInput::create(this, (char *)this + 544, 1, 51, &v56, v53, 6, 0, 0.8, 0, v45);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "FalseID", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 105.0, -84.0);
cocos2d::CCPoint::operator+(v53, v49);
LOBYTE(v46) = 1;
IDNameInput::create(this, (char *)this + 544, 1, 71, &v56, v53, 6, 0, 0.8, 0, v46);
if ( (v56 & 1) != 0 )
operator delete(v58);
v56 = 0;
v57 = 0;
v58 = nullptr;
std::string::__init(&v56, "Tol+-:", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, -105.0, -126.0);
cocos2d::CCPoint::operator+(v53, v49);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
484,
(char *)&v56,
(__int64)v53,
0,
1,
10,
0,
0.8,
0.0,
1.0,
0,
0,
1,
3,
0);
if ( (v56 & 1) != 0 )
operator delete(v58);
v21 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, 2.0, 2.0);
while ( 1 )
{
switch ( v21 )
{
case 1:
v28 = 481;
break;
case 2:
v28 = 482;
break;
case 3:
v28 = 578;
break;
case 4:
v28 = 579;
break;
case 5:
v28 = 485;
v30 = (_BYTE *)(&dword_30 + 2);
v29 = 15.0;
goto LABEL_56;
case 6:
v29 = 36.0;
v28 = 486;
v30 = (_BYTE *)(&dword_30 + 2);
goto LABEL_56;
default:
v28 = 480;
break;
}
v29 = 0.0;
v30 = &byte_9[6];
LABEL_56:
v31 = (_QWORD **)ButtonSprite::create((ButtonSprite *)"+", v30, 15, 1, 0.4, v22, v23, v24);
((void (__fastcall *)(_QWORD **, float))(*v31)[20])(v31, 0.8);
(*(void (__fastcall **)(_QWORD *, float))(*v31[78] + 160LL))(v31[78], 1.1);
v32 = v31[78];
v33 = *(void (__fastcall **)(_QWORD *, __int64 *))(*v32 + 184LL);
v34 = (*(__int64 (__fastcall **)(_QWORD *))(*v32 + 192LL))(v32);
cocos2d::CCPoint::operator+(v53, v34);
v33(v32, v53);
v35 = (CCMenuItemSpriteExtra *)CCMenuItemSpriteExtra::create(
(__int64)v31,
0,
(__int64)this,
(__int64)SetupItemCompareTriggerPopup::onOpButton,
0);
(*(void (__fastcall **)(CCMenuItemSpriteExtra *, _QWORD))(*(_QWORD *)v35 + 72LL))(v35, v28);
(*(void (__fastcall **)(_QWORD, CCMenuItemSpriteExtra *))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
v35);
if ( v21 <= 4 )
{
v25 = *((cocos2d::CCNode **)this + 69);
v26 = *(void (__fastcall **)(CCMenuItemSpriteExtra *, __int64 *))(*(_QWORD *)v35 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, (float)((float)v21 * 42.0) + 20.0, -125.0);
cocos2d::CCPoint::operator+(&v52, v49);
cocos2d::CCNode::convertToNodeSpace(v53, v25, (const cocos2d::CCPoint *)&v52);
v26(v35, v53);
}
else
{
v36 = *((cocos2d::CCNode **)this + 69);
v37 = *(void (__fastcall **)(CCMenuItemSpriteExtra *, __int64 *))(*(_QWORD *)v35 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v52,
(float)((float)((float)(*(float *)&v48 * 0.5) + 75.0) + (float)(50 * (v21 % 5))) + v29,
(float)((float)(*((float *)&v48 + 1) * 0.5) + -60.0) - 35.0);
cocos2d::CCNode::convertToNodeSpace(v53, v36, (const cocos2d::CCPoint *)&v52);
v37(v35, v53);
}
++v21;
v27 = (*(float (__fastcall **)(SetupItemCompareTriggerPopup *, _QWORD))(*(_QWORD *)this + 1464LL))(this, v28);
SetupItemCompareTriggerPopup::updateOpButton(this, v35, (int)v27, v28);
if ( v21 == 7 )
{
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v51,
(float)(*(float *)&v48 * 0.5) + -80.0,
(float)(*((float *)&v48 + 1) * 0.5) + -95.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v53, 0.0, 0.0, 80.0, 80.0);
v38 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v53);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v38 + 912LL))(v38, 50);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v38 + 960LL))(v38, &unk_1192240);
v39 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v38 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v53, 960.0, 88.0);
v39(v38, v53);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v38,
1);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v38 + 184LL))(v38, v51);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v38 + 160LL))(v38, 0.25);
v41 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&byte_11E1A70, "goldFont.fnt", v40);
*((_QWORD *)this + 127) = v41;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v41,
2);
v42 = *((_QWORD *)this + 127);
v43 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v42 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 0.0, 1.0);
cocos2d::CCPoint::operator+(v53, v51);
v43(v42, v53);
SetupItemCompareTriggerPopup::updateFormulaLabel(this);
SetupTriggerPopup::postSetup(this);
return v47;
}
}
}
return v47;
}