//
// LevelBrowserLayer::setIDPopupClosed from 0x7fb86c to 0x7fb9a8 (316 bytes)
//
// 4 xrefs:
// > `non-virtual thunk to'LevelBrowserLayer::setIDPopupClosed @ 0x7fb9ac
// > LevelListLayer::setIDPopupClosed @ 0xba97bc
// > ??> @ 0x54790
// > ??> @ 0x143e8e0
//
// 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:41 +0000
//
__int64 __fastcall LevelBrowserLayer::setIDPopupClosed(LevelBrowserLayer *this, SetIDPopup *a2, int a3)
{
int v5; // w1
int v6; // w19
__int64 result; // x0
GameManager *v8; // x0
GJSearchObject *PageObject; // x0
GameManager *v10; // x0
GameManager *v11; // x0
GameManager *v12; // x0
unsigned int v13; // w2
char *v14; // x1
int v15; // [xsp+28h] [xbp+28h]
if ( (*(unsigned int (__fastcall **)(SetIDPopup *))(*(_QWORD *)a2 + 64LL))(a2) == 4 )
{
if ( a3 < 0 )
{
a3 = 0;
}
else if ( a3 >= 1000 )
{
a3 = 999;
}
result = *((_QWORD *)this + 83);
if ( result )
{
v10 = (GameManager *)GameManager::sharedState((GameManager *)result);
*((_DWORD *)v10 + 241) = 0;
*(_DWORD *)(GameManager::sharedState(v10) + 968) = 0;
*(_DWORD *)(*((_QWORD *)this + 83) + 420LL) = a3;
*(_DWORD *)(*((_QWORD *)this + 83) + 392LL) = 0;
LevelBrowserLayer::loadPage((GJSearchObject **)this, *((GJSearchObject **)this + 83));
v11 = *((GameManager **)this + 83);
if ( v11 && (v11 = (GameManager *)*((unsigned int *)v11 + 79), (_DWORD)v11 == 99) )
{
v12 = (GameManager *)GameManager::sharedState(v11);
v13 = a3;
v14 = "0092";
}
else
{
v12 = (GameManager *)GameManager::sharedState(v11);
v13 = a3;
v14 = "0091";
}
return GameManager::setIntGameVariable(v12, v14, v13);
}
}
else
{
v5 = *((_DWORD *)this + 186);
v6 = a3 - 1;
if ( v6 < v5 || v5 <= 0 )
{
result = *((_QWORD *)this + 83);
v5 = v6;
if ( !result )
return result;
}
else
{
result = *((_QWORD *)this + 83);
if ( !result )
return result;
}
result = *(unsigned int *)(result + 392);
if ( v5 != (_DWORD)result )
{
v15 = v5;
v8 = (GameManager *)GameManager::sharedState((GameManager *)result);
*((_DWORD *)v8 + 241) = 0;
*(_DWORD *)(GameManager::sharedState(v8) + 968) = 0;
PageObject = (GJSearchObject *)GJSearchObject::getPageObject(*((GJSearchObject **)this + 83), v15);
return LevelBrowserLayer::loadPage((GJSearchObject **)this, PageObject);
}
}
return result;
}