//
// LeaderboardsLayer::setupLevelBrowser from 0x1003b1894 to 0x1003b19cc (312 bytes)
//
// 3 xrefs:
// > LeaderboardsLayer::selectLeaderboard @ 0x1003b1714
// > LeaderboardsLayer::selectLeaderboard @ 0x1003b1740
// > LeaderboardsLayer::loadLeaderboardFinished @ 0x1003b1e0c
//
// 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 LeaderboardsLayer::setupLevelBrowser(LeaderboardsLayer *a1, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
cocos2d::CCTouchDispatcher *v5; // x0
cocos2d::CCDirector *v6; // x0
CustomListView *v7; // x0
GJListLayer *v8; // x0
__n128 v9; // q0
GJListLayer *m_list; // x20
__n128 v11; // q1
_DWORD v12[4]; // [xsp+0h] [xbp-20h] BYREF
if ( a1->m_list )
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v4->getTouchDispatcher)(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1->m_list);
((void (__fastcall *)(GJListLayer *))a1->m_list->removeMeAndCleanup)(a1->m_list);
a1->m_list = nullptr;
}
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
if ( a2 )
v7 = CustomListView::create(a2, nullptr, 220.0, 356.0, 0, Score, 0.0);
else
v7 = nullptr;
v8 = GJListLayer::create(v7, nullptr, (cocos2d::ccColor4B)-12684609, 356.0, 220.0, 0);
a1->m_list = v8;
v9 = ((__n128 (__fastcall *)(LeaderboardsLayer *, GJListLayer *))a1->addChild)(a1, v8);
v9.n128_f32[0] = (float)(*(float *)&v12[2] + -356.0) * 0.5;
m_list = a1->m_list;
v11.n128_f32[0] = (float)((float)((float)(*(float *)&v12[3] + -220.0) * 0.5) + -10.0) + 5.0;
sub_100022980(v9, v11, v12);
((void (__fastcall *)(GJListLayer *, _DWORD *))m_list->setPosition)(m_list, v12);
LeaderboardsLayer::refreshTabs(a1);
}