//
// SetupAudioTriggerPopup::addProxVolControls from 0x1004b6b90 to 0x1004b7439 (2217 bytes)
//
// 2 xrefs:
// > SetupSFXPopup::init @ 0x1004b97f6
// > SetupSFXEditPopup::init @ 0x1004bb9a4
//
// 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 __fastcall SetupAudioTriggerPopup::addProxVolControls(SetupAudioTriggerPopup *a1, int a2)
{
SetupAudioTriggerPopup *v2; // rbx
cocos2d::CCObject *v3; // rax
unsigned int v4; // r15d
const std::string::value_type *v5; // rsi
const std::string::value_type *v6; // rax
__m128 v7; // xmm0
int v8; // eax
const char *data; // rdi
cocos2d::CCSprite *v10; // r13
const char *v11; // r8
ButtonSprite *v12; // rax
CCMenuItemSpriteExtra *v13; // r12
__int64 v14; // rax
int v15; // ecx
const cocos2d::CCPoint *m_buttonMenu; // r13
__m128 v17; // xmm0
float v18; // [rsp+38h] [rbp-188h] BYREF
cocos2d::CCArray *PageContainer; // [rsp+40h] [rbp-180h]
__int128 v20; // [rsp+48h] [rbp-178h] BYREF
void *v21; // [rsp+58h] [rbp-168h]
char v22; // [rsp+60h] [rbp-160h] BYREF
_BYTE v23[23]; // [rsp+61h] [rbp-15Fh] BYREF
char v24; // [rsp+78h] [rbp-148h] BYREF
_BYTE v25[23]; // [rsp+79h] [rbp-147h] BYREF
__int128 v26; // [rsp+90h] [rbp-130h] BYREF
void *v27; // [rsp+A0h] [rbp-120h]
__int128 v28; // [rsp+A8h] [rbp-118h] BYREF
void *v29; // [rsp+B8h] [rbp-108h]
unsigned __int64 v30; // [rsp+C0h] [rbp-100h] BYREF
char v31; // [rsp+C8h] [rbp-F8h] BYREF
_BYTE v32[23]; // [rsp+C9h] [rbp-F7h] BYREF
char v33; // [rsp+E0h] [rbp-E0h] BYREF
_BYTE v34[23]; // [rsp+E1h] [rbp-DFh] BYREF
char v35; // [rsp+F8h] [rbp-C8h] BYREF
char v36[15]; // [rsp+F9h] [rbp-C7h] BYREF
void *v37; // [rsp+108h] [rbp-B8h]
char v38; // [rsp+110h] [rbp-B0h] BYREF
char v39[15]; // [rsp+111h] [rbp-AFh] BYREF
void *v40; // [rsp+120h] [rbp-A0h]
char v41; // [rsp+128h] [rbp-98h] BYREF
char v42[15]; // [rsp+129h] [rbp-97h] BYREF
void *v43; // [rsp+138h] [rbp-88h]
char v44; // [rsp+140h] [rbp-80h] BYREF
char v45[15]; // [rsp+141h] [rbp-7Fh] BYREF
void *v46; // [rsp+150h] [rbp-70h]
int v47; // [rsp+15Ch] [rbp-64h]
float v48; // [rsp+160h] [rbp-60h] BYREF
float v49; // [rsp+164h] [rbp-5Ch]
unsigned __int64 v50; // [rsp+168h] [rbp-58h] BYREF
std::string v51; // [rsp+170h] [rbp-50h] BYREF
float v52; // [rsp+18Ch] [rbp-34h]
unsigned __int64 v53[6]; // [rsp+190h] [rbp-30h] BYREF
v2 = a1;
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v48);
sub_10028CBE0((float *)&v30, v48 * 0.5, v49 * 0.5);
sub_10028CBE0((float *)&v50, v48 * 0.5, (float)(v49 * 0.5) + 42.0);
v31 = 22;
strcpy(v32, "Group ID 1:");
sub_10028CBE0((float *)v53, -80.0, 80.0);
sub_10028CCE0((double *)&v51, &v30, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
51,
(__int64)&v31,
(float *)&v51,
1,
Int,
0.64999998,
0.0,
9999.0,
10,
1,
a2,
0,
0,
0,
0);
if ( (v31 & 1) != 0 )
operator delete(*(void **)&v32[15]);
v33 = 22;
strcpy(v34, "Group ID 2:");
sub_10028CBE0((float *)v53, 80.0, 80.0);
sub_10028CCE0((double *)&v51, &v30, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
71,
(__int64)&v33,
(float *)&v51,
1,
Uint,
0.64999998,
0.0,
9999.0,
10,
1,
a2,
9,
0,
0,
0);
if ( (v33 & 1) != 0 )
operator delete(*(void **)&v34[15]);
v22 = 16;
strcpy(v23, "VolNear:");
sub_10028CBE0((float *)v53, -91.0, -0.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
421,
(__int64)&v22,
(float *)&v51,
0,
Float,
0.64999998,
0.0,
1.0,
6,
0,
a2,
0,
1,
2,
0);
if ( (v22 & 1) != 0 )
operator delete(*(void **)&v23[15]);
v24 = 16;
strcpy(v25, "MinDist:");
sub_10028CBE0((float *)v53, 91.0, -0.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
424,
(__int64)&v24,
(float *)&v51,
0,
Int,
0.64999998,
0.0,
100.0,
6,
0,
a2,
0,
1,
0,
0);
if ( (v24 & 1) != 0 )
operator delete(*(void **)&v25[15]);
v35 = 14;
strcpy(v36, "VolMed:");
sub_10028CBE0((float *)v53, -91.0, -30.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
422,
(__int64)&v35,
(float *)&v51,
0,
Float,
0.64999998,
0.0,
1.0,
6,
0,
a2,
0,
1,
2,
0);
if ( (v35 & 1) != 0 )
operator delete(v37);
v38 = 12;
strcpy(v39, "Dist2:");
sub_10028CBE0((float *)v53, 91.0, -30.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
425,
(__int64)&v38,
(float *)&v51,
0,
Int,
0.64999998,
0.0,
100.0,
6,
0,
a2,
0,
1,
0,
0);
if ( (v38 & 1) != 0 )
operator delete(v40);
v41 = 14;
strcpy(v42, "VolFar:");
sub_10028CBE0((float *)v53, -91.0, -60.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
423,
(__int64)&v41,
(float *)&v51,
0,
Float,
0.64999998,
0.0,
1.0,
6,
0,
a2,
0,
1,
2,
0);
if ( (v41 & 1) != 0 )
operator delete(v43);
v44 = 12;
strcpy(v45, "Dist3:");
sub_10028CBE0((float *)v53, 91.0, -60.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
426,
(__int64)&v44,
(float *)&v51,
0,
Int,
0.64999998,
0.0,
100.0,
6,
0,
a2,
0,
1,
0,
0);
if ( (v44 & 1) != 0 )
operator delete(v46);
LOBYTE(v26) = 4;
strcpy((char *)&v26 + 1, "P1");
sub_10028CBE0((float *)v53, -170.0, -95.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createToggleValueControl((int)a1, 138, &v26, 1.0, (__int64)&v51, 0, a2, 0);
if ( (v26 & 1) != 0 )
operator delete(v27);
LOBYTE(v28) = 4;
strcpy((char *)&v28 + 1, "P2");
sub_10028CBE0((float *)v53, -110.0, -95.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createToggleValueControl((int)a1, 200, &v28, 1.0, (__int64)&v51, 0, a2, 0);
if ( (v28 & 1) != 0 )
operator delete(v29);
LOBYTE(v20) = 6;
*(_DWORD *)((char *)&v20 + 1) = 7168323;
sub_10028CBE0((float *)v53, -50.0, -95.0);
sub_10028CCE0((double *)&v51, &v50, v53);
SetupTriggerPopup::createToggleValueControl((int)a1, 428, &v20, 1.0, (__int64)&v51, 0, a2, 0);
if ( (v20 & 1) != 0 )
{
a1 = (SetupAudioTriggerPopup *)v21;
operator delete(v21);
}
v3 = (cocos2d::CCObject *)sub_10071F9E0(a1, 428);
v2->m_proximityButtons = (cocos2d::CCArray *)v3;
cocos2d::CCObject::retain(v3);
v47 = (int)((float (__fastcall *)(SetupAudioTriggerPopup *, __int64))v2->getValue)(v2, 458);
PageContainer = SetupTriggerPopup::getPageContainer(v2, a2);
v4 = 0;
memset(&v51, 0, sizeof(v51));
v5 = "edit_areaModeBtn01_001.png";
v6 = "edit_areaModeBtn01_001.png";
switch ( (unsigned __int64)"edit_areaModeBtn01_001.png" )
{
case 0uLL:
LABEL_29:
v5 = "edit_areaModeBtn04_001.png";
goto LABEL_32;
case 1uLL:
goto LABEL_32;
case 2uLL:
LABEL_30:
v52 = 180.0;
std::string::assign(&v51, "edit_areaModeBtn03_001.png");
goto LABEL_33;
case 3uLL:
LABEL_31:
v5 = "edit_areaModeBtn03_001.png";
LABEL_32:
v52 = 0.0;
std::string::assign(&v51, v5);
goto LABEL_33;
case 4uLL:
goto LABEL_44;
case 5uLL:
LABEL_43:
v6 = "edit_areaModeBtn03_001.png";
LABEL_44:
v52 = 90.0;
std::string::assign(&v51, v6);
LABEL_33:
data = v51.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_34;
goto LABEL_35;
case 6uLL:
while ( 2 )
{
std::string::assign(&v51, "edit_areaModeBtn03_001.png");
v52 = -90.0;
data = v51.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_35;
LABEL_34:
data = v51.__r_.__value_.__l.__data_;
LABEL_35:
v10 = cocos2d::CCSprite::createWithSpriteFrameName(data);
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setRotation)(v10, v52);
v11 = "GJ_button_04.png";
if ( v47 == v4 )
v11 = "GJ_button_02.png";
v12 = ButtonSprite::create(v10, 32, 0, 32.0, 1.0, 1, v11, 1);
v13 = CCMenuItemSpriteExtra::create(
v12,
nullptr,
v2,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupAudioTriggerPopup::onProxMode);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v13->setTag)(v13, v4);
sub_10071FCD0(PageContainer, v13);
sub_10071FCD0(v2->m_proximityButtons, v13);
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setScale)(v10, 1.8);
v52 = *(float *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v13->getContentSize)(v13);
v14 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v13->getContentSize)(v13);
sub_10028CBE0((float *)v53, v52 * 0.5, *(float *)(v14 + 4) * 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v10->setPosition)(v10, v53);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float))v13->setScale)(v13, 0.60000002);
v13->m_baseScale = 0.60000002;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v2->m_buttonMenu->addChild)(
v2->m_buttonMenu,
v13);
v15 = -30;
if ( v4 < 4 )
v15 = 0;
m_buttonMenu = (const cocos2d::CCPoint *)v2->m_buttonMenu;
v17 = (__m128)LODWORD(v48);
sub_10028CBE0(
&v18,
(float)((float)(v48 * 0.5) + 60.0) + (float)((float)(v4 & 3) * 30.000002),
(float)((float)(v49 * 0.5) + -54.0) + (float)v15);
*(cocos2d::CCPoint *)v17.f32 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v53, m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, unsigned __int64 *, double))v13->setPosition)(
v13,
v53,
*(double *)v17.i64);
if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v51.__r_.__value_.__l.__data_);
if ( ++v4 != 7 )
{
memset(&v51, 0, sizeof(v51));
v6 = "edit_areaModeBtn01_001.png";
v5 = "edit_areaModeBtn01_001.png";
switch ( (unsigned __int64)"edit_areaModeBtn01_001.png" )
{
case 0uLL:
goto LABEL_29;
case 1uLL:
goto LABEL_32;
case 2uLL:
goto LABEL_30;
case 3uLL:
goto LABEL_31;
case 4uLL:
goto LABEL_44;
case 5uLL:
goto LABEL_43;
case 6uLL:
continue;
}
}
break;
}
*(double *)v17.i64 = ((double (__fastcall *)(SetupAudioTriggerPopup *, __int64))v2->getValue)(v2, 428);
((void (__fastcall *)(SetupAudioTriggerPopup *, __int64, _QWORD))v2->toggleGroup)(
v2,
428,
_mm_cvtsi128_si32((__m128i)_mm_cmpneq_ss(v17, (__m128)0LL)) & 1);
if ( ((float (__fastcall *)(SetupAudioTriggerPopup *, __int64))v2->getValue)(v2, 138) == 0.0
&& ((float (__fastcall *)(SetupAudioTriggerPopup *, __int64))v2->getValue)(v2, 200) == 0.0 )
{
v7.f32[0] = ((float (__fastcall *)(SetupAudioTriggerPopup *, __int64))v2->getValue)(v2, 428);
v8 = _mm_cvtsi128_si32((__m128i)_mm_cmpeq_ss((__m128)0LL, v7)) & 1;
}
else
{
LOBYTE(v8) = 0;
}
((void (__fastcall *)(SetupAudioTriggerPopup *, __int64, _QWORD))v2->toggleGroup)(v2, 9, (unsigned __int8)v8);
return;
}
}