//
// EditorSoundsSettingsPopup::onDownloadAll from 0xcd833c to 0xcd8540 (516 bytes)
//
// 3 xrefs:
// > ??> @ 0xdaed8
// > EditorSoundsSettingsPopup::init @ 0xcd7ff8
// > ??> @ 0x15468e0
//
// 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:31 +0000
//
__int64 __fastcall EditorSoundsSettingsPopup::onDownloadAll(EditorSoundsSettingsPopup *this, cocos2d::CCObject *a2)
{
EditorSFXManager *v3; // x0
EditorSFXManager *v4; // x0
size_t v5; // x0
__int64 v6; // x0
__int64 v8; // x0
void *v9; // [xsp+30h] [xbp+30h] BYREF
EditorSFXManager *v10; // [xsp+38h] [xbp+38h]
__int64 v11[2]; // [xsp+48h] [xbp+48h] BYREF
void *v12; // [xsp+58h] [xbp+58h]
__int64 v13[2]; // [xsp+60h] [xbp+60h] BYREF
void *v14; // [xsp+70h] [xbp+70h]
char s[128]; // [xsp+78h] [xbp+78h] BYREF
v3 = (EditorSFXManager *)EditorSFXManager::sharedState(_stack_chk_guard);
EditorSFXManager::collectAllSFXIDs(v3, (int **)&v9);
EditorSoundsSettingsPopup::onClose(this, nullptr);
if ( v9 == v10 )
{
v11[0] = 0;
v11[1] = 0;
v12 = nullptr;
std::string::__init(v11, "No SFX IDs to download.", 0x17u);
v8 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Download",
(char *)v11,
(ButtonSprite *)"OK",
nullptr,
260.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1312LL))(v8);
if ( (v11[0] & 1) != 0 )
operator delete(v12);
}
else
{
v4 = (EditorSFXManager *)EditorSFXManager::sharedState(v10);
EditorSFXManager::downloadAllMissing(v4);
snprintf(
s,
0x80u,
"Requested download for %u SFX. Missing files will be fetched in the background.",
(unsigned __int64)(v10 - (EditorSFXManager *)v9) >> 2);
v13[0] = 0;
v13[1] = 0;
v14 = nullptr;
v5 = strlen(s);
std::string::__init(v13, s, v5);
v6 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Download",
(char *)v13,
(ButtonSprite *)"OK",
nullptr,
320.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);
if ( (v13[0] & 1) != 0 )
operator delete(v14);
}
if ( v9 )
{
if ( v9 != v10 )
v10 = (EditorSFXManager *)((char *)v10
+ 4
* ~((unsigned __int64)((EditorSFXManager *)((char *)v10 - 4) - (EditorSFXManager *)v9) >> 2));
operator delete(v9);
}
return _stack_chk_guard;
}