//
// LevelBrowserLayer::setIDPopupClosed from 0x3bd7a0 to 0x3bd850 (176 bytes)
//
// 2 xrefs:
// > `non-virtual thunk to'LevelBrowserLayer::setIDPopupClosed @ 0x3bd85c
// > LevelListLayer::setIDPopupClosed @ 0x591c76
//
// 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 LevelBrowserLayer::setIDPopupClosed(LevelBrowserLayer *a1, SetIDPopup *a2, int a3)
{
int v5; // r0
GJSearchObject *m_searchObject; // r3
GameManager *v7; // r0
GJSearchObject *v8; // r1
GJSearchObject *v9; // r3
GameManager *v10; // r0
const char *v11; // r1
int m_lastPage; // r2
int v13; // r4
GJSearchObject *PageObject; // r1
v5 = a2->getTag(a2);
m_searchObject = a1->m_searchObject;
if ( v5 == 4 )
{
if ( a3 < 0 )
{
a3 = 0;
}
else if ( a3 >= 999 )
{
a3 = 999;
}
if ( m_searchObject )
{
v7 = GameManager::sharedState();
v8 = a1->m_searchObject;
v7->m_currentLevelID = 0;
v8->m_page = 0;
v8->m_folder = a3;
LevelBrowserLayer::loadPage(a1, v8);
v9 = a1->m_searchObject;
if ( v9 && v9->m_searchType == SavedLevels )
{
v10 = GameManager::sharedState();
v11 = "0092";
}
else
{
v10 = GameManager::sharedState();
v11 = "0091";
}
GameManager::setIntGameVariable(v10, v11, a3);
}
}
else
{
m_lastPage = a1->m_lastPage;
v13 = a3 - 1;
if ( m_lastPage > 0 && v13 >= m_lastPage )
v13 = a1->m_lastPage;
if ( m_searchObject && m_searchObject->m_page != v13 )
{
GameManager::sharedState()->m_currentLevelID = 0;
PageObject = GJSearchObject::getPageObject(a1->m_searchObject, v13);
LevelBrowserLayer::loadPage(a1, PageObject);
}
}
}