//
// LevelLeaderboard::setupLeaderboard from 0x614954 to 0x614aa2 (334 bytes)
//
// 4 xrefs:
// > LevelLeaderboard::onUpdate @ 0x614b20
// > LevelLeaderboard::loadLeaderboardFinished @ 0x614f28
// > LevelLeaderboard::loadScores @ 0x615130
// > LevelLeaderboard::init @ 0x615c78
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:54 +0000
//
int __fastcall LevelLeaderboard::setupLeaderboard(LevelLeaderboard *this, cocos2d::CCArray *a2)
{
LevelLeaderboard *v2; // r4
int v4; // r0
cocos2d::CCTouchDispatcher *v5; // r0
GJGameLevel *v6; // r0
_DWORD *v7; // r2
int v8; // r3
int *v9; // r2
int *v10; // r3
int v11; // r3
cocos2d::CCLayer *v12; // r0
cocos2d::CCLayerColor *v13; // r0
int v14; // r5
int (__fastcall *v15)(int, _BYTE *); // r7
int v17; // r1
int v18; // t1
float v19[2]; // [sp+14h] [bp-18h] BYREF
_BYTE v20[8]; // [sp+1Ch] [bp-10h] BYREF
v2 = this;
if ( *((_DWORD *)this + 136) )
{
v4 = cocos2d::CCDirector::sharedDirector(this);
v5 = (cocos2d::CCTouchDispatcher *)(*(int (__fastcall **)(int))(*(_DWORD *)v4 + 80))(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, *((cocos2d::CCObject **)v2 + 136));
this = (LevelLeaderboard *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 136) + 268))(*((_DWORD *)v2 + 136));
*((_DWORD *)v2 + 136) = 0;
}
cocos2d::CCDirector::sharedDirector(this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v19);
if ( a2 )
{
v6 = *((GJGameLevel **)v2 + 132);
if ( v6 )
{
if ( GJGameLevel::isPlatformer(v6) && *((_DWORD *)v2 + 133) != 3 )
{
v7 = *((_DWORD **)a2 + 13);
if ( *v7 )
{
v8 = *v7 + 0x40000000;
v9 = (int *)v7[3];
v10 = &v9[v8 - 1];
while ( v9 <= v10 )
{
v18 = *v9++;
v17 = v18;
if ( !v18 )
break;
*(_DWORD *)(v17 + 620) = 1;
*(_DWORD *)(v17 + 624) = *((_DWORD *)v2 + 134);
}
}
}
}
if ( *((_DWORD *)v2 + 133) == 3 )
v11 = 31;
else
v11 = 18;
v12 = CustomListView::create(a2, 0, 1130102784, 1135214592, 0, v11, 0);
}
else
{
v12 = nullptr;
}
v13 = GJCommentListLayer::create((int)v12, (int)"Scores", -12684609, 340.0, 220.0, 1);
*((_DWORD *)v2 + 136) = v13;
(*(void (__fastcall **)(_DWORD, cocos2d::CCLayerColor *))(**((_DWORD **)v2 + 115) + 228))(*((_DWORD *)v2 + 115), v13);
v14 = *((_DWORD *)v2 + 136);
v15 = *(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v14 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v20,
(float)(v19[0] - 340.0) * 0.5,
(float)((float)(v19[1] - 220.0) * 0.5) - 10.0);
return v15(v14, v20);
}