//
// GameLevelManager::encodeDataTo from 0x10009add0 to 0x10009afd4 (516 bytes)
//
// 1 xrefs:
// > GameManager::encodeDataTo @ 0x10031ce18
//
// 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 __fastcall GameLevelManager::encodeDataTo(GameLevelManager *a1, DS_Dictionary *a2)
{
__int64 v4; // x0
cocos2d::CCArray *v5; // x21
cocos2d::CCDictionary *m_favoriteLists; // x8
cocos2d::CCDictElement *m_pElements; // x8
cocos2d::CCDictElement *next; // x22
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_1(a2, "GLM_11", a1->m_activeDailyID);
DS_Dictionary::setIntegerForKey_1(a2, "GLM_17", a1->m_activeWeeklyID);
DS_Dictionary::setIntegerForKey_1(a2, "GLM_23", a1->m_activeEventID);
DS_Dictionary::setDictForKey(a2, "GLM_16", a1->m_gauntletLevels);
v5 = (cocos2d::CCArray *)sub_10024A15C(v4);
m_favoriteLists = a1->m_favoriteLists;
if ( m_favoriteLists )
{
m_pElements = m_favoriteLists->m_pElements;
if ( m_pElements )
{
do
{
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
sub_10024A2D0(v5, m_pElements->m_pObject);
m_pElements = next;
}
while ( next );
}
}
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);
}