//
// SetupAudioTriggerPopup::addProxVolControls from 0xa3e444 to 0xa3f220 (3548 bytes)
//
// 3 xrefs:
// > SetupSFXPopup::init @ 0xa40c2c
// > SetupSFXEditPopup::init @ 0xa42130
// > ??> @ 0x955f8
//
// 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 SetupAudioTriggerPopup::addProxVolControls(SetupAudioTriggerPopup *a1, int a2)
{
cocos2d::CCDirector *v4; // x0
float v5; // s3
float v6; // s4
void *v7; // x0
float v8; // s3
float v9; // s4
void *v10; // x0
float v11; // s3
float v12; // s4
void *v13; // x0
float v14; // s3
float v15; // s4
void *v16; // x0
float v17; // s3
float v18; // s4
void *v19; // x0
float v20; // s3
float v21; // s4
void *v22; // x0
float v23; // s3
float v24; // s4
void *v25; // x0
float v26; // s3
float v27; // s4
void *v28; // x0
void *v29; // x0
void *v30; // x0
cocos2d::CCArray *v31; // x0
cocos2d::CCArray *v32; // x0
int v33; // w20
float v34; // s8
ButtonSprite *v35; // x27
char *v36; // x4
cocos2d::CCNode *v37; // x0
cocos2d::CCObject *v38; // x19
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x28
float v40; // s8
__int64 v41; // x0
cocos2d::CCMenu *m_buttonMenu; // x2
float v43; // s1
cocos2d::CCMenu *v44; // x28
bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // x27
char *v46; // x0
void (__fastcall *toggleGroup)(SetupTriggerPopup *__hidden, int, bool); // x19
float v48; // s0
unsigned int *v49; // x1
int v50; // w2
unsigned int *v51; // x1
int v52; // w2
unsigned int *v53; // x1
int v54; // w2
unsigned int *v55; // x1
int v56; // w2
unsigned int *v57; // x1
int v58; // w2
unsigned int *v59; // x1
int v60; // w2
unsigned int *v61; // x1
int v62; // w2
unsigned int *v63; // x1
int v64; // w2
unsigned int *v65; // x1
int v66; // w2
unsigned int *v67; // x1
int v68; // w2
unsigned int *v69; // x1
int v70; // w2
unsigned int *v71; // x1
int v72; // w2
cocos2d::CCArray *PageContainer; // [xsp+D0h] [xbp+A0h]
int v74; // [xsp+DCh] [xbp+ACh]
float v75; // [xsp+E8h] [xbp+B8h]
float v76; // [xsp+ECh] [xbp+BCh]
cocos2d::CCPoint v77; // [xsp+F0h] [xbp+C0h] BYREF
cocos2d::CCPoint v78; // [xsp+F8h] [xbp+C8h] BYREF
const char *v79; // [xsp+100h] [xbp+D0h] BYREF
cocos2d::CCPoint v80; // [xsp+108h] [xbp+D8h] BYREF
cocos2d::CCPoint v81; // [xsp+110h] [xbp+E0h] BYREF
cocos2d::CCPoint v82; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v83; // 0:x2.16
cocos2d::CCPoint v84; // 0:s0.4,4:s1.4
cocos2d::CCPoint v85; // 0:s0.4,4:s1.4
cocos2d::CCPoint v86; // 0:s0.4,4:s1.4
cocos2d::CCPoint v87; // 0:s0.4,4:s1.4
cocos2d::CCPoint v88; // 0:s0.4,4:s1.4
cocos2d::CCPoint v89; // 0:s0.4,4:s1.4
cocos2d::CCPoint v90; // 0:s0.4,4:s1.4
cocos2d::CCPoint v91; // 0:s0.4,4:s1.4
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v4);
cocos2d::CCPoint::CCPoint(&v77, v75 * 0.5, v76 * 0.5);
cocos2d::CCPoint::CCPoint(&v78, v75 * 0.5, (float)(v76 * 0.5) + 42.0);
sub_D153B8((int)&v81, "Group ID 1:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -80.0, 80.0);
cocos2d::CCPoint::operator+(&v80, &v77, &v79);
v84.y = 0.0;
v84.x = 0.65;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x33u,
v84,
9999.0,
v5,
v6,
(std::string)&v81,
&v80,
Float,
Int,
10,
1u,
a2,
0,
0,
0,
0);
v7 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v63 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v64 = __ldaxr(v63);
while ( __stlxr(v64 - 1, v63) );
}
else
{
v64 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v64 - 1;
}
if ( v64 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v81, "Group ID 2:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, 80.0, 80.0);
cocos2d::CCPoint::operator+(&v80, &v77, &v79);
v85.x = 0.65;
v85.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x47u,
v85,
9999.0,
v8,
v9,
(std::string)&v81,
&v80,
Float,
Uint,
10,
1u,
a2,
9,
0,
0,
0);
v10 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v59 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v60 = __ldaxr(v59);
while ( __stlxr(v60 - 1, v59) );
}
else
{
v60 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v60 - 1;
}
if ( v60 <= 0 )
operator delete(v10);
}
sub_D153B8((int)&v81, "VolNear:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -91.0, -0.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v86.x = 0.65;
v86.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1A5u,
v86,
1.0,
v11,
v12,
(std::string)&v81,
&v80,
(InputValueType)0,
Float,
6,
0,
a2,
0,
1,
2,
0);
v13 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v61 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v62 = __ldaxr(v61);
while ( __stlxr(v62 - 1, v61) );
}
else
{
v62 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v62 - 1;
}
if ( v62 <= 0 )
operator delete(v13);
}
sub_D153B8((int)&v81, "MinDist:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, 91.0, -0.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v87.x = 0.65;
v87.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1A8u,
v87,
100.0,
v14,
v15,
(std::string)&v81,
&v80,
(InputValueType)0,
Int,
6,
0,
a2,
0,
1,
0,
0);
v16 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v51 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v52 = __ldaxr(v51);
while ( __stlxr(v52 - 1, v51) );
}
else
{
v52 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v52 - 1;
}
if ( v52 <= 0 )
operator delete(v16);
}
sub_D153B8((int)&v81, "VolMed:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -91.0, -30.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v88.x = 0.65;
v88.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1A6u,
v88,
1.0,
v17,
v18,
(std::string)&v81,
&v80,
(InputValueType)0,
Float,
6,
0,
a2,
0,
1,
2,
0);
v19 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v53 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v54 = __ldaxr(v53);
while ( __stlxr(v54 - 1, v53) );
}
else
{
v54 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v54 - 1;
}
if ( v54 <= 0 )
operator delete(v19);
}
sub_D153B8((int)&v81, "Dist2:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, 91.0, -30.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v89.x = 0.65;
v89.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1A9u,
v89,
100.0,
v20,
v21,
(std::string)&v81,
&v80,
(InputValueType)0,
Int,
6,
0,
a2,
0,
1,
0,
0);
v22 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v55 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v56 = __ldaxr(v55);
while ( __stlxr(v56 - 1, v55) );
}
else
{
v56 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v56 - 1;
}
if ( v56 <= 0 )
operator delete(v22);
}
sub_D153B8((int)&v81, "VolFar:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -91.0, -60.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v90.x = 0.65;
v90.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1A7u,
v90,
1.0,
v23,
v24,
(std::string)&v81,
&v80,
(InputValueType)0,
Float,
6,
0,
a2,
0,
1,
2,
0);
v25 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v57 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v58 = __ldaxr(v57);
while ( __stlxr(v58 - 1, v57) );
}
else
{
v58 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v58 - 1;
}
if ( v58 <= 0 )
operator delete(v25);
}
sub_D153B8((int)&v81, "Dist3:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, 91.0, -60.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
v91.x = 0.65;
v91.y = 0.0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1AAu,
v91,
100.0,
v26,
v27,
(std::string)&v81,
&v80,
(InputValueType)0,
Int,
6,
0,
a2,
0,
1,
0,
0);
v28 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v65 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v66 = __ldaxr(v65);
while ( __stlxr(v66 - 1, v65) );
}
else
{
v66 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v66 - 1;
}
if ( v66 <= 0 )
operator delete(v28);
}
sub_D153B8((int)&v81, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -170.0, -95.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
SetupTriggerPopup::createToggleValueControl(a1, 138, 1.0, (__int64)&v81, &v80, 0, a2, 0);
v29 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v67 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v68 = __ldaxr(v67);
while ( __stlxr(v68 - 1, v67) );
}
else
{
v68 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v68 - 1;
}
if ( v68 <= 0 )
operator delete(v29);
}
sub_D153B8((int)&v81, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -110.0, -95.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
SetupTriggerPopup::createToggleValueControl(a1, 200, 1.0, (__int64)&v81, &v80, 0, a2, 0);
v30 = (void *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v69 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v70 = __ldaxr(v69);
while ( __stlxr(v70 - 1, v69) );
}
else
{
v70 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v70 - 1;
}
if ( v70 <= 0 )
operator delete(v30);
}
sub_D153B8((int)&v81, "Cam");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, -50.0, -95.0);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
SetupTriggerPopup::createToggleValueControl(a1, 428, 1.0, (__int64)&v81, &v80, 0, a2, 0);
v31 = (cocos2d::CCArray *)(*(_QWORD *)&v81 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v71 = (unsigned int *)(*(_QWORD *)&v81 - 8LL);
do
v72 = __ldaxr(v71);
while ( __stlxr(v72 - 1, v71) );
}
else
{
v72 = *(_DWORD *)(*(_QWORD *)&v81 - 8LL);
*(_DWORD *)(*(_QWORD *)&v81 - 8LL) = v72 - 1;
}
if ( v72 <= 0 )
operator delete(v31);
}
v32 = (cocos2d::CCArray *)cocos2d::CCArray::create(v31);
a1->m_proximityButtons = v32;
v33 = 0;
cocos2d::CCObject::retain(v32);
v74 = (int)a1->getValue(a1, 458);
PageContainer = SetupTriggerPopup::getPageContainer(a1, a2);
while ( 2 )
{
v79 = &byte_124B6C8;
switch ( v33 )
{
case 1:
sub_D1798C(&v79, "edit_areaModeBtn01_001.png", 26);
goto LABEL_15;
case 2:
sub_D1798C(&v79, "edit_areaModeBtn03_001.png", 26);
v34 = 180.0;
goto LABEL_16;
case 3:
sub_D1798C(&v79, "edit_areaModeBtn03_001.png", 26);
goto LABEL_15;
case 4:
sub_D1798C(&v79, "edit_areaModeBtn01_001.png", 26);
v34 = 90.0;
goto LABEL_16;
case 5:
sub_D1798C(&v79, "edit_areaModeBtn03_001.png", 26);
v34 = 90.0;
goto LABEL_16;
case 6:
sub_D1798C(&v79, "edit_areaModeBtn03_001.png", 26);
v34 = -90.0;
goto LABEL_16;
default:
sub_D1798C(&v79, "edit_areaModeBtn04_001.png", 26);
LABEL_15:
v34 = 0.0;
LABEL_16:
v35 = (ButtonSprite *)cocos2d::CCSprite::createWithSpriteFrameName(v79);
v35->setRotation(v35, v34);
if ( v74 == v33 )
v36 = "GJ_button_02.png";
else
v36 = "GJ_button_04.png";
v37 = (cocos2d::CCNode *)ButtonSprite::create(
v35,
(cocos2d::CCSprite *)&qword_20,
0,
(bool)&dword_0 + 1,
32.0,
1.0,
(cocos2d::CCSprite *)v36,
(const char *)&dword_0 + 1);
v83.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v83.adj = (size_t)SetupAudioTriggerPopup::onProxMode;
v38 = CCMenuItemSpriteExtra::create(v37, nullptr, v83);
v38->setTag(v38, v33);
cocos2d::CCArray::addObject(PageContainer, v38);
cocos2d::CCArray::addObject(a1->m_proximityButtons, v38);
v35->setScale(v35, 1.8);
setPosition = v35->setPosition;
v40 = *(float *)((__int64 (__fastcall *)(cocos2d::CCObject *))v38->__vftable[3].setTag)(v38);
v41 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v38->__vftable[3].setTag)(v38);
cocos2d::CCPoint::CCPoint(&v81, v40 * 0.5, *(float *)(v41 + 4) * 0.5);
setPosition(v35, &v81);
((void (__fastcall *)(cocos2d::CCObject *, float))v38->__vftable[2].copyWithZone)(v38, 0.6);
m_buttonMenu = a1->m_buttonMenu;
v38[7].m_nLuaID = 1058642330;
m_buttonMenu->addChild(m_buttonMenu, (cocos2d::CCNode *)v38);
v43 = 0.0;
if ( v33 > 3 )
v43 = -30.0;
v44 = a1->m_buttonMenu;
isEqual = v38->__vftable[2].isEqual;
cocos2d::CCPoint::CCPoint(
&v80,
(float)((float)(v75 * 0.5) + 60.0) + (float)((float)(v33 & 3) * 30.0),
v43 + (float)((float)(v76 * 0.5) + -54.0));
v82 = cocos2d::CCNode::convertToNodeSpace(v44, &v80);
((void (__fastcall *)(cocos2d::CCObject *, cocos2d::CCPoint *, float, float))isEqual)(v38, &v81, v82.x, v82.y);
v46 = (char *)(v79 - 24);
if ( v79 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v49 = (unsigned int *)(v79 - 8);
do
v50 = __ldaxr(v49);
while ( __stlxr(v50 - 1, v49) );
}
else
{
v50 = *((_DWORD *)v79 - 2);
*((_DWORD *)v79 - 2) = v50 - 1;
}
if ( v50 <= 0 )
operator delete(v46);
}
if ( ++v33 != 7 )
continue;
toggleGroup = a1->toggleGroup;
v48 = a1->getValue(a1, 428);
toggleGroup(a1, 428, v48 != 0.0);
SetupAudioTriggerPopup::updateSpecialGroup(a1);
return;
}
}
}