//
// GameLevelManager::gotoLevelPage from 0x100537fd0 to 0x10053812e (350 bytes)
//
// 2 xrefs:
// > LevelCell::onClick @ 0x100252238
// > GauntletLayer::onLevel @ 0x100394614
//
// 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::gotoLevelPage(GameLevelManager *a1, GJGameLevel *a2)
{
GJGameLevel *v2; // rbx
GJLevelType m_levelType; // eax
cocos2d::CCDirector *v4; // r14
cocos2d::CCScene *v5; // rax
cocos2d::CCTransitionFade *v6; // rax
cocos2d::CCScene *v7; // rax
int random; // esi
bool v9; // cc
int v10; // esi
GJGameLevel *SavedGauntletLevel; // rax
int v12; // esi
bool m_gauntletLevel; // r15
cocos2d::CCScene *v14; // rax
v2 = a2;
GameManager::sharedState()->m_searchObjectBool = 1;
if ( !a2 )
return;
m_levelType = a2->m_levelType;
switch ( m_levelType )
{
case SearchResult:
random = a2->m_dailyID.random;
v9 = random <= v2->m_dailyID.seed;
v10 = random - v2->m_dailyID.seed;
if ( v9 )
{
v12 = v2->m_levelID.random - v2->m_levelID.seed;
if ( v2->m_gauntletLevel )
SavedGauntletLevel = GameLevelManager::getSavedGauntletLevel(a1, v12);
else
SavedGauntletLevel = GameLevelManager::getSavedLevel(a1, v12);
}
else
{
SavedGauntletLevel = GameLevelManager::getSavedDailyLevel(a1, v10);
}
if ( SavedGauntletLevel )
{
if ( SavedGauntletLevel->m_levelNotDownloaded )
{
GameLevelManager::saveLevel(a1, v2);
}
else if ( SavedGauntletLevel->m_levelVersion >= v2->m_levelVersion )
{
SavedGauntletLevel->m_songID = v2->m_songID;
v2 = SavedGauntletLevel;
}
}
m_gauntletLevel = v2->m_gauntletLevel;
v4 = cocos2d::CCDirector::sharedDirector();
v14 = LevelInfoLayer::scene(v2, 0);
v6 = cocos2d::CCTransitionFade::create_1(0.5, v14);
if ( m_gauntletLevel )
goto LABEL_19;
goto LABEL_20;
case Saved:
v4 = cocos2d::CCDirector::sharedDirector();
v7 = LevelInfoLayer::scene(a2, 0);
v6 = cocos2d::CCTransitionFade::create_1(0.5, v7);
LABEL_20:
cocos2d::CCDirector::pushScene(v4, v6);
return;
case Editor:
v4 = cocos2d::CCDirector::sharedDirector();
v5 = EditLevelLayer::scene(a2);
v6 = cocos2d::CCTransitionFade::create_1(0.5, v5);
LABEL_19:
cocos2d::CCDirector::replaceScene(v4, v6);
break;
}
}