//
// GJKeybindManager::handleGlobalAudioAction from 0x7144e4 to 0x7146ca (486 bytes)
//
// 1 xrefs:
// > GJKeybindManager::handleGlobalAction @ 0x7146f0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:57:46 +0000
//
bool __fastcall GJKeybindManager::handleGlobalAudioAction(GJKeybindManager *this, int a2, bool a3)
{
_BOOL4 v4; // r4
FMODAudioEngine *v6; // r0
int v7; // s15
int v8; // r0
FMODAudioEngine *v9; // r0
int v10; // r0
int v11; // r0
float v12; // s16
FMODAudioEngine *v13; // r0
GameManager *v14; // r0
GameManager *v15; // r0
int v16; // r0
const char *v17; // r4
int v18; // r8
cocos2d::CCString *v19; // r0
const char *CString; // r7
size_t v21; // r0
cocos2d::CCNode *v22; // r0
int v23; // [sp+8h] [bp-28h] BYREF
size_t v24; // [sp+Ch] [bp-24h]
const void *v25; // [sp+10h] [bp-20h]
int v26[3]; // [sp+14h] [bp-1Ch] BYREF
int v27; // [sp+20h] [bp-10h] BYREF
size_t v28; // [sp+24h] [bp-Ch]
const void *v29; // [sp+28h] [bp-8h]
v4 = (unsigned int)this - 1001 <= 1;
if ( (unsigned int)this - 1001 <= 1 )
{
if ( a2 )
{
v9 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(this);
v7 = (int)(float)((float)(COERCE_FLOAT(FMODAudioEngine::getBackgroundMusicVolume(v9)) * 100.0) + 0.5);
if ( this == (GJKeybindManager *)&stru_3DC.st_other )
{
v8 = 10;
LABEL_12:
v10 = v7 + v8;
if ( v10 < 0 )
{
v10 = 0;
}
else if ( v10 >= 100 )
{
v10 = 100;
}
v11 = 10 * ((v10 + 5) / 10);
v12 = (float)v11 / 100.0;
v13 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)v11);
if ( v4 )
v14 = FMODAudioEngine::setBackgroundMusicVolume(v13, v12);
else
v14 = FMODAudioEngine::setEffectsVolume(v13, v12);
v15 = (GameManager *)GameManager::sharedState(v14);
if ( *((_DWORD *)v15 + 186) )
{
v16 = GameManager::sharedState(v15);
v15 = (GameManager *)(***(int (__fastcall ****)(_DWORD))(v16 + 744))(*(_DWORD *)(v16 + 744));
}
if ( v4 )
v17 = "Music";
else
v17 = "SFX";
v18 = *(_DWORD *)(cocos2d::CCDirector::sharedDirector(v15) + 220);
if ( v18 )
{
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s Volume: %d%%",
v17,
(int)(float)((float)(v12 * 100.0) + 0.5));
v23 = 0;
v24 = 0;
v25 = nullptr;
CString = (const char *)cocos2d::CCString::getCString(v19);
v21 = strlen(CString);
std::string::__init(&v23, CString, v21);
v27 = 0;
v28 = 0;
v29 = nullptr;
if ( (v23 & 1) != 0 )
{
std::string::__init(&v27, v25, v24);
}
else
{
v27 = v23;
v28 = v24;
v29 = v25;
}
memset(v26, 0, sizeof(v26));
std::string::__init(v26, &unk_B6B226, 0);
v22 = TextAlertPopup::create((int)&v27, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)v26);
TextAlertPopup::replaceIn(v18, 5656396, v22, 1000);
std::string::~string((int)v26);
std::string::~string((int)&v27);
std::string::~string((int)&v23);
}
return 1;
}
LABEL_6:
if ( this == (GJKeybindManager *)&stru_3EC )
v8 = 10;
else
v8 = -10;
goto LABEL_12;
}
}
else
{
if ( (unsigned int)this - 1004 > 1 )
return (unsigned int)this - 1001 <= 1;
if ( a2 )
{
v6 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(this);
v7 = (int)(float)((float)(COERCE_FLOAT(FMODAudioEngine::getEffectsVolume(v6)) * 100.0) + 0.5);
goto LABEL_6;
}
}
return 1;
}