//
// SetupSFXPopup::init from 0x5762fc to 0x576c96 (2458 bytes)
//
// 1 xrefs:
// > SetupSFXPopup::create @ 0x576d50
//
// 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
//
bool SetupSFXPopup::init(SetupSFXPopup *a1, SFXTriggerGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r10
cocos2d::CCDirector *v5; // r0
cocos2d::CCSprite *v6; // r8
CCMenuItemSpriteExtra *v7; // r9
cocos2d::CCMenu *m_buttonMenu; // r11
float v9; // r0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-48h]
cocos2d::CCSize v12; // [sp+3Ch] [bp-40h] BYREF
cocos2d::CCPoint v13; // [sp+44h] [bp-38h] BYREF
cocos2d::CCPoint v14; // [sp+4Ch] [bp-30h] BYREF
cocos2d::CCPoint v15; // [sp+54h] [bp-28h] BYREF
cocos2d::CCPoint v16; // [sp+5Ch] [bp-20h] BYREF
cocos2d::CCPoint v17; // [sp+64h] [bp-18h] BYREF
cocos2d::CCPoint v18; // [sp+6Ch] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_776584((int)&v18, "SFX Trigger");
SetupTriggerPopup::addTitle((int)a1);
sub_774008(&v18);
sub_776584((int)&v18, "OK");
SetupTriggerPopup::addCloseButton((unsigned int)a1, (ButtonSprite **)&v18);
sub_774008(&v18);
sub_776584((int)&v17, "Help");
sub_776584(
(int)&v18,
"Lets you start a specified sound effect (browser top right).\n"
"Unique ID is used to refer to a specific sound effect in the level while SFXGroup refers to multip"
"le.\n"
"Start, End, FadeIn, and FadeOut are in milliseconds.\n"
"Ignore Volume Test does not ignore sound effects regardless of whether any volume setting is 0.\n"
"Page 4 lets you change the volume depending on proximity.");
SetupTriggerPopup::addHelpButton((int)a1, (int)&v17, (int)&v18, 1065353216);
sub_774008(&v18);
sub_774008(&v17);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
a1->m_disableSliderDelegate = 1;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v12, v5);
cocos2d::CCPoint::CCPoint(&v13, v12.width * 0.5, v12.height * 0.5);
cocos2d::CCPoint::CCPoint(&v14, v12.width * 0.5, (float)(v12.height * 0.5) + 10.0);
sub_776584((int)&v16, "Speed:");
cocos2d::CCPoint::CCPoint(&v17, -91.0, -0.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
404,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Int,
6,
0,
(cocos2d::CCFloat *)0xC1400000,
12.0,
0,
0,
1,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "Pitch:");
cocos2d::CCPoint::CCPoint(&v17, 91.0, -0.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
405,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Int,
6,
0,
(cocos2d::CCFloat *)0xC1400000,
12.0,
0,
0,
1,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "Volume:");
cocos2d::CCPoint::CCPoint(&v17, -91.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
406,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
2.0,
0,
0,
1,
2,
0);
sub_774008(&v16);
SetupTriggerPopup::toggleLimitValue(a1, 404, 1);
SetupTriggerPopup::toggleLimitValue(a1, 405, 1);
SetupTriggerPopup::toggleLimitValue(a1, 406, 1);
sub_776584((int)&v16, "Reverb");
cocos2d::CCPoint::CCPoint(&v17, 21.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 407, (int)&v16, &v18, 0, 0, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "FFT");
cocos2d::CCPoint::CCPoint(&v17, 127.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 412, (int)&v16, &v18, 0, 0, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "Loop");
cocos2d::CCPoint::CCPoint(&v17, 21.0, -78.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 413, (int)&v16, &v18, 0, 0, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "Pre\nload");
cocos2d::CCPoint::CCPoint(&v17, 127.0, -78.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 433, (int)&v16, &v18, 0, 0, 0, 1.0);
sub_774008(&v16);
cocos2d::CCPoint::CCPoint(&v17, 94.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
sub_776584((int)&v16, "GJ_plus3Btn_001.png");
SetupTriggerPopup::createPlusButton(a1, 2, &v18, 1058642330, (const char **)&v16, 0, 0);
sub_774008(&v16);
SetupAudioTriggerPopup::addTimeControls(a1, 1, 10.0);
sub_776584((int)&v16, "Unique ID:");
cocos2d::CCPoint::CCPoint(&v17, -50.0, 60.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
416,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
1,
Uint,
10,
1,
nullptr,
100.0,
2,
0,
0,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "IsUnique");
cocos2d::CCPoint::CCPoint(&v17, 50.0, 60.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 415, (int)&v16, &v18, 0, 2, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "SFXGroup:");
cocos2d::CCPoint::CCPoint(&v17, -50.0, 0.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
455,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
1,
Int,
6,
1,
nullptr,
1000.0,
2,
0,
0,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "Override");
cocos2d::CCPoint::CCPoint(&v17, 50.0, 10.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 420, (int)&v16, &v18, 0, 2, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "Ignore\nVolume\nTest");
cocos2d::CCPoint::CCPoint(&v17, 50.0, -40.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 489, (int)&v16, &v18, 0, 2, 0, 1.0);
sub_774008(&v16);
sub_776584((int)&v16, "MinInterval:");
cocos2d::CCPoint::CCPoint(&v17, -50.0, -40.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
434,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
1.0,
2,
0,
0,
2,
0);
sub_774008(&v16);
cocos2d::CCPoint::CCPoint(&v17, 10.0, 83.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
sub_776584((int)&v16, (char *)&unk_939830);
SetupTriggerPopup::createPlusButton(a1, 0, &v18, 1061997773, (const char **)&v16, 2, 0);
sub_774008(&v16);
cocos2d::CCPoint::CCPoint(&v17, 10.0, 23.0);
cocos2d::CCPoint::operator+(&v18, &v13, &v17);
sub_776584((int)&v16, (char *)&unk_939830);
SetupTriggerPopup::createPlusButton(a1, 1, &v18, 1061997773, (const char **)&v16, 2, 0);
sub_774008(&v16);
SetupAudioTriggerPopup::addProxVolControls(a1, 3);
sub_776584((int)&v16, "Speed +-");
cocos2d::CCPoint::CCPoint(&v17, -91.0, -0.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
596,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Int,
6,
0,
nullptr,
12.0,
4,
0,
1,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "Pitch +-");
cocos2d::CCPoint::CCPoint(&v17, 91.0, -0.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
597,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Int,
6,
0,
nullptr,
12.0,
4,
0,
1,
2,
0);
sub_774008(&v16);
sub_776584((int)&v16, "Volume +-");
cocos2d::CCPoint::CCPoint(&v17, -91.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
598,
(int)&v16,
&v18,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
1.0,
4,
0,
1,
2,
0);
sub_774008(&v16);
SetupTriggerPopup::toggleLimitValue(a1, 596, 1);
SetupTriggerPopup::toggleLimitValue(a1, 597, 1);
SetupTriggerPopup::toggleLimitValue(a1, 598, 1);
sub_776584((int)&v16, "Pitch\nSteps");
cocos2d::CCPoint::CCPoint(&v17, 21.0, -39.0);
cocos2d::CCPoint::operator+(&v18, &v14, &v17);
SetupTriggerPopup::createToggleValueControl(a1, 599, (int)&v16, &v18, 0, 4, 0, 1.0);
sub_774008(&v16);
v6 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v6->setScale)(v6, 1057803469);
LODWORD(v18.x) = SetupSFXPopup::onBrowseSFX;
v18.y = 0.0;
v7 = CCMenuItemSpriteExtra::create(
v6,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SetupSFXPopup::onBrowseSFX, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v7);
m_buttonMenu = a1->m_buttonMenu;
setPosition = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v15, (float)(a1->m_width * 0.5) - 22.0, (float)(a1->m_height * 0.5) - 22.0);
cocos2d::CCPoint::operator+(&v16, &v13, &v15);
cocos2d::CCNode::convertToNodeSpace(&v17, m_buttonMenu, &v16);
setPosition(v7, &v17);
a1->m_sfxID = (int)a1->getValue(a1, 392);
SetupSFXPopup::createSFXWidget(a1);
SetupTriggerPopup::createPageButtons(a1, (float)(a1->m_width * 0.5) + 15.0, 1);
v9 = a1->getValue(a1, 427);
SetupTriggerPopup::goToPage(a1, (int)v9, 0);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}