//
// SetupCountTriggerPopup::init from 0xa9d07c to 0xa9d538 (1212 bytes)
//
// 2 xrefs:
// > SetupCountTriggerPopup::create @ 0xa9d774
// > ??> @ 0xc2050
//
// 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:46 +0000
//
__int64 __fastcall SetupCountTriggerPopup::init(
SetupCountTriggerPopup *this,
EffectGameObject *a2,
cocos2d::CCArray *a3)
{
unsigned __int8 v4; // w0
unsigned int v5; // w23
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
int v9; // [xsp+8h] [xbp-28h]
__int64 v10; // [xsp+88h] [xbp+58h] BYREF
_BYTE v11[8]; // [xsp+90h] [xbp+60h] BYREF
cocos2d::CCDirector *v12[2]; // [xsp+98h] [xbp+68h] BYREF
void *v13; // [xsp+A8h] [xbp+78h]
__int64 v14; // [xsp+B0h] [xbp+80h] BYREF
__int64 v15; // [xsp+B8h] [xbp+88h]
void *v16; // [xsp+C0h] [xbp+90h]
v4 = SetupTriggerPopup::init(this, a2, a3, 380.0, 240.0, 1, 0.0);
v5 = v4;
if ( v4 )
{
SetupTriggerPopup::preSetup(this);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Count Trigger", 0xDu);
SetupTriggerPopup::addTitle(this, &v14);
if ( (v14 & 1) != 0 )
operator delete(v16);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "OK", 2u);
SetupTriggerPopup::addCloseButton(this, &v14);
if ( (v14 & 1) != 0 )
operator delete(v16);
v12[0] = nullptr;
v12[1] = nullptr;
v13 = nullptr;
std::string::__init((__int64 *)v12, "Help", 4u);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(
&v14,
"Disable objects using Target ID when an Item ID reaches a certain Target Count. The condit"
"ion is checked constantly.\n"
"Activate Group makes the trigger enable and spawn the group instead.\n"
"Multi Activate allows the trigger to activate more than once.",
0x11Fu);
SetupTriggerPopup::addHelpButton(this, v12, &v14, 1.0);
if ( (v14 & 1) != 0 )
operator delete(v16);
v7 = (cocos2d::CCDirector *)LOBYTE(v12[0]);
if ( ((__int64)v12[0] & 1) != 0 )
operator delete(v13);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(&v10, v8);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Item ID", 7u);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v11,
(float)(*(float *)&v10 * 0.5) + -90.0,
(float)(*((float *)&v10 + 1) * 0.5) + 40.0);
IDNameInput::create(this, (char *)this + 544, 2, 80, &v14, v11, 6, 0, 1.0, 0, 0);
if ( (v14 & 1) != 0 )
operator delete(v16);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Target ID", 9u);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v11,
(float)(*(float *)&v10 * 0.5) + 90.0,
(float)(*((float *)&v10 + 1) * 0.5) + 40.0);
LOBYTE(v9) = 0;
IDNameInput::create(this, (char *)this + 544, 1, 51, &v14, v11, 6, 0, 1.0, 0, v9);
if ( (v14 & 1) != 0 )
operator delete(v16);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Target Count", 0xCu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v11,
(float)(*(float *)&v10 * 0.5) + -90.0,
(float)(*((float *)&v10 + 1) * 0.5) + -25.0);
SetupTriggerPopup::createValueControlAdvanced(this, 77, &v14, v11, 1, 2, 6, 1, 0.8, 0.0, 100.0, 1, 0, 0, 2, 0);
if ( (v14 & 1) != 0 )
operator delete(v16);
SetupTriggerPopup::createMultiTriggerItemsDefault(this);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Activate\nGroup", 0xEu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v11,
(float)(*(float *)&v10 * 0.5) + 50.0,
(float)(*((float *)&v10 + 1) * 0.5) + -10.0);
SetupTriggerPopup::createToggleValueControl(this, 56, &v14, v11, 0, 0, 0, 1.0);
if ( (v14 & 1) != 0 )
operator delete(v16);
v14 = 0;
v15 = 0;
v16 = nullptr;
std::string::__init(&v14, "Multi\nActivate", 0xEu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v11,
(float)(*(float *)&v10 * 0.5) + 50.0,
(float)(*((float *)&v10 + 1) * 0.5) + -45.0);
SetupTriggerPopup::createToggleValueControl(this, 104, &v14, v11, 0, 0, 0, 1.0);
if ( (v14 & 1) != 0 )
operator delete(v16);
SetupTriggerPopup::postSetup(this);
}
return v5;
}