//
// GameLevelManager::encodeDataTo from 0x708a74 to 0x708c84 (528 bytes)
//
// 2 xrefs:
// > GameManager::encodeDataTo @ 0x5ff2c0
// > ??> @ 0x9ef40
//
// 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 GameLevelManager::encodeDataTo(GameLevelManager *a1, DS_Dictionary *a2)
{
cocos2d::CCArray *v4; // x0
cocos2d::CCArray *v5; // x22
cocos2d::CCDictionary *m_favoriteLists; // x0
cocos2d::CCDictElement *m_pElements; // x0
cocos2d::CCDictElement *i; // x19
DS_Dictionary::setDictForKey(a2, "GLM_01", a1->m_mainLevels);
GameLevelManager::limitSavedLevels(a1);
GameLevelManager::purgeUnusedLevels(a1);
GameLevelManager::updateLevelOrders(a1);
GameLevelManager::updateLevelOrders(a1);
DS_Dictionary::setDictForKey(a2, "GLM_03", a1->m_onlineLevels);
GameLevelManager::cleanupDailyLevels(a1);
DS_Dictionary::setDictForKey(a2, "GLM_10", a1->m_dailyLevels);
DS_Dictionary::setIntegerForKey(a2, "GLM_11", a1->m_activeDailyID);
DS_Dictionary::setIntegerForKey(a2, "GLM_17", a1->m_activeWeeklyID);
DS_Dictionary::setIntegerForKey(a2, "GLM_23", a1->m_activeEventID);
DS_Dictionary::setDictForKey(a2, "GLM_16", a1->m_gauntletLevels);
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
m_favoriteLists = a1->m_favoriteLists;
if ( m_favoriteLists )
{
m_pElements = m_favoriteLists->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
cocos2d::CCArray::addObject(v5, m_pElements->m_pObject);
m_pElements = i;
if ( !i )
break;
}
}
}
DS_Dictionary::setArrayForKey(a2, "GLM_22", v5);
DS_Dictionary::setBoolMapForKey(a2, "GLM_09", &a1->m_availableFilters);
if ( !GameManager::sharedState()->m_quickSave )
{
DS_Dictionary::setDictForKey(a2, "GLM_07", a1->m_downloadedLevels);
DS_Dictionary::setDictForKey(a2, "GLM_14", a1->m_reportedLevels);
}
DS_Dictionary::setDictForKey(a2, "GLM_12", a1->m_likedLevels);
DS_Dictionary::setDictForKey(a2, "GLM_13", a1->m_ratedLevels);
DS_Dictionary::setDictForKey(a2, "GLM_15", a1->m_ratedDemons);
DS_Dictionary::setDictForKey(a2, "GLM_06", a1->m_followedCreators);
DS_Dictionary::setDictForKey(a2, "GLM_08", a1->m_searchFilters);
DS_Dictionary::setDictForKey(a2, "GLM_18", a1->m_onlineFolders);
DS_Dictionary::setDictForKey(a2, "GLM_19", a1->m_localLevelsFolders);
DS_Dictionary::setArrayForKey(a2, "GLM_20", a1->m_smartTemplates);
}