//
// LevelInfoLayer::onUpdate from 0x7e77a8 to 0x7e786c (196 bytes)
//
// 3 xrefs:
// > ??> @ 0x9e0e0
// > LevelInfoLayer::init @ 0x7ec81c
// > ??> @ 0x15445e0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:54:29 +0000
//
LevelInfoLayer *__fastcall LevelInfoLayer::onUpdate(LevelInfoLayer *this, cocos2d::CCObject *a2)
{
__int64 v2; // x19
_BOOL8 shouldDownloadLevel; // x0
GameLevelManager *v4; // x0
GameLevelManager *v5; // x0
GameLevelManager *v6; // x0
GameLevelManager *v7; // x0
if ( !*((_BYTE *)this + 488) )
{
v2 = (__int64)this;
shouldDownloadLevel = LevelInfoLayer::shouldDownloadLevel(this);
if ( shouldDownloadLevel )
{
return (LevelInfoLayer *)LevelInfoLayer::downloadLevel((LevelInfoLayer *)v2);
}
else
{
v4 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)shouldDownloadLevel);
if ( (unsigned __int8)GameLevelManager::isUpdateValid(
v4,
*(_DWORD *)(*(_QWORD *)(v2 + 504) + 328LL) - *(_DWORD *)(*(_QWORD *)(v2 + 504) + 332LL)) )
{
return (LevelInfoLayer *)LevelInfoLayer::showUpdateAlert(v2, 1);
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 496) + 344LL))(*(_QWORD *)(v2 + 496), 0);
v5 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v2 + 648) + 344LL))(
*(_QWORD *)(v2 + 648),
1);
v6 = (GameLevelManager *)GameLevelManager::sharedState(v5);
*((_QWORD *)v6 + 161) = v2 + 416;
v7 = (GameLevelManager *)GameLevelManager::sharedState(v6);
return (LevelInfoLayer *)GameLevelManager::updateLevel(v7, *(GJGameLevel **)(v2 + 504));
}
}
}
return this;
}