//
// SetupInstantCountPopup::init from 0xa9ed68 to 0xa9f7ec (2692 bytes)
//
// 2 xrefs:
// > SetupInstantCountPopup::create @ 0xa9fa50
// > ??> @ 0x5f698
//
// 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:00:47 +0000
//
__int64 __fastcall SetupInstantCountPopup::init(
cocos2d::CCNode **this,
CountTriggerGameObject *a2,
cocos2d::CCArray *a3)
{
unsigned __int8 v4; // w0
unsigned int v5; // w25
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
float v9; // s2
__int64 v10; // x24
__int64 v11; // x27
cocos2d::CCNode *v12; // x0
cocos2d::CCNode *v13; // x1
const char *v14; // x2
__int64 v15; // x24
__int64 v16; // x24
void (__fastcall *v17)(__int64, cocos2d::CCDirector **); // x2
const char *v18; // x4
__int64 v19; // x0
__int64 v20; // x24
const char *v21; // x1
__int64 v22; // x27
__int64 v23; // x28
void (__fastcall *v24)(__int64, cocos2d::CCDirector **); // x27
const char *v25; // x1
__int64 v26; // x27
__int64 v27; // x24
void (__fastcall *v28)(__int64, cocos2d::CCDirector **); // x27
_BOOL4 v29; // w27
__int64 ToggleButton; // x0
char v31; // w1
_BOOL4 v32; // w27
__int64 v33; // x0
char v34; // w1
_BOOL4 v35; // w27
__int64 v36; // x0
char v37; // w1
int v38; // [xsp+8h] [xbp-8h]
void (__fastcall *v39)(__int64, cocos2d::CCDirector **); // [xsp+98h] [xbp+88h]
void (__fastcall *v40)(__int64, cocos2d::CCDirector **); // [xsp+98h] [xbp+88h]
int v41; // [xsp+A0h] [xbp+90h]
__int64 v42; // [xsp+A8h] [xbp+98h] BYREF
_BYTE v43[8]; // [xsp+B0h] [xbp+A0h] BYREF
__int64 v44; // [xsp+B8h] [xbp+A8h] BYREF
__int64 v45; // [xsp+C0h] [xbp+B0h] BYREF
_BYTE v46[8]; // [xsp+C8h] [xbp+B8h] BYREF
_BYTE v47[8]; // [xsp+D0h] [xbp+C0h] BYREF
cocos2d::CCDirector *v48[2]; // [xsp+D8h] [xbp+C8h] BYREF
cocos2d::CCDirector *v49[2]; // [xsp+E8h] [xbp+D8h] BYREF
void *v50; // [xsp+F8h] [xbp+E8h]
__int64 v51; // [xsp+100h] [xbp+F0h] BYREF
__int64 v52; // [xsp+108h] [xbp+F8h]
void *v53; // [xsp+110h] [xbp+100h]
v4 = SetupTriggerPopup::init((SetupTriggerPopup *)this, a2, a3, 400.0, 280.0, 1, 0.0);
v5 = v4;
if ( v4 )
{
(*((void (__fastcall **)(cocos2d::CCNode **))*this + 170))(this);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Instant Count Trigger", 0x15u);
SetupTriggerPopup::addTitle(this, &v51);
if ( (v51 & 1) != 0 )
operator delete(v53);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "OK", 2u);
SetupTriggerPopup::addCloseButton(this, &v51);
if ( (v51 & 1) != 0 )
operator delete(v53);
v49[0] = nullptr;
v49[1] = nullptr;
v50 = nullptr;
std::string::__init((__int64 *)v49, "Help", 4u);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(
&v51,
"Disables objects using Target ID when an Item ID reaches a certain Target Count. The condi"
"tion is only checked once when the trigger is activated.\n"
"Equals, Larger, or Smaller specify which condition to use.\n"
"Activate Group makes the trigger enable and spawn the group instead.",
0x13Au);
SetupTriggerPopup::addHelpButton(this, v49, &v51, 1.0);
if ( (v51 & 1) != 0 )
operator delete(v53);
v7 = (cocos2d::CCDirector *)LOBYTE(v49[0]);
if ( ((__int64)v49[0] & 1) != 0 )
operator delete(v50);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(&v42, v8);
v9 = *((float *)&v42 + 1);
*((_DWORD *)this + 160) = -1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, *(float *)&v42 * 0.5, (float)(v9 * 0.5) + 25.0);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Item ID", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, -90.0, 40.0);
cocos2d::CCPoint::operator+(v48, v43);
v10 = IDNameInput::create(this, this + 68, 2, 0, &v51, v48, 6, 0, 1.0, 0, 0);
if ( (v51 & 1) != 0 )
operator delete(v53);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Target ID", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 90.0, 40.0);
cocos2d::CCPoint::operator+(v48, v43);
LOBYTE(v38) = 0;
v11 = IDNameInput::create(this, this + 68, 1, 2, &v51, v48, 6, 0, 1.0, 0, v38);
if ( (v51 & 1) != 0 )
operator delete(v53);
if ( v10 )
v12 = *(cocos2d::CCNode **)(v10 + 384);
else
v12 = nullptr;
*(this + 127) = v12;
if ( v11 )
v13 = *(cocos2d::CCNode **)(v11 + 384);
else
v13 = nullptr;
*(this + 128) = v13;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, -90.0, -25.0);
cocos2d::CCPoint::operator+(&v44, v43);
v15 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Target Count", "goldFont.fnt", v14);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), v15);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 160LL))(v15, 0.65);
v39 = *(void (__fastcall **)(__int64, cocos2d::CCDirector **))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 0.0, 30.0);
cocos2d::CCPoint::operator+(v48, &v44);
v39(v15, v48);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v48, 0.0, 0.0, 40.0, 40.0);
v16 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v48);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 912LL))(v16, 100);
v17 = *(void (__fastcall **)(__int64, cocos2d::CCDirector **))(*(_QWORD *)v16 + 960LL);
LOWORD(v48[0]) = 0;
BYTE2(v48[0]) = 0;
v17(v16, v48);
v40 = *(void (__fastcall **)(__int64, cocos2d::CCDirector **))(*(_QWORD *)v16 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v48, 50.0, 30.0);
v40(v16, v48);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(
*(this + 73),
v16,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL))(v16, &v44);
v19 = CCTextInputNode::create(
(CCTextInputNode *)"Num",
50.0,
40.0,
"Thonburi",
(const char *)&off_18,
"bigFont.fnt",
v18);
*(this + 129) = (cocos2d::CCNode *)v19;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v19, 20);
(*(void (__fastcall **)(_QWORD, __int64 *))(*(_QWORD *)*(this + 129) + 184LL))(*(this + 129), &v44);
CCTextInputNode::setMaxLabelScale(*(this + 129), 0.6);
CCTextInputNode::setMaxLabelWidth(*(this + 129), 200.0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)*(this + 129) + 72) + 344LL))(
*((_QWORD *)*(this + 129) + 72),
0);
*((_DWORD *)*(this + 129) + 148) = 6;
v51 = 0;
v20 = (__int64)*(this + 129);
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "0123456789-", 0xBu);
CCTextInputNode::setAllowedChars(v20, (__int64)&v51);
if ( (v51 & 1) != 0 )
operator delete(v53);
LOWORD(v41) = -21896;
BYTE2(v41) = -16;
CCTextInputNode::setLabelPlaceholderColor((__int64)*(this + 129), v41);
CCTextInputNode::setLabelPlaceholderScale(*(this + 129), 0.5);
*((_QWORD *)*(this + 129) + 73) = this + 68;
*((_BYTE *)*(this + 129) + 424) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 129) + 72LL))(*(this + 129), 1);
cocos2d::CCNode::convertToNodeSpace(&v45, *(this + 69), (const cocos2d::CCPoint *)&v44);
v22 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_leftBtn_001.png", v21);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v22 + 160LL))(v22, 1.1);
v23 = CCMenuItemSpriteExtra::create(v22, 0, (__int64)this, (__int64)SetupInstantCountPopup::onTargetCountArrow, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v23);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 72LL))(v23, 1);
v24 = *(void (__fastcall **)(__int64, cocos2d::CCDirector **))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, -50.0, 0.0);
cocos2d::CCPoint::operator+(v48, &v45);
v24(v23, v48);
CCMenuItemSpriteExtra::setSizeMult(v23, 2.0);
v26 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_rightBtn_001.png", v25);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v26 + 160LL))(v26, 1.1);
v27 = CCMenuItemSpriteExtra::create(v26, 0, (__int64)this, (__int64)SetupInstantCountPopup::onTargetCountArrow, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v27);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v27 + 72LL))(v27, 2);
v28 = *(void (__fastcall **)(__int64, cocos2d::CCDirector **))(*(_QWORD *)v27 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 50.0, 0.0);
cocos2d::CCPoint::operator+(v48, &v45);
v28(v27, v48);
CCMenuItemSpriteExtra::setSizeMult(v27, 2.0);
SetupInstantCountPopup::updateItemIDInputLabel((SetupInstantCountPopup *)this);
SetupInstantCountPopup::updateTargetIDInputLabel((SetupInstantCountPopup *)this);
SetupInstantCountPopup::updateCountTextInputLabel((SetupInstantCountPopup *)this);
SetupTriggerPopup::createMultiTriggerItemsDefault((SetupTriggerPopup *)this);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Activate\nGroup", 0xEu);
LODWORD(v28) = *((unsigned __int8 *)this + 1052);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 50.0, -20.0);
cocos2d::CCPoint::operator+(v48, v43);
SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v51,
(int)SetupInstantCountPopup::onEnableGroup,
0,
(int)v28,
(cocos2d::CCPoint *)v48);
if ( (v51 & 1) != 0 )
operator delete(v53);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v46,
(float)(*(float *)&v42 * 0.5) + -28.0,
(float)(*((float *)&v42 + 1) * 0.5) + -42.0);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Equals", 6u);
v29 = *((_DWORD *)this + 264) == 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, -90.0, 0.0);
cocos2d::CCPoint::operator+(v48, v46);
ToggleButton = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v51,
(int)SetupInstantCountPopup::onCountType,
0,
v29,
(cocos2d::CCPoint *)v48);
v31 = v51;
*(this + 133) = (cocos2d::CCNode *)ToggleButton;
if ( (v31 & 1) != 0 )
{
operator delete(v53);
ToggleButton = (__int64)*(this + 133);
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)ToggleButton + 72LL))(ToggleButton, 0);
*((_BYTE *)*(this + 133) + 393) = 1;
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Larger", 6u);
v32 = *((_DWORD *)this + 264) == 1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 0.0, 0.0);
cocos2d::CCPoint::operator+(v48, v46);
v33 = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v51,
(int)SetupInstantCountPopup::onCountType,
0,
v32,
(cocos2d::CCPoint *)v48);
v34 = v51;
*(this + 134) = (cocos2d::CCNode *)v33;
if ( (v34 & 1) != 0 )
{
operator delete(v53);
v33 = (__int64)*(this + 134);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v33 + 72LL))(v33, 1);
*((_BYTE *)*(this + 134) + 393) = 1;
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, "Smaller", 7u);
v35 = *((_DWORD *)this + 264) == 2;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 90.0, 0.0);
cocos2d::CCPoint::operator+(v48, v46);
v36 = SetupTriggerPopup::createToggleButton(
(int)this,
(int)&v51,
(int)SetupInstantCountPopup::onCountType,
0,
v35,
(cocos2d::CCPoint *)v48);
v37 = v51;
*(this + 135) = (cocos2d::CCNode *)v36;
if ( (v37 & 1) != 0 )
{
operator delete(v53);
v36 = (__int64)*(this + 135);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v36 + 72LL))(v36, 2);
*((_BYTE *)*(this + 135) + 393) = 1;
*((_BYTE *)this + 744) = 0;
}
return v5;
}