//
// EditorSoundsSettingsPopup::onDownloadAll from 0x1403d4dc0 to 0x1403d4feb (555 bytes)
//
// 2 xrefs:
// > EditorSoundsSettingsPopup::init @ 0x1403d4bfe
// > ??> @ 0x14092492c
//
// This function is hookable on this platform (idp: pc, 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 11:31:36 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall EditorSoundsSettingsPopup::onDownloadAll(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdx
__int64 v4; // rax
cocos2d::CCObject *v5; // rbx
__int64 v6; // rax
size_t v7; // r8
__int64 v8; // rax
__int128 v9; // [rsp+50h] [rbp-B0h] BYREF
__int64 v10; // [rsp+60h] [rbp-A0h]
__int64 v11; // [rsp+68h] [rbp-98h]
__int128 *v12; // [rsp+70h] [rbp-90h]
__int128 *v13; // [rsp+78h] [rbp-88h]
__int64 v14; // [rsp+80h] [rbp-80h] BYREF
__int64 v15; // [rsp+88h] [rbp-78h]
_BYTE v16[40]; // [rsp+98h] [rbp-68h] BYREF
wchar_t Buffer[64]; // [rsp+C0h] [rbp-40h] BYREF
v2 = EditorSFXManager::sharedState();
EditorSFXManager::collectAllSFXIDs(v2, (__int64)&v14);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 992LL))(a1, 0);
LOBYTE(v3) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 520LL))(a1, v3);
if ( v14 == v15 )
{
v9 = 0;
*(_QWORD *)&v9 = sub_14003D460(0x20u);
v10 = 23;
v11 = 31;
strcpy((char *)v9, "No SFX IDs to download.");
v12 = &v9;
v4 = sub_14003F4F0((__int64)v16, (__int64)&v9);
v5 = FLAlertLayer::create(0, (int)"Download", v4, (__int64)"OK", 0, 1132593152, 0, 0, 1065353216);
}
else
{
v6 = EditorSFXManager::sharedState();
EditorSFXManager::downloadAllMissing(v6);
swprintf(
Buffer,
0x80u,
"Requested download for %u SFX. Missing files will be fetched in the background.",
(v15 - v14) >> 2);
v9 = 0;
v10 = 0;
v11 = 0;
v7 = -1;
do
++v7;
while ( *((_BYTE *)Buffer + v7) );
sub_14003D230(&v9, Buffer, v7);
v13 = &v9;
v8 = sub_14003F4F0((__int64)v16, (__int64)&v9);
v5 = FLAlertLayer::create(0, (int)"Download", v8, (__int64)"OK", 0, 1134559232, 0, 0, 1065353216);
}
sub_14003D310((__int64)&v9);
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v5 + 1064LL))(v5);
sub_140069730((__int64)&v14);
}