//
// FriendsProfilePage::setupUsersBrowser from 0x1001d9590 to 0x1001d97e0 (592 bytes)
//
// 3 xrefs:
// > FriendsProfilePage::init @ 0x1001d93b4
// > FriendsProfilePage::getUserListFinished @ 0x1001d982c
// > FriendsProfilePage::forceReloadList @ 0x1001d9a04
//
// 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 FriendsProfilePage::setupUsersBrowser(FriendsProfilePage *a1, cocos2d::CCArray *a2, UserListType a3)
{
cocos2d::CCDirector *v6; // x0
cocos2d::CCTouchDispatcher *v7; // x0
cocos2d::CCDirector *v8; // x0
BoomListType v9; // w3
CustomListView *v10; // x0
GJCommentListLayer *v11; // x0
__n128 v12; // q0
GJCommentListLayer *m_listLayer; // x22
__n128 v14; // q1
int v15; // w0
cocos2d::CCLabelBMFont *m_totalFriends; // x20
int v17; // w0
cocos2d::CCString *v18; // x0
const char *CString; // x1
GameManager *v20; // x0
int v21; // w0
unsigned int v22; // w19
GameManager *v23; // x0
GameManager *v24; // x0
GameManager *v25; // x0
_DWORD v26[4]; // [xsp+10h] [xbp-30h] BYREF
if ( a1->m_listLayer )
{
v6 = cocos2d::CCDirector::sharedDirector();
v7 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v6->getTouchDispatcher)(v6);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v7, a1->m_listLayer);
((void (__fastcall *)(GJCommentListLayer *))a1->m_listLayer->removeMeAndCleanup)(a1->m_listLayer);
a1->m_listLayer = nullptr;
}
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
if ( a2 )
{
if ( a3 )
v9 = User2;
else
v9 = User;
v10 = CustomListView::create(a2, nullptr, 196.0, 340.0, 0, v9, 0.0);
}
else
{
v10 = nullptr;
}
v11 = GJCommentListLayer::create(v10, nullptr, (cocos2d::ccColor4B)-12684609, 340.0, 196.0, 0);
a1->m_listLayer = v11;
v12 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, GJCommentListLayer *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v11);
v12.n128_f32[0] = (float)(*(float *)&v26[2] + -340.0) * 0.5;
m_listLayer = a1->m_listLayer;
v14.n128_f32[0] = (float)((float)((float)(*(float *)&v26[3] + -196.0) * 0.5) + -10.0) + 5.0;
sub_100022980(v12, v14, v26);
((void (__fastcall *)(GJCommentListLayer *, _DWORD *))m_listLayer->setPosition)(m_listLayer, v26);
if ( !a2 || a3 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_totalFriends->setString)(
a1->m_totalFriends,
" ");
}
else
{
v15 = sub_10024A36C(a2);
m_totalFriends = a1->m_totalFriends;
if ( v15 )
{
v17 = sub_10024A36C(a2);
v18 = (cocos2d::CCString *)sub_100268F4C("Total friends: %i", v17);
CString = cocos2d::CCString::getCString(v18);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_totalFriends->setString)(m_totalFriends, CString);
}
else
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_totalFriends->setString)(m_totalFriends, " ");
}
if ( (unsigned int)sub_10024A36C(a2) )
{
v20 = GameManager::sharedState();
GameManager::reportAchievementWithID(v20, "geometry.ach.friends01", 100, 0);
v21 = sub_10024A36C(a2);
if ( v21 >= 10 )
{
v22 = v21;
v23 = GameManager::sharedState();
GameManager::reportAchievementWithID(v23, "geometry.ach.friends02", 100, 0);
if ( v22 >= 0x19 )
{
v24 = GameManager::sharedState();
GameManager::reportAchievementWithID(v24, "geometry.ach.friends03", 100, 0);
if ( v22 >= 0x32 )
{
v25 = GameManager::sharedState();
GameManager::reportAchievementWithID(v25, "geometry.ach.friends04", 100, 0);
}
}
}
}
}
}