//
// LeaderboardsLayer::toggleTabButtons from 0x452004 to 0x4521d8 (468 bytes)
//
// 1 xrefs:
// > LeaderboardsLayer::selectLeaderboard @ 0x452228
//
// 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 LeaderboardsLayer::toggleTabButtons(LeaderboardsLayer *a1)
{
cocos2d::CCNode *v2; // r5
int v3; // r0
int v4; // r2
cocos2d::CCNode *v5; // r5
int v6; // r0
int v7; // r2
cocos2d::CCNode *v8; // r5
int v9; // r0
int v10; // r2
cocos2d::CCNode *v11; // r5
int v12; // r0
int v13; // r2
cocos2d::CCArray *m_modeButtons; // r3
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r6
cocos2d::CCObject **v17; // r7
int v18; // r5
int v19; // t1
ButtonSprite *v20; // r10
const char *v21; // r1
CCMenuItemToggler::toggle(a1->m_topBtn, a1->m_type == Top100);
CCMenuItemToggler::toggle(a1->m_friendsBtn, a1->m_type == Friends);
CCMenuItemToggler::toggle(a1->m_globalBtn, a1->m_type == Global);
CCMenuItemToggler::toggle(a1->m_creatorsBtn, a1->m_type == Creator);
a1->m_topBtn->setEnabled(a1->m_topBtn, a1->m_type != Top100);
a1->m_friendsBtn->setEnabled(a1->m_friendsBtn, a1->m_type != Friends);
a1->m_globalBtn->setEnabled(a1->m_globalBtn, a1->m_type != Global);
a1->m_creatorsBtn->setEnabled(a1->m_creatorsBtn, a1->m_type != Creator);
v2 = a1->m_topBtn->getParent(a1->m_topBtn);
v3 = (int)v2->getParent(v2);
if ( a1->m_type == Top100 )
v4 = 2;
else
v4 = -1;
(*(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v3 + 288))(v3, v2, v4);
v5 = a1->m_friendsBtn->getParent(a1->m_friendsBtn);
v6 = (int)v5->getParent(v5);
if ( a1->m_type == Friends )
v7 = 2;
else
v7 = -1;
(*(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v6 + 288))(v6, v5, v7);
v8 = a1->m_globalBtn->getParent(a1->m_globalBtn);
v9 = (int)v8->getParent(v8);
if ( a1->m_type == Global )
v10 = 2;
else
v10 = -1;
(*(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v9 + 288))(v9, v8, v10);
v11 = a1->m_creatorsBtn->getParent(a1->m_creatorsBtn);
v12 = (int)v11->getParent(v11);
if ( a1->m_type == Creator )
v13 = 2;
else
v13 = -1;
(*(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v12 + 288))(v12, v11, v13);
LeaderboardsLayer::refreshTabs(a1);
m_modeButtons = a1->m_modeButtons;
if ( m_modeButtons )
{
data = m_modeButtons->data;
if ( data->num )
{
arr = data->arr;
v17 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v17 )
{
v19 = (int)*arr++;
v18 = v19;
if ( !v19 )
break;
v20 = (ButtonSprite *)(*(int (__fastcall **)(int))(*(_DWORD *)v18 + 528))(v18);
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v18 + 32))(v18) == a1->m_stat )
v21 = "GJ_button_02.png";
else
v21 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v20, v21);
(*(void (__fastcall **)(int, bool))(*(_DWORD *)v18 + 164))(v18, a1->m_type != Creator);
}
}
}
}