//
// SetupCountTriggerPopup::init from 0x1002a93f0 to 0x1002a98c3 (1235 bytes)
//
// 1 xrefs:
// > sub_1002A92E0 @ 0x1002a93a4
//
// 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:27:57 +0000
//
__int64 __fastcall SetupCountTriggerPopup::init(float *a1, __int64 a2, __int64 a3)
{
float *v3; // rbx
__int64 result; // rax
unsigned int v5; // r15d
__int64 v6; // rax
char v7; // [rsp+38h] [rbp-E8h] BYREF
char v8[15]; // [rsp+39h] [rbp-E7h] BYREF
void *v9; // [rsp+48h] [rbp-D8h]
__int128 v10; // [rsp+50h] [rbp-D0h] BYREF
void *v11; // [rsp+60h] [rbp-C0h]
__int128 v12; // [rsp+68h] [rbp-B8h] BYREF
void *v13; // [rsp+78h] [rbp-A8h]
char v14; // [rsp+80h] [rbp-A0h] BYREF
_BYTE v15[23]; // [rsp+81h] [rbp-9Fh] BYREF
std::string v16; // [rsp+98h] [rbp-88h] BYREF
__int128 v17; // [rsp+B0h] [rbp-70h] BYREF
void *v18; // [rsp+C0h] [rbp-60h]
__int128 v19; // [rsp+C8h] [rbp-58h] BYREF
void *v20; // [rsp+D8h] [rbp-48h]
float v21; // [rsp+E0h] [rbp-40h] BYREF
float v22[4]; // [rsp+E8h] [rbp-38h] BYREF
void *v23; // [rsp+F8h] [rbp-28h]
float v24; // [rsp+100h] [rbp-20h] BYREF
float v25; // [rsp+104h] [rbp-1Ch]
v3 = a1;
result = SetupTriggerPopup::init((__int64)a1, a2, a3, 1, 380.0, 240.0, 0.0);
if ( (_BYTE)result )
{
v5 = result;
SetupTriggerPopup::preSetup(a1);
v14 = 26;
strcpy(v15, "Count Trigger");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v14);
if ( (v14 & 1) != 0 )
operator delete(*(void **)&v15[15]);
v7 = 4;
strcpy(v8, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v7);
if ( (v7 & 1) != 0 )
operator delete(v9);
LOBYTE(v10) = 8;
strcpy((char *)&v10 + 1, "Help");
v13 = operator new(0x120u);
*(_QWORD *)&v12 = 289;
*((_QWORD *)&v12 + 1) = 287;
strcpy(
(char *)v13,
"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.");
SetupTriggerPopup::addHelpButton((__int64)a1, &v10, &v12, 1.0);
if ( (v12 & 1) != 0 )
{
a1 = (float *)v13;
operator delete(v13);
}
if ( (v10 & 1) != 0 )
{
a1 = (float *)v11;
operator delete(v11);
}
v6 = cocos2d::CCDirector::sharedDirector(a1, &v10);
cocos2d::CCDirector::getWinSize(&v24, v6);
LOBYTE(v22[0]) = 14;
strcpy((char *)v22 + 1, "Item ID");
sub_100278250(&v21, (float)(v24 * 0.5) + -90.0, (float)(v25 * 0.5) + 40.0);
IDNameInput::create((_DWORD)v3, (_DWORD)v3 + 544, 2, 80, (unsigned int)v22, (unsigned int)&v21, 6, 0, 0, 0);
if ( (LOBYTE(v22[0]) & 1) != 0 )
operator delete(v23);
LOBYTE(v22[0]) = 18;
strcpy((char *)v22 + 1, "Target ID");
sub_100278250(&v21, (float)(v24 * 0.5) + 90.0, (float)(v25 * 0.5) + 40.0);
IDNameInput::create((_DWORD)v3, (_DWORD)v3 + 544, 1, 51, (unsigned int)v22, (unsigned int)&v21, 6, 0, 0, 0);
if ( (LOBYTE(v22[0]) & 1) != 0 )
operator delete(v23);
v16.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)24;
strcpy(v16.__r_.__value_.__s.__data_, "Target Count");
sub_100278250(v22, (float)(v24 * 0.5) + -90.0, (float)(v25 * 0.5) + -25.0);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)v3,
77,
&v16,
(__int64)v22,
1,
2u,
0.80000001,
0.0,
100.0,
6u,
1,
1u,
0,
0,
2u,
0);
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v16.__r_.__value_.__l.__data_);
SetupTriggerPopup::createMultiTriggerItemsDefault(v3, 77);
LOBYTE(v17) = 28;
strcpy((char *)&v17 + 1, "Activate\nGroup");
sub_100278250(v22, (float)(v24 * 0.5) + 50.0, (float)(v25 * 0.5) + -10.0);
SetupTriggerPopup::createToggleValueControl((int)v3, 56, &v17, (__int64)v22, 0, 0, 1.0, 0);
if ( (v17 & 1) != 0 )
operator delete(v18);
LOBYTE(v19) = 28;
strcpy((char *)&v19 + 1, "Multi\nActivate");
sub_100278250(v22, (float)(v24 * 0.5) + 50.0, (float)(0.5 * v25) + -45.0);
SetupTriggerPopup::createToggleValueControl((int)v3, 104, &v19, (__int64)v22, 0, 0, 1.0, 0);
if ( (v19 & 1) != 0 )
operator delete(v20);
SetupTriggerPopup::postSetup(v3);
return v5;
}
return result;
}