//
// GJRateEditorSoundLayer::onCustomButton from 0x5669b0 to 0x566ad6 (294 bytes)
//
// 0 xrefs:
//
// 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:52:28 +0000
//
float __fastcall GJRateEditorSoundLayer::onCustomButton(GJRateEditorSoundLayer *this, cocos2d::CCObject *a2)
{
char **v4; // r4
float result; // r0
GameLevelManager *v6; // r0
int v7; // r2
int v8; // [sp+Ch] [bp-14h]
int v9; // [sp+10h] [bp-10h] BYREF
int v10; // [sp+14h] [bp-Ch]
int v11; // [sp+18h] [bp-8h]
if ( (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 32))(a2) == -21 )
{
v9 = 0;
v10 = 0;
v11 = 0;
std::string::__init(&v9, "Do you want to unrate this sound pack?", 0x26u);
v4 = (char **)FLAlertLayer::create(
(int)this + 720,
(cocos2d::CCLabelBMFont *)"Unrate Sound Pack",
(int)&v9,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Unrate",
380.0);
std::string::~string((int)&v9);
ButtonSprite::updateBGImage(v4[121], "GJ_button_06.png");
(*((void (__fastcall **)(char **, int))*v4 + 9))(v4, -22);
return COERCE_FLOAT((*((int (__fastcall **)(char **))*v4 + 164))(v4));
}
else
{
LODWORD(result) = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 32))(a2) + 23;
if ( result == 0.0 )
{
result = (*(float (__fastcall **)(GJRateEditorSoundLayer *, int))(*(_DWORD *)this + 732))(this, -20);
v8 = (int)result;
if ( (int)result > 0 )
{
v6 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)LODWORD(result));
result = COERCE_FLOAT(GameLevelManager::updateEditorSoundRankAdmin(v6, *(_DWORD *)(*((_DWORD *)this + 181) + 264), v8));
if ( result != 0.0 )
{
*(_DWORD *)(GameLevelManager::sharedState((GameLevelManager *)LODWORD(result)) + 888) = (char *)this + 716;
v7 = *((_DWORD *)this + 182);
if ( v7 )
*(_DWORD *)(v7 + 520) = 0;
v9 = 0;
v10 = 0;
v11 = 0;
std::string::__init(&v9, "Updating rank...", 0x10u);
*((_DWORD *)this + 182) = UploadActionPopup::create((char *)this + 712, &v9);
std::string::~string((int)&v9);
return COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 182) + 656))(*((_DWORD *)this + 182)));
}
}
}
}
return result;
}