//
// SFXBrowser::onClose from 0x6c86f4 to 0x6c881e (298 bytes)
//
// 1 xrefs:
// > SFXBrowser::keyBackClicked @ 0x6c884a
//
// 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:56 +0000
//
int __fastcall SFXBrowser::onClose(SFXBrowser *this, cocos2d::CCObject *a2, int a3, int a4)
{
SFXSearchResult *v5; // r0
int ActiveFolder; // r0
int v7; // r3
int v8; // r2
int v9; // r1
int v10; // r0
int v11; // r1
int v12; // r2
int v13; // r3
void (__fastcall ***v14)(_DWORD, SFXBrowser *); // r0
SFXBrowser *v16; // [sp+0h] [bp-10h] BYREF
cocos2d::CCObject *v17; // [sp+4h] [bp-Ch]
int v18; // [sp+8h] [bp-8h]
int v19; // [sp+Ch] [bp-4h]
v16 = this;
v17 = a2;
v18 = a3;
v19 = a4;
v5 = *((SFXSearchResult **)this + 136);
if ( v5 )
{
ActiveFolder = SFXSearchResult::getActiveFolder(v5);
v7 = *((_DWORD *)this + 136);
v8 = *(_DWORD *)(v7 + 104);
if ( v8 )
{
if ( v8 == 4 && ActiveFolder )
*((_DWORD *)this + 180) = *(_DWORD *)(ActiveFolder + 72);
}
else if ( ActiveFolder )
{
*((_DWORD *)this + 179) = *(_DWORD *)(ActiveFolder + 52);
}
SFXBrowser::s_savedFolderID = *((_DWORD *)this + 179);
SFXBrowser::s_savedCustomFolderID = *((_DWORD *)this + 180);
SFXBrowser::s_savedPage = *(_DWORD *)(v7 + 72);
if ( *((_BYTE *)this + 624) && (v9 = *((_DWORD *)this + 152)) != 0 )
{
CCTextInputNode::getString((CCTextInputNode *)&v16, v9);
if ( (SFXBrowser::s_savedSearchString & 1) != 0 )
{
*(_BYTE *)dword_D2D844 = 0;
dword_D2D840 = 0;
}
else
{
LOWORD(SFXBrowser::s_savedSearchString) = 0;
}
std::string::reserve(&SFXBrowser::s_savedSearchString, 0);
v10 = (int)v16;
v11 = (int)v17;
v12 = v18;
v16 = nullptr;
v17 = nullptr;
v18 = 0;
SFXBrowser::s_savedSearchString = v10;
dword_D2D840 = v11;
dword_D2D844 = v12;
std::string::~string((int)&v16);
}
else
{
std::string::operator=((unsigned __int8 *)&SFXBrowser::s_savedSearchString, (unsigned __int8 *)(v7 + 80));
}
SFXBrowser::s_savedSort = *((_DWORD *)this + 193);
SFXBrowser::s_savedViewMode = *(_DWORD *)(*((_DWORD *)this + 136) + 104);
SFXBrowser::s_savedTreeMode = *((_DWORD *)this + 194);
SFXBrowser::s_savedHasState = 1;
}
v13 = *((_DWORD *)this + 152);
if ( v13 )
{
*(_DWORD *)(v13 + 420) = 0;
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 152) + 580))(*((_DWORD *)this + 152));
}
v14 = *((void (__fastcall ****)(_DWORD, SFXBrowser *))this + 195);
if ( v14 )
(**v14)(v14, this);
(*(void (__fastcall **)(SFXBrowser *, _DWORD))(*(_DWORD *)this + 536))(this, 0);
return (*(int (__fastcall **)(SFXBrowser *, int))(*(_DWORD *)this + 264))(this, 1);
}