//
// SetupSFXEditPopup::init from 0xb6f900 to 0xb703f8 (2808 bytes)
//
// 2 xrefs:
// > SetupSFXEditPopup::create @ 0xb70658
// > ??> @ 0x5f0c8
//
// This function is hookable on this platform (idp: arm, 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 13:02:20 +0000
//
__int64 __fastcall SetupSFXEditPopup::init(
SetupSFXEditPopup *this,
SFXTriggerGameObject *a2,
cocos2d::CCArray *a3,
unsigned __int8 a4)
{
int v5; // w28
unsigned __int8 v6; // w0
unsigned int v7; // w25
const char *v9; // x1
size_t v10; // x0
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x4
__int64 v14; // x5
const char *v15; // x6
const char *v16; // x1
size_t v17; // x0
cocos2d::CCDirector *v18; // x0
char *v19; // [xsp+C8h] [xbp+98h]
char *v20; // [xsp+C8h] [xbp+98h]
__int64 v21; // [xsp+D0h] [xbp+A0h] BYREF
_BYTE v22[8]; // [xsp+D8h] [xbp+A8h] BYREF
_BYTE v23[8]; // [xsp+E0h] [xbp+B0h] BYREF
_BYTE v24[8]; // [xsp+E8h] [xbp+B8h] BYREF
__int64 v25; // [xsp+F0h] [xbp+C0h] BYREF
__int64 v26[2]; // [xsp+F8h] [xbp+C8h] BYREF
char *v27; // [xsp+108h] [xbp+D8h]
__int64 v28[2]; // [xsp+110h] [xbp+E0h] BYREF
void *v29; // [xsp+120h] [xbp+F0h]
__int64 v30[2]; // [xsp+128h] [xbp+F8h] BYREF
void *v31; // [xsp+138h] [xbp+108h]
__int64 v32[2]; // [xsp+140h] [xbp+110h] BYREF
void *v33; // [xsp+150h] [xbp+120h]
__int64 v34[2]; // [xsp+158h] [xbp+128h] BYREF
void *v35; // [xsp+168h] [xbp+138h]
__int64 v36[2]; // [xsp+170h] [xbp+140h] BYREF
void *v37; // [xsp+180h] [xbp+150h]
__int64 v38[2]; // [xsp+188h] [xbp+158h] BYREF
void *v39; // [xsp+198h] [xbp+168h]
__int64 v40[2]; // [xsp+1A0h] [xbp+170h] BYREF
void *v41; // [xsp+1B0h] [xbp+180h]
__int64 v42[2]; // [xsp+1B8h] [xbp+188h] BYREF
void *v43; // [xsp+1C8h] [xbp+198h]
__int64 v44[2]; // [xsp+1D0h] [xbp+1A0h] BYREF
void *v45; // [xsp+1E0h] [xbp+1B0h]
__int64 v46[2]; // [xsp+1E8h] [xbp+1B8h] BYREF
void *v47; // [xsp+1F8h] [xbp+1C8h]
__int64 v48[2]; // [xsp+200h] [xbp+1D0h] BYREF
void *v49; // [xsp+210h] [xbp+1E0h]
__int64 v50[2]; // [xsp+218h] [xbp+1E8h] BYREF
void *v51; // [xsp+228h] [xbp+1F8h]
__int64 v52; // [xsp+230h] [xbp+200h] BYREF
__int64 v53; // [xsp+238h] [xbp+208h]
void *v54; // [xsp+240h] [xbp+210h]
v5 = a4;
v6 = SetupTriggerPopup::init(this, a2, a3, 380.0, 280.0, 1u, 0.0);
v7 = v6;
if ( v6 )
{
SetupTriggerPopup::preSetup(this);
if ( v5 )
v9 = "Edit Song Trigger";
else
v9 = "Edit SFX Trigger";
v19 = (char *)v9;
v52 = 0;
v53 = 0;
v54 = nullptr;
v10 = strlen(v9);
std::string::__init(&v52, v19, v10);
SetupTriggerPopup::addTitle((__int64)this, (__int64)&v52);
if ( (v52 & 1) != 0 )
operator delete(v54);
v52 = 0;
v53 = 0;
v54 = nullptr;
std::string::__init(&v52, "OK", 2u);
SetupTriggerPopup::addCloseButton((__int64)this, (__int64)&v52, v11, v12, v13, v14, v15);
if ( (v52 & 1) != 0 )
operator delete(v54);
v26[0] = 0;
v26[1] = 0;
v27 = nullptr;
if ( v5 )
std::string::assign(
v26,
"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 directi"
"on it works in.\n"
"By default, the player changes the volume depending on how close they are to this group. You can also use Gr"
"oup ID 2 on an object to make this object control volume.");
else
std::string::assign(
v26,
"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 directi"
"on it works in.\n"
"By default, the player changes the volume depending on how close they are to this group. You can also use Gr"
"oup ID 2 on an object to make this object control volume.");
v28[0] = 0;
v28[1] = 0;
v29 = nullptr;
std::string::__init(v28, "Help", 4u);
v16 = (char *)v26 + 1;
if ( (v26[0] & 1) != 0 )
v16 = v27;
v20 = (char *)v16;
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
v17 = strlen(v16);
std::string::__init(v30, v20, v17);
SetupTriggerPopup::addHelpButton((__int64)this, (char *)v28, (char *)v30, 1.0);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
SetupTriggerPopup::createMultiTriggerItemsDefault(this);
*((_BYTE *)this + 904) = (unsigned __int8)&dword_0 + 1;
v18 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)((char *)&dword_0 + 1));
cocos2d::CCDirector::getWinSize(&v21, v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, *(float *)&v21 * 0.5, *((float *)&v21 + 1) * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, *(float *)&v21 * 0.5, (float)(*((float *)&v21 + 1) * 0.5) + 35.0);
if ( v5 )
{
v38[0] = 0;
v38[1] = 0;
v39 = nullptr;
std::string::__init(v38, "Channel:", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 0.0, 80.0);
cocos2d::CCPoint::operator+(&v25, v22);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
432,
(char *)v38,
(__int64)&v25,
1,
3,
10,
1,
0.65,
0.0,
4.0,
0,
0,
0,
2,
0);
if ( (v38[0] & 1) != 0 )
operator delete(v39);
SetupTriggerPopup::toggleLimitValue((__int64 **)this, 432, 1);
}
else
{
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
std::string::__init(v32, "Group ID:", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -110.0, 80.0);
cocos2d::CCPoint::operator+(&v25, v22);
IDNameInput::create(this, (char *)this + 544, 1, 457, v32, &v25, 6, 0, 0.65, 0, 0);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
v34[0] = 0;
v34[1] = 0;
v35 = nullptr;
std::string::__init(v34, "SFXGroup:", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 0.0, 80.0);
cocos2d::CCPoint::operator+(&v25, v22);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
455,
(char *)v34,
(__int64)&v25,
1,
2,
10,
1,
0.65,
-100.0,
100.0,
0,
0,
0,
0,
0);
if ( (v34[0] & 1) != 0 )
operator delete(v35);
v36[0] = 0;
v36[1] = 0;
v37 = nullptr;
std::string::__init(v36, "Unique ID:", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 110.0, 80.0);
cocos2d::CCPoint::operator+(&v25, v22);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
416,
(char *)v36,
(__int64)&v25,
1,
3,
10,
1,
0.65,
0.0,
100.0,
0,
0,
0,
0,
0);
if ( (v36[0] & 1) != 0 )
operator delete(v37);
}
v40[0] = 0;
v40[1] = 0;
v41 = nullptr;
std::string::__init(v40, "Duration:", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -84.5, -0.0);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
10,
(char *)v40,
(__int64)&v25,
0,
1,
6,
0,
0.65,
0.0,
2.0,
0,
0,
1,
2,
0);
if ( (v40[0] & 1) != 0 )
operator delete(v41);
v42[0] = 0;
v42[1] = 0;
v43 = nullptr;
std::string::__init(v42, "Speed:", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -84.5, -35.75);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
404,
(char *)v42,
(__int64)&v25,
0,
2,
6,
0,
0.65,
-12.0,
12.0,
0,
0,
1,
2,
0);
if ( (v42[0] & 1) != 0 )
operator delete(v43);
v44[0] = 0;
v44[1] = 0;
v45 = nullptr;
std::string::__init(v44, "Volume:", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -84.5, -71.5);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
406,
(char *)v44,
(__int64)&v25,
0,
1,
6,
0,
0.65,
0.0,
2.0,
0,
0,
1,
2,
0);
if ( (v44[0] & 1) != 0 )
operator delete(v45);
v46[0] = 0;
v46[1] = 0;
v47 = nullptr;
std::string::__init(v46, "Stop", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 34.5, -0.0);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x1A1u,
v46,
(const cocos2d::CCPoint *)&v25,
0,
0,
0,
1.0);
if ( (v46[0] & 1) != 0 )
operator delete(v47);
v48[0] = 0;
v48[1] = 0;
v49 = nullptr;
std::string::__init(v48, "Stop\nLoop", 9u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 114.5, -0.0);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x19Eu,
v48,
(const cocos2d::CCPoint *)&v25,
0,
0,
0,
1.0);
if ( (v48[0] & 1) != 0 )
operator delete(v49);
v50[0] = 0;
v50[1] = 0;
v51 = nullptr;
std::string::__init(v50, "Change Speed", 0xCu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 34.5, -35.75);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x1A3u,
v50,
(const cocos2d::CCPoint *)&v25,
0,
0,
0,
1.0);
if ( (v50[0] & 1) != 0 )
operator delete(v51);
v52 = 0;
v53 = 0;
v54 = nullptr;
std::string::__init(&v52, "Change Volume", 0xDu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 34.5, -71.5);
cocos2d::CCPoint::operator+(&v25, v23);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0x1A2u,
&v52,
(const cocos2d::CCPoint *)&v25,
0,
0,
0,
1.0);
if ( (v52 & 1) != 0 )
operator delete(v54);
SetupTriggerPopup::toggleLimitValue((__int64 **)this, 404, 1);
SetupTriggerPopup::toggleLimitValue((__int64 **)this, 406, 1);
SetupAudioTriggerPopup::addProxVolControls((cocos2d::CCArray **)this, 1u);
SetupTriggerPopup::createPageButtons(this, (float)(*((float *)this + 183) * 0.5) + 15.0, 1);
SetupTriggerPopup::goToPage((cocos2d::CCArray **)this, 0, 0);
SetupTriggerPopup::postSetup(this);
if ( (v26[0] & 1) != 0 )
operator delete(v27);
}
return v7;
}