//
// InfoLayer::setupCommentsBrowser from 0x1003521f4 to 0x1003523c8 (468 bytes)
//
// 3 xrefs:
// > InfoLayer::init @ 0x100351020
// > InfoLayer::loadPage @ 0x10035210c
// > InfoLayer::loadCommentsFinished @ 0x100352be8
//
// 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 __fastcall InfoLayer::setupCommentsBrowser(InfoLayer *a1, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
cocos2d::CCTouchDispatcher *v5; // x0
GJAccountManager *v6; // x0
int m_accountID; // w9
bool v8; // cc
bool v9; // w8
cocos2d::ccArray *data; // x9
__int64 num; // x10
cocos2d::CCObject **arr; // x9
unsigned __int64 v13; // x10
cocos2d::CCDirector *v14; // x0
GameManager *v15; // x0
float v16; // s9
float v17; // s8
GameManager *v18; // x0
BoomListType v19; // w3
CustomListView *v20; // x0
GJCommentListLayer *v21; // x0
__n128 v22; // q0
GJCommentListLayer *m_list; // x19
__n128 v24; // q1
_DWORD v25[4]; // [xsp+0h] [xbp-30h] BYREF
if ( a1->m_list )
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v4->getTouchDispatcher)(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1->m_list);
((void (__fastcall *)(GJCommentListLayer *))a1->m_list->removeMeAndCleanup)(a1->m_list);
a1->m_list = nullptr;
}
if ( a1->m_levelList )
{
v6 = GJAccountManager::sharedState();
m_accountID = a1->m_levelList->m_accountID;
v8 = v6->m_accountID - v6->m_unkInt1 != m_accountID || m_accountID <= 0;
v9 = !v8;
if ( a2 )
{
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v13 = (unsigned __int64)&arr[num - 1];
do
{
if ( !*arr )
break;
BYTE1((*arr++)[7].m_unknown2) = v9;
}
while ( (unsigned __int64)arr <= v13 );
}
}
}
v14 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v14);
v15 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v15, "0089") && !a1->m_score )
{
v17 = 140.0;
v16 = -53.0;
if ( a2 )
goto LABEL_18;
LABEL_23:
v20 = nullptr;
goto LABEL_24;
}
v16 = -4.0;
v17 = 234.0;
if ( !a2 )
goto LABEL_23;
LABEL_18:
v18 = GameManager::sharedState();
if ( GameManager::getGameVariable(v18, "0088") )
v19 = Comment2;
else
v19 = Comment;
v20 = CustomListView::create(a2, nullptr, v17, 340.0, 0, v19, 0.0);
LABEL_24:
v21 = GJCommentListLayer::create(v20, "Comments", (cocos2d::ccColor4B)-12684609, 340.0, v17, 0);
a1->m_list = v21;
v22 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, GJCommentListLayer *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v21);
v22.n128_f32[0] = (float)(*(float *)&v25[2] + -340.0) * 0.5;
m_list = a1->m_list;
v24.n128_f32[0] = v16 + (float)((float)(*(float *)&v25[3] - v17) * 0.5);
sub_100022980(v22, v24, v25);
((void (__fastcall *)(GJCommentListLayer *, _DWORD *))m_list->setPosition)(m_list, v25);
}