//
// InfoLayer::setupCommentsBrowser from 0x7e2fa4 to 0x7e3268 (708 bytes)
//
// 4 xrefs:
// > InfoLayer::loadCommentsFinished @ 0x7e32a4
// > InfoLayer::loadPage @ 0x7e35ac
// > InfoLayer::init @ 0x7e4590
// > ??> @ 0x31650
//
// 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 InfoLayer::setupCommentsBrowser(InfoLayer *a1, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
cocos2d::CCTouchDispatcher *v5; // x0
GJAccountManager *v6; // x0
int m_accountID; // w4
int m_unkInt1; // w6
int v9; // w2
cocos2d::ccArray *data; // x1
unsigned int num; // w0
cocos2d::CCDirector *v12; // x0
GameManager *v13; // x0
float v14; // s8
int v15; // w22
GameManager *v16; // x0
CustomListView *v17; // x0
GJCommentListLayer *v18; // x0
float v19; // s2
GJCommentListLayer *m_list; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCDirector *v22; // x0
GameManager *v23; // x0
cocos2d::CCObject **arr; // x1
cocos2d::CCObject **v25; // x5
cocos2d::CCObject *v26; // x3
int i; // w6
cocos2d::CCDirector *v28; // x0
GameManager *v29; // x0
float v30; // [xsp+58h] [xbp+58h]
float v31; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v32; // [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;
}
if ( !a1->m_levelList )
{
v22 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v22);
v23 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v23, "0089") )
goto LABEL_7;
v15 = 1;
v14 = 234.0;
if ( !a2 )
{
LABEL_16:
v17 = nullptr;
goto LABEL_11;
}
goto LABEL_10;
}
v6 = GJAccountManager::sharedState();
m_accountID = v6->m_accountID;
m_unkInt1 = v6->m_unkInt1;
v9 = a1->m_levelList->m_accountID;
if ( a2 )
{
data = a2->data;
num = data->num;
if ( data->num )
{
arr = data->arr;
v25 = &arr[num - 1];
if ( arr <= v25 )
{
v26 = *arr;
for ( i = m_accountID - m_unkInt1; *arr; v26 = *arr )
{
++arr;
BYTE1(v26[6].m_uOrderOfArrival) = v9 == i && v9 > 0;
if ( v25 < arr )
break;
}
}
}
v12 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v12);
v13 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v13, "0089") )
{
LABEL_7:
if ( a1->m_score )
{
v14 = 234.0;
v15 = 1;
}
else
{
v15 = 0;
v14 = 140.0;
}
if ( a2 )
goto LABEL_10;
goto LABEL_16;
}
v14 = 234.0;
v15 = 1;
LABEL_10:
v16 = GameManager::sharedState();
GameManager::getGameVariable(v16, "0088");
v17 = CustomListView::create(a2, (BoomListType)0, v14, 340.0);
goto LABEL_11;
}
v28 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v28);
v29 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v29, "0089") )
goto LABEL_7;
v14 = 234.0;
v15 = 1;
v17 = nullptr;
LABEL_11:
v18 = GJCommentListLayer::create(v17, "Comments", (cocos2d::ccColor4B)-12684609, 340.0, v14, 0);
a1->m_list = v18;
a1->m_mainLayer->addChild(a1->m_mainLayer, v18);
if ( v15 )
v19 = -4.0;
else
v19 = -53.0;
m_list = a1->m_list;
setPosition = m_list->setPosition;
cocos2d::CCPoint::CCPoint(&v32, (float)(v30 - 340.0) * 0.5, v19 + (float)((float)(v31 - v14) * 0.5));
setPosition(m_list, &v32);
}