//
// SetupInstantCountPopup::init from 0x627d2c to 0x628482 (1878 bytes)
//
// 1 xrefs:
// > SetupInstantCountPopup::create @ 0x6286ac
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:55:10 +0000
//
int __fastcall SetupInstantCountPopup::init(
SetupInstantCountPopup *this,
CountTriggerGameObject *a2,
cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
float v5; // s15
int v6; // r7
int v7; // r8
int v8; // r3
const char *v9; // r2
int v10; // r7
void (__fastcall *v11)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)); // r10
int v12; // r11
void (__fastcall *v13)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)); // r2
int *v14; // r0
int v15; // r6
const char *v16; // r1
int v17; // r7
int v18; // r11
const char *v19; // r1
int v20; // r11
int v21; // r11
void (__fastcall *v22)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)); // r9
int v23; // r8
unsigned int v24; // r9
int v25; // r3
_BOOL4 v26; // r11
int v27; // r7
char *v29; // [sp+8h] [bp-BCh]
int v30; // [sp+24h] [bp-A0h]
void (__fastcall *v31)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)); // [sp+2Ch] [bp-98h]
void (__fastcall *v32)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)); // [sp+2Ch] [bp-98h]
int v33; // [sp+30h] [bp-94h]
float v34; // [sp+34h] [bp-90h] BYREF
float v35; // [sp+38h] [bp-8Ch]
_BYTE v36[8]; // [sp+3Ch] [bp-88h] BYREF
_BYTE v37[8]; // [sp+44h] [bp-80h] BYREF
_BYTE v38[8]; // [sp+4Ch] [bp-78h] BYREF
_BYTE v39[8]; // [sp+54h] [bp-70h] BYREF
_BYTE v40[8]; // [sp+5Ch] [bp-68h] BYREF
_BYTE v41[8]; // [sp+64h] [bp-60h] BYREF
int (__fastcall *v42)(SetupInstantCountPopup *, cocos2d::CCObject *); // [sp+6Ch] [bp-58h]
int v43; // [sp+70h] [bp-54h]
int (__fastcall *v44)(SetupInstantCountPopup *, cocos2d::CCObject *); // [sp+74h] [bp-50h]
int v45; // [sp+78h] [bp-4Ch]
unsigned int (__fastcall *v46)(unsigned int, cocos2d::CCObject *); // [sp+7Ch] [bp-48h]
int v47; // [sp+80h] [bp-44h]
unsigned int (__fastcall *v48)(SetupInstantCountPopup *, cocos2d::CCObject *); // [sp+84h] [bp-40h]
int v49; // [sp+88h] [bp-3Ch]
unsigned int (__fastcall *v50)(SetupInstantCountPopup *, cocos2d::CCObject *); // [sp+8Ch] [bp-38h] BYREF
int v51; // [sp+90h] [bp-34h]
int v52[3]; // [sp+94h] [bp-30h] BYREF
int v53; // [sp+A0h] [bp-24h] BYREF
int v54; // [sp+A4h] [bp-20h]
int v55; // [sp+A8h] [bp-1Ch]
unsigned int (__fastcall *v56)(SetupInstantCountPopup *, cocos2d::CCObject *); // [sp+ACh] [bp-18h] BYREF
int v57; // [sp+B0h] [bp-14h]
v30 = SetupTriggerPopup::init(this, a2, a3, 400.0, 280.0, 1, 0.0);
if ( v30 )
{
(*(void (__fastcall **)(SetupInstantCountPopup *))(*(_DWORD *)this + 680))(this);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Instant Count Trigger", 0x15u);
SetupTriggerPopup::addTitle(this, &v53);
std::string::~string((int)&v53);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "OK", 2u);
SetupTriggerPopup::addCloseButton(this, &v53);
std::string::~string((int)&v53);
memset(v52, 0, sizeof(v52));
std::string::__init(v52, "Help", 4u);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(
&v53,
"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, v52, &v53, 1065353216);
std::string::~string((int)&v53);
v4 = (cocos2d::CCDirector *)std::string::~string((int)v52);
cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v34);
v5 = v34;
*((_DWORD *)this + 125) = -1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v5 * 0.5, (float)(v35 * 0.5) + 25.0);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Item ID", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -90.0, 40.0);
cocos2d::CCPoint::operator+(&v56, v36, &v50);
v6 = IDNameInput::create((int)this, (int)this + 440, 2, 0, (int)&v53, (int)&v56, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v53);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Target ID", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 90.0, 40.0);
cocos2d::CCPoint::operator+(&v56, v36, &v50);
v7 = IDNameInput::create((int)this, (int)this + 440, 1, 2, (int)&v53, (int)&v56, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v53);
if ( v6 )
v6 = *(_DWORD *)(v6 + 300);
*((_DWORD *)this + 178) = v6;
if ( v7 )
v8 = *(_DWORD *)(v7 + 300);
else
v8 = 0;
*((_DWORD *)this + 179) = v8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v56, -90.0, -25.0);
cocos2d::CCPoint::operator+(v37, v36, &v56);
v10 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Target Count", "goldFont.fnt", v9);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v10);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v10 + 80))(v10, 1059481190);
v11 = *(void (__fastcall **)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)))(*(_DWORD *)v10 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 0.0, 30.0);
cocos2d::CCPoint::operator+(&v56, v37, &v50);
v11(v10, &v56);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v56, 0.0, 0.0, 40.0, 40.0);
v12 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", &v56);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v12 + 456))(v12, 100);
v13 = *(void (__fastcall **)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)))(*(_DWORD *)v12 + 480);
LOWORD(v56) = 0;
BYTE2(v56) = 0;
v13(v12, &v56);
v31 = *(void (__fastcall **)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)))(*(_DWORD *)v12 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v56, 50.0, 30.0);
v31(v12, &v56);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v12, -1);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v12 + 92))(v12, v37);
v14 = CCTextInputNode::create(
(CCTextInputNode *)0x42480000,
40.0,
"Num",
"Thonburi",
(const char *)&dword_18,
"bigFont.fnt",
v29);
*((_DWORD *)this + 180) = v14;
(*(void (__fastcall **)(_DWORD, int *, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v14, 20);
(*(void (__fastcall **)(_DWORD, _BYTE *))(**((_DWORD **)this + 180) + 92))(*((_DWORD *)this + 180), v37);
CCTextInputNode::setMaxLabelScale(*((_DWORD *)this + 180), 0.6);
CCTextInputNode::setMaxLabelWidth(*((_DWORD *)this + 180), 200.0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(*((_DWORD *)this + 180) + 416) + 172))(
*(_DWORD *)(*((_DWORD *)this + 180) + 416),
0);
*(_DWORD *)(*((_DWORD *)this + 180) + 424) = 6;
v15 = *((_DWORD *)this + 180);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "0123456789-", 0xBu);
CCTextInputNode::setAllowedChars(v15, (unsigned __int8 *)&v53);
std::string::~string((int)&v53);
LOWORD(v33) = -21896;
BYTE2(v33) = -16;
CCTextInputNode::setLabelPlaceholderColor(*((_DWORD *)this + 180), v33);
CCTextInputNode::setLabelPlaceholderScale(*((_DWORD *)this + 180), 0.5);
*(_DWORD *)(*((_DWORD *)this + 180) + 420) = (char *)this + 440;
*(_BYTE *)(*((_DWORD *)this + 180) + 324) = 1;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 180) + 36))(*((_DWORD *)this + 180), 1);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v38, *((const cocos2d::CCPoint **)this + 111));
v17 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_leftBtn_001.png", v16);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 80))(v17, 1066192077);
v42 = SetupInstantCountPopup::onTargetCountArrow;
v43 = 0;
v18 = CCMenuItemSpriteExtra::create(v17, 0, (int)this, (int)SetupInstantCountPopup::onTargetCountArrow, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v18);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 36))(v18, 1);
v32 = *(void (__fastcall **)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -50.0, 0.0);
cocos2d::CCPoint::operator+(&v56, v38, &v50);
v32(v18, &v56);
CCMenuItemSpriteExtra::setSizeMult(v18, 2.0);
v20 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_rightBtn_001.png", v19);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v20 + 80))(v20, 1066192077);
v44 = SetupInstantCountPopup::onTargetCountArrow;
v45 = 0;
v21 = CCMenuItemSpriteExtra::create(v20, 0, (int)this, (int)SetupInstantCountPopup::onTargetCountArrow, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v21);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v21 + 36))(v21, 2);
v22 = *(void (__fastcall **)(int, unsigned int (__fastcall **)(SetupInstantCountPopup *, cocos2d::CCObject *)))(*(_DWORD *)v21 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 50.0, 0.0);
cocos2d::CCPoint::operator+(&v56, v38, &v50);
v22(v21, &v56);
CCMenuItemSpriteExtra::setSizeMult(v21, 2.0);
SetupInstantCountPopup::updateItemIDInputLabel(this);
SetupInstantCountPopup::updateTargetIDInputLabel(this);
SetupInstantCountPopup::updateCountTextInputLabel(this);
SetupTriggerPopup::createMultiTriggerItemsDefault(this);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Activate\nGroup", 0xEu);
v47 = 0;
v46 = SetupInstantCountPopup::onEnableGroup;
v23 = *((unsigned __int8 *)this + 736);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, 50.0, -20.0);
cocos2d::CCPoint::operator+(&v56, v36, &v50);
SetupTriggerPopup::createToggleButton(this, &v53, v46, v47, v23, &v56);
std::string::~string((int)&v53);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, (float)(v34 * 0.5) - 28.0, (float)(v35 * 0.5) - 42.0);
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Equals", 6u);
v24 = __clz(*((_DWORD *)this + 185));
v49 = 0;
v48 = SetupInstantCountPopup::onCountType;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v50, -90.0, 0.0);
cocos2d::CCPoint::operator+(&v56, v39, &v50);
*((_DWORD *)this + 186) = SetupTriggerPopup::createToggleButton(this, &v53, v48, v49, v24 >> 5, &v56);
std::string::~string((int)&v53);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 186) + 36))(*((_DWORD *)this + 186), 0);
*(_BYTE *)(*((_DWORD *)this + 186) + 309) = 1;
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Larger", 6u);
v25 = *((_DWORD *)this + 185);
v51 = 0;
v50 = SetupInstantCountPopup::onCountType;
v26 = v25 == 1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v56, v39, v41);
*((_DWORD *)this + 187) = SetupTriggerPopup::createToggleButton(this, &v53, v50, v51, v26, &v56);
std::string::~string((int)&v53);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 187) + 36))(*((_DWORD *)this + 187), 1);
*(_BYTE *)(*((_DWORD *)this + 187) + 309) = 1;
v53 = 0;
v54 = 0;
v55 = 0;
std::string::__init(&v53, "Smaller", 7u);
v57 = 0;
v27 = *((_DWORD *)this + 185);
v56 = SetupInstantCountPopup::onCountType;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, 90.0, 0.0);
cocos2d::CCPoint::operator+(v41, v39, v40);
*((_DWORD *)this + 188) = SetupTriggerPopup::createToggleButton(this, &v53, v56, v57, v27 == 2, v41);
std::string::~string((int)&v53);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 188) + 36))(*((_DWORD *)this + 188), 2);
*(_BYTE *)(*((_DWORD *)this + 188) + 309) = 1;
*((_BYTE *)this + 568) = 0;
}
return v30;
}