//
// InfoLayer::setupCommentsBrowser from 0x1402be8c0 to 0x1402beb4d (653 bytes)
//
// 4 xrefs:
// > InfoLayer::init @ 0x1402bc739
// > InfoLayer::loadPage @ 0x1402be6f3
// > InfoLayer::loadCommentsFinished @ 0x1402beb82
// > ??> @ 0x1406d287c
//
// 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
//
// Hidden C++ exception states: #wind=2
void InfoLayer::setupCommentsBrowser(InfoLayer *m_levelList, cocos2d::CCArray *a2)
{
float v2; // xmm0_4
InfoLayer *v4; // rdi
CustomListView *v5; // rbp
__int64 v6; // rax
cocos2d::CCTouchDispatcher *v7; // rax
GJAccountManager *v8; // rax
int v9; // r8d
bool v10; // dl
__int64 v11; // rax
InfoLayer *i; // r8
cocos2d::CCDirector *v13; // rax
GameManager *v14; // rcx
bool v15; // si
int v16; // eax
__int64 v17; // rdx
float v18; // xmm6_4
GameManager *v19; // rcx
bool GameVariable; // al
GJCommentListLayer *v21; // rax
GJCommentListLayer_vtbl *v22; // rbx
const cocos2d::CCPoint *v23; // rax
int v24; // [rsp+20h] [rbp-48h]
void *v25; // [rsp+70h] [rbp+8h]
void *v26; // [rsp+70h] [rbp+8h]
float v27; // [rsp+78h] [rbp+10h]
v4 = m_levelList;
v5 = nullptr;
if ( m_levelList->m_list )
{
v6 = cocos2d::CCDirector::sharedDirector(m_levelList);
v7 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 144LL))(v6);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v7, v4->m_list);
v4->m_list->removeMeAndCleanup(v4->m_list);
v4->m_list = nullptr;
}
if ( v4->m_levelList )
{
v8 = GJAccountManager::sharedState();
m_levelList = (InfoLayer *)v4->m_levelList;
v9 = *(_DWORD *)&m_levelList->m_bMouseEnabled;
v10 = v8->m_accountID - v8->m_unkInt1 == v9 && v9 > 0;
if ( a2 )
{
m_levelList = (InfoLayer *)a2->data;
v11 = LODWORD(m_levelList->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
if ( (_DWORD)v11 )
{
m_levelList = *(InfoLayer **)&m_levelList->m_nTag;
for ( i = (InfoLayer *)((char *)m_levelList + 8 * v11 - 8);
m_levelList <= i;
m_levelList = (InfoLayer *)((char *)m_levelList + 8) )
{
if ( !m_levelList->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable )
break;
BYTE1(m_levelList->getChildByTag) = v10;
}
}
}
}
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(m_levelList);
cocos2d::CCDirector::getWinSize(v13);
v14 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v25 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v25);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v14 = (GameManager *)qword_1406C2ED8;
}
v15 = GameManager::getGameVariable(v14, "0089") || v4->m_score;
v16 = 140;
v17 = 234;
if ( v15 )
v16 = 234;
v18 = (float)v16;
if ( a2 )
{
v19 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v26 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v26);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v19 = (GameManager *)qword_1406C2ED8;
}
GameVariable = GameManager::getGameVariable(v19, "0088");
v2 = 0.0;
v5 = CustomListView::create(a2, nullptr, v18, 340.0, v24, (BoomListType)(GameVariable + 7), 0.0);
}
v21 = GJCommentListLayer::create(v5, (const char *)v17, (cocos2d::ccColor4B)-12684609, 340.0, v18, 0);
v4->m_list = v21;
v4->m_mainLayer->addChild_1(v4->m_mainLayer, v21);
v22 = v4->m_list->__vftable;
cocos2d::CCPoint::CCPoint(v2, (float)(v27 - 340.0) * 0.5);
v22->setPosition_0(v4->m_list, v23);
}