//
// EditorSoundConfigInfoLayer::onDownloadSFX from 0xcd30e8 to 0xcd3338 (592 bytes)
//
// 3 xrefs:
// > ??> @ 0xd2b80
// > EditorSoundConfigInfoLayer::init @ 0xcd1a80
// > ??> @ 0x15463f8
//
// 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:06:28 +0000
//
__int64 __fastcall EditorSoundConfigInfoLayer::onDownloadSFX(EditorSoundConfigInfoLayer *this, cocos2d::CCObject *a2)
{
__int64 v3; // x20
void (__fastcall *v4)(EditorSoundConfigInfoLayer *, __int64, __int64); // x23
__int64 v5; // x0
char *v7; // x21
char *v8; // x22
cocos2d::CCString *v9; // x0
const char *CString; // x0
size_t v11; // x0
size_t v12; // x0
__int64 v13; // x20
char *v14; // [xsp+48h] [xbp+48h]
void *v15; // [xsp+50h] [xbp+50h] BYREF
_BYTE *v16; // [xsp+58h] [xbp+58h]
__int64 v17; // [xsp+68h] [xbp+68h] BYREF
__int64 v18; // [xsp+70h] [xbp+70h]
void *v19; // [xsp+78h] [xbp+78h]
__int64 v20; // [xsp+80h] [xbp+80h] BYREF
__int64 v21; // [xsp+88h] [xbp+88h]
void *v22; // [xsp+90h] [xbp+90h]
EditorSoundConfigInfoLayer::missingSFXIDs(this, &v15);
v3 = (v16 - (_BYTE *)v15) >> 2;
if ( v15 )
{
if ( v15 != v16 )
v16 += 4 * ~((unsigned __int64)(v16 - 4 - (_BYTE *)v15) >> 2);
operator delete(v15);
}
if ( (_DWORD)v3 )
{
v7 = (char *)this + 1032;
v8 = (char *)&v17 + 1;
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Download %i SFX from this pack?",
(const char *)(unsigned int)v3);
CString = (const char *)cocos2d::CCString::getCString(v9);
v17 = 0;
v14 = (char *)CString;
v18 = 0;
v19 = nullptr;
v11 = strlen(CString);
std::string::__init(&v17, v14, v11);
if ( (v17 & 1) != 0 )
v8 = (char *)v19;
v20 = 0;
v21 = 0;
v22 = nullptr;
v12 = strlen(v8);
std::string::__init(&v20, v8, v12);
v13 = FLAlertLayer::create(
(__int64)v7,
(cocos2d::CCLabelBMFont *)"Download SFX",
(char *)&v20,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Download",
300.0);
if ( (v20 & 1) != 0 )
operator delete(v22);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v13 + 72LL))(v13, 7007);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 1312LL))(v13);
}
else
{
v4 = *(void (__fastcall **)(EditorSoundConfigInfoLayer *, __int64, __int64))(*(_QWORD *)this + 464LL);
v17 = 0;
v18 = 0;
v19 = nullptr;
std::string::__init(&v17, "All SFX downloaded", 0x12u);
v20 = 0;
v21 = 0;
v22 = nullptr;
std::string::__init(&v20, &byte_11B8890, 0);
v5 = TextAlertPopup::create((char *)&v17, 150, (char *)&v20, 0.5, 0.6);
v4(this, v5, 100);
if ( (v20 & 1) != 0 )
operator delete(v22);
}
if ( (v17 & 1) != 0 )
operator delete(v19);
return _stack_chk_guard;
}