//
// LevelBrowserLayer::setupLevelBrowser from 0x100485cc0 to 0x100485f33 (627 bytes)
//
// 8 xrefs:
// > LevelListLayer::init @ 0x100348bf1
// > LevelListLayer::onRefreshLevelList @ 0x100348ed4
// > LevelListLayer::cellPerformedAction @ 0x10034ada3
// > LevelListLayer::setIDPopupClosed @ 0x10034b0b1
// > sub_10034B110 @ 0x10034b15a
// > LevelBrowserLayer::loadPage @ 0x1004847ad
// > LevelBrowserLayer::loadLevelsFinished @ 0x10048686c
// > LevelBrowserLayer::onEnter @ 0x100488606
//
// This function is hookable on this platform (idp: pc, 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:30:42 +0000
//
__int64 __fastcall LevelBrowserLayer::setupLevelBrowser(__int64 a1, __int64 a2)
{
__int64 v2; // r14
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rax
int v6; // eax
float v7; // xmm0_4
_DWORD *v8; // rdx
int v9; // eax
unsigned int v10; // ecx
char *v11; // r14
_BOOL4 v12; // r15d
std::string::pointer data; // rsi
__int64 v14; // rax
__int64 v15; // r14
unsigned int v17; // r15d
__int64 v18; // rax
__int64 v19; // [rsp+0h] [rbp-40h] BYREF
std::string v20; // [rsp+8h] [rbp-38h] BYREF
float v21; // [rsp+24h] [rbp-1Ch]
v2 = a2;
if ( *(_QWORD *)(a1 + 608) )
{
v3 = cocos2d::CCDirector::sharedDirector();
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 160LL))(v3);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, *(_QWORD *)(a1 + 608));
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 608) + 536LL))(*(_QWORD *)(a1 + 608));
*(_QWORD *)(a1 + 608) = 0;
}
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v19, v5);
v6 = *(_DWORD *)(a1 + 768);
if ( v6 > 0 )
v7 = (float)v6;
else
v7 = 220.0;
v21 = v7;
v8 = *(_DWORD **)(a1 + 664);
v9 = v8[79];
if ( v8[108] == 1 )
{
v10 = 25;
if ( v9 == 102 )
LABEL_8:
v10 = *(unsigned __int8 *)(a1 + 748) + 27;
}
else
{
v10 = 4;
switch ( v9 )
{
case 9:
v10 = 13;
break;
case 10:
case 11:
case 12:
case 13:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
break;
case 14:
v10 = 12;
break;
case 25:
v2 = (*(__int64 (__fastcall **)(__int64, __int64, _DWORD *, __int64))(*(_QWORD *)a1 + 1368LL))(a1, a2, v8, 4);
v10 = 26;
break;
case 26:
v17 = v8[105];
v18 = (*(__int64 (__fastcall **)(__int64, __int64, _DWORD *, __int64))(*(_QWORD *)a1 + 1368LL))(a1, a2, v8, 4);
v10 = v17;
v2 = v18;
break;
default:
switch ( v9 )
{
case 'b':
v10 = 5;
break;
case 'e':
v10 = 20;
break;
case 'f':
goto LABEL_8;
case 'g':
v10 = 25;
break;
default:
goto LABEL_9;
}
break;
}
}
LABEL_9:
if ( v2 )
v11 = CustomListView::create(v2, a1 + 576, 0, v10, v21, 356.0, *(float *)(a1 + 776));
else
v11 = nullptr;
v12 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(a1 + 664) + 316LL) - 25) < 2;
LevelBrowserLayer::getSearchTitle(&v20);
if ( (*(_BYTE *)&v20.__r_.__value_.__s.0 & 1) != 0 )
data = v20.__r_.__value_.__l.__data_;
else
data = v20.__r_.__value_.__s.__data_;
v14 = GJListLayer::create(v11, data, 4282282687LL, v12, 356.0, v21);
*(_QWORD *)(a1 + 608) = v14;
if ( (*(_BYTE *)&v20.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v20.__r_.__value_.__l.__data_);
v14 = *(_QWORD *)(a1 + 608);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v14);
v15 = *(_QWORD *)(a1 + 608);
sub_100278250(
(float *)&v20,
(float)(*(float *)&v19 + -356.0) * 0.5,
(float)((float)((float)((float)(*((float *)&v19 + 1) - v21) * 0.5) + -10.0) + 5.0) + *(float *)(a1 + 772));
return (*(__int64 (__fastcall **)(__int64, std::string *))(*(_QWORD *)v15 + 184LL))(v15, &v20);
}