//
// LevelListLayer::onFavorite from 0xa72690 to 0xa72750 (192 bytes)
//
// 3 xrefs:
// > ??> @ 0x68928
// > LevelListLayer::init @ 0xa7721c
// > ??> @ 0x122b648
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelListLayer::onFavorite(LevelListLayer *a1, cocos2d::CCObject *a2)
{
GJLevelList *m_levelList; // x2
void (__fastcall *v5)(cocos2d::CCObject *__hidden); // x1
int v6; // w20
__int64 v7; // x21
void (__fastcall *v8)(__int64, cocos2d::CCSpriteFrame *); // x22
cocos2d::CCSpriteFrameCache *v9; // x0
cocos2d::CCSpriteFrame *v10; // x0
GameLevelManager *v11; // x0
cocos2d::CCSpriteFrame *v12; // x0
GameLevelManager *v13; // x0
if ( !a1->m_exiting )
{
m_levelList = a1->m_levelList;
v5 = a2->__vftable[13].~CCObject_0;
v6 = !m_levelList->m_favorite;
m_levelList->m_favorite ^= 1u;
v7 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v5)(a2);
v8 = *(void (__fastcall **)(__int64, cocos2d::CCSpriteFrame *))(*(_QWORD *)v7 + 1144LL);
v9 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( v6 )
{
v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v9, "gj_heartOn_001.png");
v8(v7, v10);
v11 = GameLevelManager::sharedState();
GameLevelManager::saveLevelList(v11, a1->m_levelList);
}
else
{
v12 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v9, "gj_heartOff_001.png");
v8(v7, v12);
v13 = GameLevelManager::sharedState();
GameLevelManager::deleteLevelList(v13, a1->m_levelList);
}
}
}