//
// GameLevelManager::deleteLevel from 0x3c69cc to 0x3c6ac8 (252 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::onDelete @ 0x3b293a
// > EditLevelLayer::onDelete @ 0x3b7fe2
// > LevelBrowserLayer::deleteSelected @ 0x3bdab6
// > LevelBrowserLayer::FLAlert_Clicked @ 0x3bdb9e
//
// 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::deleteLevel(GameLevelManager *a1, GJGameLevel *a2)
{
LocalLevelManager *v4; // r0
cocos2d::CCDictionary *m_onlineLevels; // r5
char *LevelKey; // r0
GJGameLevel *v7; // r5
cocos2d::CCDictionary *v8; // r5
char *v9; // r0
std::string v10; // [sp+8h] [bp-Ch] BYREF
if ( a2->m_levelType == Editor )
{
v4 = LocalLevelManager::sharedState();
cocos2d::CCArray::removeObject(v4->m_localLevels, a2, 1);
}
else
{
m_onlineLevels = a1->m_onlineLevels;
LevelKey = (char *)GameLevelManager::getLevelKey(a1, a2->m_levelID.random - a2->m_levelID.seed);
sub_776584((int)&v10, LevelKey);
v7 = (GJGameLevel *)cocos2d::CCDictionary::objectForKey(m_onlineLevels, &v10);
sub_774008(&v10);
if ( v7
&& (GJGameLevel::getNormalPercent(v7) > 0
|| v7->m_practicePercent > 0
|| v7->m_bestTime > 0
|| v7->m_bestPoints
|| v7->m_levelFavorited) )
{
sub_776584((int)&v10, (char *)&unk_939830);
sub_775D40(&v7->m_levelString, &v10);
sub_774008(&v10);
v7->m_levelNotDownloaded = 1;
}
else
{
v8 = a1->m_onlineLevels;
v9 = (char *)GameLevelManager::getLevelKey(a1, a2->m_levelID.random - a2->m_levelID.seed);
sub_776584((int)&v10, v9);
cocos2d::CCDictionary::removeObjectForKey(v8);
sub_774008(&v10);
}
}
}