//
// SetupSpawnPopup::init from 0x14045e0c0 to 0x14045ee45 (3461 bytes)
//
// 2 xrefs:
// > SetupSpawnPopup::create @ 0x14045e078
// > ??> @ 0x1406dacf4
//
// 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
//
// Hidden C++ exception states: #wind=7
bool SetupSpawnPopup::init(SetupSpawnPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
_QWORD *v5; // r8
_OWORD *v6; // rcx
const char *v7; // rax
__int64 v8; // rdx
double v9; // xmm0_8
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
double ToggleValueControl; // xmm0_8
__int64 v13; // rcx
cocos2d::CCArray *v14; // rax
cocos2d::CCSprite *v15; // rdi
ButtonSprite *v16; // rbx
int v17; // r9d
CCMenuItemSpriteExtra *v18; // rdi
float v19; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v20; // rbx
struct cocos2d::CCPoint v21; // rax
cocos2d::CCArray *PageContainer; // rax
cocos2d::CCSprite *v23; // rdi
ButtonSprite *v24; // rbx
int v25; // r9d
CCMenuItemSpriteExtra *v26; // rdi
float v27; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v28; // rbx
struct cocos2d::CCPoint v29; // rax
cocos2d::CCArray *v30; // rax
__int64 v31; // rax
ButtonSprite *v32; // rbx
CCMenuItemSpriteExtra *v33; // rdi
CCMenuItemSpriteExtra_vtbl *v34; // rbx
struct cocos2d::CCPoint v35; // rax
cocos2d::CCArray *v36; // rax
struct cocos2d::CCRect *v37; // rax
struct cocos2d::extension::CCScale9Sprite *v38; // rdi
__int64 v39; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v40; // rbx
const cocos2d::CCSize *v41; // rax
cocos2d::CCArray *v42; // rax
int v43; // r8d
bool v44; // [rsp+38h] [rbp-D0h]
__int64 v45; // [rsp+80h] [rbp-88h]
__int64 v46; // [rsp+80h] [rbp-88h]
__int64 v47; // [rsp+80h] [rbp-88h]
__int128 *v48; // [rsp+88h] [rbp-80h] BYREF
__int128 v49; // [rsp+90h] [rbp-78h] BYREF
__int64 v50; // [rsp+A0h] [rbp-68h]
__int64 v51; // [rsp+A8h] [rbp-60h]
ButtonSprite *v52; // [rsp+B0h] [rbp-58h] BYREF
float v53; // [rsp+B8h] [rbp-50h]
cocos2d::CCRect v54; // [rsp+C0h] [rbp-48h] BYREF
__int64 v55; // [rsp+D0h] [rbp-38h]
__int64 v56; // [rsp+D8h] [rbp-30h]
_BYTE v57[136]; // [rsp+E0h] [rbp-28h] BYREF
char v58; // [rsp+1A0h] [rbp+98h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( result )
{
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
v55 = 11;
v56 = 15;
v54.origin = (cocos2d::CCPoint)0x7247206E77617053LL;
v54.size = (cocos2d::CCSize)7370095LL;
SetupTriggerPopup::addTitle(a1, &v54);
v49 = 0;
v50 = 2;
v51 = 15;
strcpy((char *)&v49, "OK");
SetupTriggerPopup::addCloseButton(a1, &v49);
v48 = &v49;
v49 = 0;
v50 = 0;
v51 = 15;
v5 = sub_14003AA10(0x170u);
*(_QWORD *)&v49 = v5;
v50 = 360;
v51 = 367;
v6 = v5;
v7 = "Activates other triggers simultaneously regardless of X position. These triggers need to use Group ID a"
"nd have Spawn Trigger enabled.\n"
"Preview Disable disables activation while not playtesting in editor.\n"
"Spawn Ordered spawns the triggers in order from left to right.\n"
"Use remapping (page 2) to copy a Spawn setup to another group.";
v8 = 2;
do
{
*v6 = *(_OWORD *)v7;
v6[1] = *((_OWORD *)v7 + 1);
v6[2] = *((_OWORD *)v7 + 2);
v6[3] = *((_OWORD *)v7 + 3);
v6[4] = *((_OWORD *)v7 + 4);
v6[5] = *((_OWORD *)v7 + 5);
v6[6] = *((_OWORD *)v7 + 6);
v6 += 8;
*(v6 - 1) = *((_OWORD *)v7 + 7);
v7 += 128;
--v8;
}
while ( v8 );
*v6 = *(_OWORD *)v7;
v6[1] = *((_OWORD *)v7 + 1);
v6[2] = *((_OWORD *)v7 + 2);
v6[3] = *((_OWORD *)v7 + 3);
v6[4] = *((_OWORD *)v7 + 4);
v6[5] = *((_OWORD *)v7 + 5);
*((_QWORD *)v6 + 12) = *((_QWORD *)v7 + 12);
*((_BYTE *)v5 + 360) = 0;
v54 = 0;
v55 = 4;
v56 = 15;
strcpy((char *)&v54, "Help");
v9 = SetupTriggerPopup::addHelpButton(a1, &v54, &v49);
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
cocos2d::CCPoint::CCPoint(*(float *)&v9, v53 * 0.5);
v54.origin = (cocos2d::CCPoint)&v49;
v50 = 8;
v51 = 15;
v49 = 0x44492070756F7247uLL;
cocos2d::CCPoint::CCPoint(0.0, -50.0);
cocos2d::CCPoint::operator+(&v58, &v48);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
51,
(unsigned int)&v49,
(unsigned int)&v48,
1063675494,
1,
3,
6,
1,
0,
1120403456,
0,
0,
0,
2,
0,
v48);
v52 = (ButtonSprite *)&v49;
v49 = 0;
v50 = 6;
v51 = 15;
strcpy((char *)&v49, "Delay:");
cocos2d::CCPoint::CCPoint(0.0, -85.0);
cocos2d::CCPoint::operator+(&v58, &v48);
LOBYTE(v45) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
63,
(unsigned int)&v49,
(unsigned int)&v48,
1060320051,
0,
1,
10,
0,
0,
1065353216,
0,
0,
1,
5,
v45);
v52 = (ButtonSprite *)&v49;
v49 = 0;
v50 = 2;
v51 = 15;
strcpy((char *)&v49, "+-");
cocos2d::CCPoint::CCPoint(0.0, 80.0);
cocos2d::CCPoint::operator+(&v58, &v48);
LOBYTE(v46) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
556,
(unsigned int)&v49,
(unsigned int)&v48,
1060320051,
0,
1,
10,
0,
0,
1065353216,
0,
0,
1,
5,
v46);
v52 = (ButtonSprite *)&v49;
v50 = 15;
v51 = 15;
strcpy((char *)&v49, "Preview\nDisable");
cocos2d::CCPoint::CCPoint(1.1634321e33, 50.0);
cocos2d::CCPoint::operator+(&v58, &v48);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
102,
(unsigned int)&v49,
(unsigned int)&v48,
0,
0,
0,
1065353216);
v52 = (ButtonSprite *)&v49;
v50 = 13;
v51 = 15;
strcpy((char *)&v49, "Spawn\nOrdered");
HIWORD(v49) = 0;
cocos2d::CCPoint::CCPoint(4.5724414e33, 50.0);
cocos2d::CCPoint::operator+(&v58, &v48);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
441,
(unsigned int)&v49,
(unsigned int)&v48,
0,
0,
0,
1065353216);
v52 = (ButtonSprite *)&v49;
v50 = 11;
v51 = 15;
*(_QWORD *)&v49 = 0x65520A7465736552LL;
*((_QWORD *)&v49 + 1) = 7364973;
cocos2d::CCPoint::CCPoint(7.1837755e22, 50.0);
cocos2d::CCPoint::operator+(&v58, &v48);
ToggleValueControl = SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
581,
(unsigned int)&v49,
(unsigned int)&v48,
0,
0,
0,
1065353216);
cocos2d::CCPoint::CCPoint(*(float *)&ToggleValueControl, v53 * 0.5);
v14 = (cocos2d::CCArray *)cocos2d::CCArray::create(v13);
a1->m_remapButtons = v14;
cocos2d::CCObject::retain(v14);
v52 = (ButtonSprite *)&v49;
v50 = 11;
v51 = 15;
*(_QWORD *)&v49 = 0x6C616E696769724FLL;
*((_QWORD *)&v49 + 1) = 3818569;
cocos2d::CCPoint::CCPoint(1.10242e24, -100.0);
cocos2d::CCPoint::operator+(v57, &v48);
LOBYTE(v47) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
-1,
(unsigned int)&v49,
(unsigned int)&v48,
1060320051,
1,
3,
6,
1,
0,
1120403456,
1,
0,
0,
2,
v47);
v52 = (ButtonSprite *)&v49;
v49 = 0;
v50 = 6;
v51 = 15;
strcpy((char *)&v49, "NewID:");
cocos2d::CCPoint::CCPoint(0.0, 20.0);
cocos2d::CCPoint::operator+(v57, &v48);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
-2,
(unsigned int)&v49,
(unsigned int)&v48,
1060320051,
1,
3,
6,
1,
0,
1120403456,
1,
0,
0,
2);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("edit_addCBtn_001.png");
v52 = (ButtonSprite *)operator new(0x2C0u);
v16 = ButtonSprite::ButtonSprite(v52);
if ( v16 )
{
if ( ButtonSprite::init(v16, v15, 32, v17, 32.0, 1.0, v44, "GJ_button_01.png", 1) )
{
cocos2d::CCObject::autorelease(v16);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v16->~ButtonSprite)(v16, 1);
v16 = nullptr;
}
}
v18 = CCMenuItemSpriteExtra::create(v16, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupSpawnPopup::onAddRemap);
((void (__fastcall *)(CCMenuItemSpriteExtra *))v18->setScale_0)(v18);
HIDWORD(v18->m_pDisabledImage) = 1058642330;
v19 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v18);
cocos2d::CCPoint::CCPoint(v19, 120.0);
cocos2d::CCPoint::operator+(v57, &v48);
v20 = v18->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v21 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v54.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v20->setPosition_0)(v18, v21);
PageContainer = SetupTriggerPopup::getPageContainer(a1, 1);
cocos2d::CCArray::addObject(PageContainer, v18);
v23 = cocos2d::CCSprite::createWithSpriteFrameName("edit_delCBtn_001.png");
v52 = (ButtonSprite *)operator new(0x2C0u);
v24 = ButtonSprite::ButtonSprite(v52);
if ( v24 )
{
if ( ButtonSprite::init(v24, v23, 32, v25, 32.0, 1.0, v44, "GJ_button_06.png", 1) )
{
cocos2d::CCObject::autorelease(v24);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v24->~ButtonSprite)(v24, 1);
v24 = nullptr;
}
}
v26 = CCMenuItemSpriteExtra::create(v24, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupSpawnPopup::onDeleteRemap);
((void (__fastcall *)(CCMenuItemSpriteExtra *))v26->setScale_0)(v26);
HIDWORD(v26->m_pDisabledImage) = 1058642330;
v27 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v26);
cocos2d::CCPoint::CCPoint(v27, 150.0);
cocos2d::CCPoint::operator+(v57, &v48);
v28 = v26->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v29 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v54.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v28->setPosition_0)(v26, v29);
v30 = SetupTriggerPopup::getPageContainer(a1, 1);
cocos2d::CCArray::addObject(v30, v26);
v31 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v52 = (ButtonSprite *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v52);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = qword_1406C2ED8;
}
if ( *(_QWORD *)(*(_QWORD *)(v31 + 528) + 15088LL) )
{
v52 = (ButtonSprite *)operator new(0x2C0u);
v32 = ButtonSprite::ButtonSprite(v52);
if ( v32 )
{
if ( ButtonSprite::init_1(v32, "Paste", 30, 0, 0.5, 1, "goldFont.fnt", "GJ_button_04.png", 30.0) )
{
cocos2d::CCObject::autorelease(v32);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v32->~ButtonSprite)(v32, 1);
v32 = nullptr;
}
}
((void (__fastcall *)(ButtonSprite *))v32->setScale_0)(v32);
v33 = CCMenuItemSpriteExtra::create(v32, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupSpawnPopup::onPasteRemap);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v33);
v34 = v33->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v53 * 0.5, (float)((float)(a1->m_width * 0.5) + (float)(v53 * 0.5)) - 25.0);
v35 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v54.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v34->setPosition_0)(v33, v35);
v36 = SetupTriggerPopup::getPageContainer(a1, 1);
cocos2d::CCArray::addObject(v36, v33);
}
cocos2d::CCRect::CCRect(&v54, 0.0, 0.0, 80.0, 80.0);
v38 = cocos2d::extension::CCScale9Sprite::create("square02_001.png", v37);
LOBYTE(v39) = 50;
v38->setOpacity(&v38->cocos2d::CCRGBAProtocol, v39);
v40 = v38->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v52, 360.0, 90.0);
v40->setContentSize(v38, v41);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v38, -1);
v38->setPosition_0(v38, (const cocos2d::CCPoint *)v57);
v42 = SetupTriggerPopup::getPageContainer(a1, 1);
cocos2d::CCArray::addObject(v42, v38);
SetupSpawnPopup::updateRemapButtons(a1, 0.0);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
SetupTriggerPopup::createPageButtons(a1, (float)(a1->m_width * 0.5) + 15.0, v43);
SetupTriggerPopup::goToPage(a1, 0, 0);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
return 1;
}
return result;
}