//
// SFXBrowser::sfxFoldersPicked from 0x6c8c38 to 0x6c8f22 (746 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'SFXBrowser::sfxFoldersPicked @ 0x6c8f60
//
// 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:56:57 +0000
//
GameManager *__fastcall SFXBrowser::sfxFoldersPicked(GameManager *a1, int a2, _DWORD **a3)
{
GameManager *result; // r0
GameManager *CustomSFXCount; // r0
int v7; // r5
int v8; // r8
MusicDownloadManager *v9; // r0
int v10; // r2
int v11; // r3
int v12; // r9
int v13; // r1
int v14; // r2
void (__fastcall *v15)(GameManager *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v16; // r0
void (__fastcall *v17)(GameManager *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v18; // r0
void (__fastcall *v19)(GameManager *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v20; // r0
int v21; // r0
const char *v22; // r1
__int16 *v23; // r2
cocos2d::CCString *v24; // r0
const char *CString; // r6
size_t v26; // r0
void (__fastcall *v27)(GameManager *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v28; // r0
int v29; // r1
int v30; // r2
int v31; // [sp+8h] [bp-34h] BYREF
int v32; // [sp+Ch] [bp-30h] BYREF
int v33[3]; // [sp+10h] [bp-2Ch] BYREF
int v34; // [sp+1Ch] [bp-20h] BYREF
int v35; // [sp+20h] [bp-1Ch]
int v36; // [sp+24h] [bp-18h]
int v37; // [sp+28h] [bp-14h] BYREF
int v38; // [sp+2Ch] [bp-10h]
int v39; // [sp+30h] [bp-Ch]
result = (GameManager *)GameManager::sharedState(a1);
if ( *((_DWORD *)result + 102) )
{
result = (GameManager *)GameManager::sharedState(result);
if ( *(_DWORD *)(*((_DWORD *)result + 102) + 2084) )
{
CustomSFXCount = (GameManager *)GameManager::sharedState(result);
v7 = *(_DWORD *)(*((_DWORD *)CustomSFXCount + 102) + 2084);
v8 = *(_DWORD *)(v7 + 476);
if ( v8 )
{
CustomSFXCount = (GameManager *)GameManager::sharedState(CustomSFXCount);
v8 = v8 == *((_DWORD *)CustomSFXCount + 116) - *((_DWORD *)CustomSFXCount + 117);
}
if ( a3[2] )
{
v9 = (MusicDownloadManager *)MusicDownloadManager::sharedState(CustomSFXCount);
CustomSFXCount = (GameManager *)MusicDownloadManager::getCustomSFXCount(v9, a3, v10, v11);
v12 = (int)CustomSFXCount;
}
else
{
v12 = 0;
}
if ( (unsigned int)(v12 - 1) >= 0x3E8 )
{
*(_DWORD *)(v7 + 476) = 0;
std::__tree::clear(v7 + 480);
if ( (*(_BYTE *)(v7 + 464) & 1) != 0 )
{
**(_BYTE **)(v7 + 472) = 0;
*(_DWORD *)(v7 + 468) = 0;
}
else
{
*(_BYTE *)(v7 + 465) = 0;
*(_BYTE *)(v7 + 464) = 0;
}
if ( v12 <= 1000 )
{
if ( a3[2] )
{
v17 = *(void (__fastcall **)(GameManager *, cocos2d::CCNode *, int))(*(_DWORD *)a1 + 232);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "No custom folders to share", 0x1Au);
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, &unk_B6B226, 0);
v18 = TextAlertPopup::create((int)&v34, (cocos2d::CCDelayTime *)0x3F666666, 0.5, 150, (int)&v37);
v17(a1, v18, 100);
}
else
{
if ( !v8 )
return SFXBrowser::updateShareItem(a1, v13, v14);
v19 = *(void (__fastcall **)(GameManager *, cocos2d::CCNode *, int))(*(_DWORD *)a1 + 232);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "SFX folders no longer saved with this level", 0x2Bu);
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, &unk_B6B226, 0);
v20 = TextAlertPopup::create((int)&v34, (cocos2d::CCDelayTime *)0x3F666666, 0.5, 150, (int)&v37);
v19(a1, v20, 100);
}
}
else
{
v15 = *(void (__fastcall **)(GameManager *, cocos2d::CCNode *, int))(*(_DWORD *)a1 + 232);
v34 = 0;
v35 = 0;
v36 = 0;
std::string::__init(&v34, "Setup too large to share", 0x18u);
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, &unk_B6B226, 0);
v16 = TextAlertPopup::create((int)&v34, (cocos2d::CCDelayTime *)0x3F666666, 0.5, 150, (int)&v37);
v15(a1, v16, 100);
}
std::string::~string((int)&v37);
std::string::~string((int)&v34);
return SFXBrowser::updateShareItem(a1, v13, v14);
}
v21 = GameManager::sharedState(CustomSFXCount);
*(_DWORD *)(v7 + 476) = *(_DWORD *)(v21 + 464) - *(_DWORD *)(v21 + 468);
if ( (_DWORD **)(v7 + 480) != a3 )
std::__tree::__assign_multi *,int>>(
v7 + 480,
*a3,
a3 + 1);
v31 = -1;
if ( std::__tree::__count_unique(a3, &v31) )
{
CString = "All SFX folders will be saved with this level";
}
else
{
v32 = 1;
if ( std::__tree::__count_unique(a3, &v32) )
{
CString = "All SFX folders will be saved with this level";
}
else
{
v22 = (const char *)a3[2];
if ( v22 == (_BYTE *)&dword_0 + 1 )
v23 = (__int16 *)&unk_B6B226;
else
v23 = &a1i2r3e45s789g[8];
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i folder%s will be saved with this level",
v22,
v23);
CString = (const char *)cocos2d::CCString::getCString(v24);
}
}
memset(v33, 0, sizeof(v33));
v26 = strlen(CString);
std::string::__init(v33, CString, v26);
v27 = *(void (__fastcall **)(GameManager *, cocos2d::CCNode *, int))(*(_DWORD *)a1 + 232);
std::string::basic_string(&v34, (int)v33);
v37 = 0;
v38 = 0;
v39 = 0;
std::string::__init(&v37, &unk_B6B226, 0);
v28 = TextAlertPopup::create((int)&v34, (cocos2d::CCDelayTime *)0x3F666666, 0.5, 150, (int)&v37);
v27(a1, v28, 100);
std::string::~string((int)&v37);
std::string::~string((int)&v34);
SFXBrowser::updateShareItem(a1, v29, v30);
return (GameManager *)std::string::~string((int)v33);
}
}
return result;
}