//
// SetupTriggerPopup::createMultiTriggerItems from 0x9e5700 to 0x9e5acc (972 bytes)
//
// 7 xrefs:
// > SetupRandTriggerPopup::init @ 0x96d69c
// > SetupRandAdvTriggerPopup::init @ 0x9b0214
// > SetupTriggerPopup::createMultiTriggerItemsDefault @ 0x9e5bcc
// > SetupTriggerPopup::createMultiTriggerItemsCorner @ 0x9e5cf8
// > SetupTriggerPopup::createMultiTriggerItemsDefaultVertical @ 0x9e5e20
// > SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal @ 0x9e5f48
// > ??> @ 0x94308
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void SetupTriggerPopup::createMultiTriggerItems(
SetupTriggerPopup *a1,
cocos2d::CCPoint a2,
cocos2d::CCPoint a3,
cocos2d::CCPoint a4)
{
const cocos2d::CCPoint *v4; // x1
const cocos2d::CCPoint *v5; // x2
cocos2d::CCPoint *v6; // x3
const cocos2d::CCPoint *v8; // x22
const cocos2d::CCPoint *v9; // x25
cocos2d::CCMenu *m_buttonMenu; // x28
cocos2d::CCLayer *m_mainLayer; // x27
void *v12; // x0
cocos2d::CCMenu *v13; // x28
cocos2d::CCLayer *v14; // x27
void *v15; // x0
bool m_multiTriggered; // w24
cocos2d::CCMenu *v17; // x28
cocos2d::CCLayer *v18; // x27
void *v19; // x22
unsigned int *v20; // x1
int v21; // w2
unsigned int *v22; // x1
int v23; // w2
unsigned int *v24; // x21
int v25; // w0
cocos2d::CCPoint *v26; // [xsp+B0h] [xbp+80h]
bool m_touchTriggered; // [xsp+BCh] [xbp+8Ch]
bool m_spawnTriggered; // [xsp+BCh] [xbp+8Ch]
cocos2d::CCPoint v29; // [xsp+D0h] [xbp+A0h] BYREF
__int64 v30; // [xsp+D8h] [xbp+A8h] BYREF
cocos2d::CCPoint v31; // [xsp+E0h] [xbp+B0h] BYREF
v8 = v4;
v26 = v6;
v9 = v5;
sub_D153B8((int)&v30, "Touch\nTrigger");
m_touchTriggered = a1->m_touchTriggered;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v31, v8);
m_mainLayer = a1->m_mainLayer;
cocos2d::CCPoint::CCPoint(&v29, 8.0, 0.0);
a1->m_touchToggle = GameToolbox::createToggleButton(
0.7,
0.35,
110.0,
(__int64)&v30,
(void (__cdecl *)(cocos2d::CCObject *))SetupTriggerPopup::onTouchTriggered,
0,
m_touchTriggered,
m_buttonMenu,
&v31,
a1,
m_mainLayer,
(float *)&v29,
(__int64)"bigFont.fnt",
0,
0,
nullptr);
v12 = (void *)(v30 - 24);
if ( (__int64 *)(v30 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v20 = (unsigned int *)(v30 - 8);
do
v21 = __ldaxr(v20);
while ( __stlxr(v21 - 1, v20) );
}
else
{
v21 = *(_DWORD *)(v30 - 8);
*(_DWORD *)(v30 - 8) = v21 - 1;
}
if ( v21 <= 0 )
operator delete(v12);
}
sub_D153B8((int)&v30, "Spawn\nTrigger");
v13 = a1->m_buttonMenu;
m_spawnTriggered = a1->m_spawnTriggered;
cocos2d::CCPoint::CCPoint(&v31, v9);
v14 = a1->m_mainLayer;
cocos2d::CCPoint::CCPoint(&v29, 8.0, 0.0);
a1->m_spawnToggle = GameToolbox::createToggleButton(
0.7,
0.35,
110.0,
(__int64)&v30,
(void (__cdecl *)(cocos2d::CCObject *))SetupTriggerPopup::onSpawnedByTrigger,
0,
m_spawnTriggered,
v13,
&v31,
a1,
v14,
(float *)&v29,
(__int64)"bigFont.fnt",
0,
0,
nullptr);
v15 = (void *)(v30 - 24);
if ( (__int64 *)(v30 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v30 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *(_DWORD *)(v30 - 8);
*(_DWORD *)(v30 - 8) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v15);
}
sub_D153B8((int)&v30, "Multi\nTrigger");
m_multiTriggered = a1->m_multiTriggered;
v17 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v31, v26);
v18 = a1->m_mainLayer;
cocos2d::CCPoint::CCPoint(&v29, 8.0, 0.0);
GameToolbox::createToggleButton(
0.7,
0.35,
110.0,
(__int64)&v30,
(void (__cdecl *)(cocos2d::CCObject *))SetupTriggerPopup::onMultiTrigger,
0,
m_multiTriggered,
v17,
&v31,
a1,
v18,
(float *)&v29,
(__int64)"bigFont.fnt",
0,
0,
a1->m_multiTriggerContainer);
v19 = (void *)(v30 - 24);
if ( (__int64 *)(v30 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v30 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v30 - 8);
*(_DWORD *)(v30 - 8) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v19);
}
SetupTriggerPopup::updateMultiTriggerBtn(a1);
}