//
// SetupSFXEditPopup::init from 0x576d7c to 0x5773dc (1632 bytes)
//
// 1 xrefs:
// > SetupSFXEditPopup::create @ 0x57745c
//
// 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 SetupSFXEditPopup::init(SetupSFXEditPopup *a1, SFXTriggerGameObject *a2, cocos2d::CCArray *a3, bool a4)
{
_BOOL4 v4; // r11
char *v6; // r1
char *v7; // r1
cocos2d::CCDirector *v8; // r0
_BOOL4 v10; // [sp+30h] [bp-6Ch]
char *v11; // [sp+3Ch] [bp-60h] BYREF
_BYTE v12[4]; // [sp+40h] [bp-5Ch] BYREF
_BYTE v13[4]; // [sp+44h] [bp-58h] BYREF
_BYTE v14[4]; // [sp+48h] [bp-54h] BYREF
_BYTE v15[4]; // [sp+4Ch] [bp-50h] BYREF
_BYTE v16[4]; // [sp+50h] [bp-4Ch] BYREF
_BYTE v17[4]; // [sp+54h] [bp-48h] BYREF
_BYTE v18[4]; // [sp+58h] [bp-44h] BYREF
_BYTE v19[4]; // [sp+5Ch] [bp-40h] BYREF
_BYTE v20[4]; // [sp+60h] [bp-3Ch] BYREF
_BYTE v21[4]; // [sp+64h] [bp-38h] BYREF
_BYTE v22[4]; // [sp+68h] [bp-34h] BYREF
cocos2d::CCSize v23; // [sp+6Ch] [bp-30h] BYREF
cocos2d::CCPoint v24; // [sp+74h] [bp-28h] BYREF
cocos2d::CCPoint v25; // [sp+7Ch] [bp-20h] BYREF
cocos2d::CCPoint v26; // [sp+84h] [bp-18h] BYREF
cocos2d::CCPoint v27; // [sp+8Ch] [bp-10h] BYREF
v4 = a4;
v10 = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( v10 )
{
SetupTriggerPopup::preSetup(a1);
if ( v4 )
v6 = "Edit Song Trigger";
else
v6 = "Edit SFX Trigger";
sub_776584((int)&v27, v6);
SetupTriggerPopup::addTitle((int)a1);
sub_774008(&v27);
sub_776584((int)&v27, "OK");
SetupTriggerPopup::addCloseButton((unsigned int)a1, (ButtonSprite **)&v27);
sub_774008(&v27);
v11 = (char *)&unk_ACDDA8;
if ( v4 )
v7 = "Lets you edit the properties of a song in a specified Channel.\n"
"Page 2 lets you change the volume depending on proximity.\n"
"Group ID 1 is the target that volume is calculated around. Use the arrow buttons to define which dire"
"ction it works in.\n"
"By default, the player changes the volume depending on how close they are to this group. You can also use Group ID 2 on an object to make this object control volume.";
else
v7 = "Lets you edit the properties of a sound effect. Use Group ID, SFXGroup, or Unique"
" ID to refer to the correct one.\n"
"Page 2 lets you change the volume depending on proximity.\n"
"Group ID 1 is the target that volume is calculated around. Use the arrow buttons to define which dire"
"ction it works in.\n"
"By default, the player changes the volume depending on how close they are to this group. You can also use Group ID 2 on an object to make this object control volume.";
sub_7753D4((int)&v11, v7);
sub_776584((int)&v26, "Help");
sub_776584((int)&v27, v11);
SetupTriggerPopup::addHelpButton((int)a1, (int)&v26, (int)&v27, 1065353216);
sub_774008(&v27);
sub_774008(&v26);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
a1->m_disableSliderDelegate = 1;
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v23, v8);
cocos2d::CCPoint::CCPoint(&v24, v23.width * 0.5, v23.height * 0.5);
cocos2d::CCPoint::CCPoint(&v25, v23.width * 0.5, (float)(v23.height * 0.5) + 35.0);
if ( v4 )
{
sub_776584((int)v15, "Channel:");
cocos2d::CCPoint::CCPoint(&v26, 0.0, 80.0);
cocos2d::CCPoint::operator+(&v27, &v24, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
432,
(int)v15,
&v27,
(cocos2d::CCZone *)0x3F266666,
1,
Uint,
10,
1,
nullptr,
4.0,
0,
0,
0,
2,
0);
sub_774008(v15);
SetupTriggerPopup::toggleLimitValue(a1, 432, 1);
}
else
{
sub_776584((int)v12, "Group ID:");
cocos2d::CCPoint::CCPoint(&v26, -110.0, 80.0);
cocos2d::CCPoint::operator+(&v27, &v24, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
457,
(int)v12,
&v27,
(cocos2d::CCZone *)0x3F266666,
1,
Int,
10,
1,
(cocos2d::CCFloat *)0xC2C80000,
100.0,
0,
0,
0,
0,
0);
sub_774008(v12);
sub_776584((int)v13, "SFXGroup:");
cocos2d::CCPoint::CCPoint(&v26, 0.0, 80.0);
cocos2d::CCPoint::operator+(&v27, &v24, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
455,
(int)v13,
&v27,
(cocos2d::CCZone *)0x3F266666,
1,
Int,
10,
1,
(cocos2d::CCFloat *)0xC2C80000,
100.0,
0,
0,
0,
0,
0);
sub_774008(v13);
sub_776584((int)v14, "Unique ID:");
cocos2d::CCPoint::CCPoint(&v26, 110.0, 80.0);
cocos2d::CCPoint::operator+(&v27, &v24, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
416,
(int)v14,
&v27,
(cocos2d::CCZone *)0x3F266666,
1,
Uint,
10,
1,
nullptr,
100.0,
0,
0,
0,
0,
0);
sub_774008(v14);
}
sub_776584((int)v16, "Duration:");
cocos2d::CCPoint::CCPoint(&v26, -84.5, -0.0);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
10,
(int)v16,
&v27,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
2.0,
0,
0,
1,
2,
0);
sub_774008(v16);
sub_776584((int)v17, "Speed:");
cocos2d::CCPoint::CCPoint(&v26, -84.5, -35.75);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
404,
(int)v17,
&v27,
(cocos2d::CCZone *)0x3F266666,
0,
Int,
6,
0,
(cocos2d::CCFloat *)0xC1400000,
12.0,
0,
0,
1,
2,
0);
sub_774008(v17);
sub_776584((int)v18, "Volume:");
cocos2d::CCPoint::CCPoint(&v26, -84.5, -71.5);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
406,
(int)v18,
&v27,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
2.0,
0,
0,
1,
2,
0);
sub_774008(v18);
sub_776584((int)v19, "Stop");
cocos2d::CCPoint::CCPoint(&v26, 34.5, -0.0);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createToggleValueControl(a1, 417, (int)v19, &v27, 0, 0, 0, 1.0);
sub_774008(v19);
sub_776584((int)v20, "Stop\nLoop");
cocos2d::CCPoint::CCPoint(&v26, 114.5, -0.0);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createToggleValueControl(a1, 414, (int)v20, &v27, 0, 0, 0, 1.0);
sub_774008(v20);
sub_776584((int)v21, "Change Speed");
cocos2d::CCPoint::CCPoint(&v26, 34.5, -35.75);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createToggleValueControl(a1, 419, (int)v21, &v27, 0, 0, 0, 1.0);
sub_774008(v21);
sub_776584((int)v22, "Change Volume");
cocos2d::CCPoint::CCPoint(&v26, 34.5, -71.5);
cocos2d::CCPoint::operator+(&v27, &v25, &v26);
SetupTriggerPopup::createToggleValueControl(a1, 418, (int)v22, &v27, 0, 0, 0, 1.0);
sub_774008(v22);
SetupTriggerPopup::toggleLimitValue(a1, 404, 1);
SetupTriggerPopup::toggleLimitValue(a1, 406, 1);
SetupAudioTriggerPopup::addProxVolControls(a1, 1);
SetupTriggerPopup::createPageButtons(a1, (float)(a1->m_width * 0.5) + 15.0, 1);
SetupTriggerPopup::goToPage(a1, 0, 0);
SetupTriggerPopup::postSetup(a1);
sub_774008(&v11);
}
return v10;
}