//
// EditorSoundConfigInfoLayer::onFavorite from 0x7851dc to 0x7852c2 (230 bytes)
//
// 1 xrefs:
// > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0x78632a
//
// 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:59:32 +0000
//
EditorSFXManager *__fastcall EditorSoundConfigInfoLayer::onFavorite(EditorSFXManager *this, cocos2d::CCObject *a2)
{
int v2; // r4
EditorSFXManager *FavoriteConfig; // r0
cocos2d::CCArray **v4; // r0
unsigned int v5; // r0
EditorSFXManager *v6; // r0
EditorSFXManager *FavoriteConfigs; // r0
int *v8; // r0
cocos2d::CCArray *v9; // r0
int v10[3]; // [sp+8h] [bp-10h] BYREF
v2 = (int)this;
if ( *((_DWORD *)this + 187) )
{
FavoriteConfig = (EditorSFXManager *)EditorSFXManager::sharedState(this);
if ( FavoriteConfig
&& (v4 = (cocos2d::CCArray **)EditorSFXManager::sharedState(FavoriteConfig),
(FavoriteConfig = (EditorSFXManager *)EditorSFXManager::getFavoriteConfig(
v4,
*(_DWORD *)(*(_DWORD *)(v2 + 748) + 264))) != nullptr) )
{
v5 = EditorSFXManager::sharedState(FavoriteConfig);
EditorSFXManager::removeFavoriteConfig(v5, *(_DWORD *)(*(_DWORD *)(v2 + 748) + 264));
EditorSoundConfigInfoLayer::refreshActionButtons((EditorSoundConfigInfoLayer *)v2);
this = *(EditorSFXManager **)(v2 + 756);
if ( this )
return (EditorSFXManager *)EditorSoundBrowserLayer::onConfigListChanged(this);
}
else if ( *(_BYTE *)(*(_DWORD *)(v2 + 748) + 384) )
{
v6 = (EditorSFXManager *)EditorSFXManager::sharedState(FavoriteConfig);
FavoriteConfigs = (EditorSFXManager *)EditorSFXManager::getFavoriteConfigs(v6);
if ( FavoriteConfigs
&& (FavoriteConfigs = (EditorSFXManager *)cocos2d::CCArray::count(FavoriteConfigs),
(unsigned int)FavoriteConfigs > 0x31) )
{
memset(v10, 0, sizeof(v10));
std::string::__init(v10, "You have reached the maximum of 50 favorites. Remove some first.", 0x40u);
v8 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Limit Reached", (int)v10, (ButtonSprite *)"OK", nullptr);
(*(void (__fastcall **)(int *))(*v8 + 656))(v8);
return (EditorSFXManager *)std::string::~string((int)v10);
}
else
{
v9 = (cocos2d::CCArray *)EditorSFXManager::sharedState(FavoriteConfigs);
EditorSFXManager::addFavoriteConfig(v9, *(GJEditorSoundConfig **)(v2 + 748));
return (EditorSFXManager *)EditorSoundConfigInfoLayer::refreshActionButtons((EditorSoundConfigInfoLayer *)v2);
}
}
else
{
*(_BYTE *)(v2 + 765) = 1;
return (EditorSFXManager *)EditorSoundConfigInfoLayer::startDownload(v2);
}
}
return this;
}