//
// LevelLeaderboard::setupLeaderboard from 0x931fe0 to 0x9321e4 (516 bytes)
//
// 5 xrefs:
// > LevelLeaderboard::onUpdate @ 0x9322a0
// > LevelLeaderboard::loadLeaderboardFinished @ 0x932310
// > LevelLeaderboard::loadScores @ 0x9324f4
// > LevelLeaderboard::init @ 0x9330a4
// > ??> @ 0xb9088
//
// 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 LevelLeaderboard::setupLeaderboard(LevelLeaderboard *a1, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
cocos2d::CCTouchDispatcher *v5; // x0
cocos2d::CCDirector *v6; // x0
GJGameLevel *m_level; // x0
CustomListView *v8; // x0
GJCommentListLayer *v9; // x0
cocos2d::CCLayer *m_mainLayer; // x2
GJCommentListLayer *m_list; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::ccArray *data; // x0
unsigned int num; // w1
cocos2d::CCObject **arr; // x0
cocos2d::CCObject **v16; // x2
cocos2d::CCObject *v17; // x1
LevelLeaderboardMode m_mode; // w4
float v19; // [xsp+58h] [xbp+58h]
float v20; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v21; // [xsp+60h] [xbp+60h] BYREF
if ( a1->m_list )
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = v4->getTouchDispatcher(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1->m_list);
a1->m_list->removeMeAndCleanup(a1->m_list);
a1->m_list = nullptr;
}
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
if ( a2 )
{
m_level = a1->m_level;
if ( m_level )
{
if ( GJGameLevel::isPlatformer(m_level) && a1->m_type != Local )
{
data = a2->data;
num = data->num;
if ( data->num )
{
arr = data->arr;
v16 = &arr[num - 1];
if ( arr <= v16 )
{
v17 = *arr;
if ( *arr )
{
m_mode = a1->m_mode;
do
{
++arr;
v17[10].m_uIndexInArray = 1;
v17[10].m_uUnknown = m_mode;
if ( v16 < arr )
break;
v17 = *arr;
}
while ( *arr );
}
}
}
}
}
v8 = CustomListView::create(a2, (BoomListType)0, 220.0, 340.0);
}
else
{
v8 = nullptr;
}
v9 = GJCommentListLayer::create(v8, "Scores", (cocos2d::ccColor4B)-12684609, 340.0, 220.0, 1);
m_mainLayer = a1->m_mainLayer;
a1->m_list = v9;
m_mainLayer->addChild(m_mainLayer, v9);
m_list = a1->m_list;
setPosition = m_list->setPosition;
cocos2d::CCPoint::CCPoint(&v21, (float)(v19 - 340.0) * 0.5, (float)((float)(v20 - 220.0) * 0.5) + -10.0);
setPosition(m_list, &v21);
}