//
// FriendsProfilePage::init from 0x14013fda0 to 0x1401404a5 (1797 bytes)
//
// 2 xrefs:
// > FriendsProfilePage::create @ 0x14013fd56
// > ??> @ 0x1406ca29c
//
// 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=3
bool FriendsProfilePage::init(FriendsProfilePage *a1, UserListType a2)
{
bool result; // al
__int64 v5; // rcx
cocos2d::CCDirector *v6; // rax
struct cocos2d::CCRect *v7; // rax
struct cocos2d::extension::CCScale9Sprite *v8; // rdi
__int64 v9; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v10; // rbx
const cocos2d::CCSize *v11; // rax
cocos2d::extension::CCScale9Sprite_vtbl *v12; // rbx
const cocos2d::CCPoint *v13; // rax
int v14; // eax
float v15; // xmm6_4
const char *v16; // rcx
struct cocos2d::CCLabelBMFont *v17; // r14
cocos2d::CCLabelBMFont_vtbl *v18; // rbx
const cocos2d::CCPoint *v19; // rax
struct cocos2d::CCLabelBMFont *v20; // rdi
__int64 v21; // rax
cocos2d::CCLabelBMFont *v22; // rax
cocos2d::CCLabelBMFont_vtbl *v23; // rbx
const cocos2d::CCPoint *v24; // rax
struct cocos2d::CCSprite *v25; // rax
CCMenuItemSpriteExtra *v26; // rax
cocos2d::CCMenu *v27; // rax
cocos2d::CCMenu_vtbl *v28; // rbx
const cocos2d::CCPoint *v29; // rax
struct cocos2d::CCSprite *v30; // rax
CCMenuItemSpriteExtra *v31; // rdi
CCMenuItemSpriteExtra_vtbl *v32; // rbx
struct cocos2d::CCPoint v33; // rax
cocos2d::CCLabelBMFont *v34; // rax
cocos2d::CCLabelBMFont_vtbl *v35; // rbx
const cocos2d::CCPoint *v36; // rax
LoadingCircle *v37; // rax
cocos2d::CCSprite *m_sprite; // rbx
cocos2d::CCSprite_vtbl *v39; // rdi
const cocos2d::CCPoint *v40; // rax
struct cocos2d::CCSprite *v41; // rax
CCMenuItemSpriteExtra *v42; // rax
CCMenuItemSpriteExtra_vtbl *v43; // rbx
struct cocos2d::CCPoint v44; // rax
UserListDelegate *v45; // rbx
GameLevelManager *v46; // rcx
cocos2d::CCArray *StoredUserList; // rax
_BOOL8 v48; // rdx
GameLevelManager *v49; // rcx
cocos2d::CCRect v50; // [rsp+30h] [rbp-40h] BYREF
float v51; // [rsp+A0h] [rbp+30h]
float v52; // [rsp+A4h] [rbp+34h]
cocos2d::CCPoint v53; // [rsp+A8h] [rbp+38h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
a1->m_type = a2;
a1->m_noElasticity = 1;
v6 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6);
cocos2d::CCRect::CCRect(&v50, 0.0, 0.0, 80.0, 80.0);
v8 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v7);
LOBYTE(v9) = -1;
v8->setOpacity(&v8->cocos2d::CCRGBAProtocol, v9);
v10 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v53, 440.0, 290.0);
v10->setContentSize(v8, v11);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, -1);
v12 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v53, v51 * 0.5, v52 * 0.5);
v12->setPosition_0(v8, v13);
v14 = -17;
if ( a1->m_type == Blocked )
v14 = -20;
v15 = (float)v14;
v16 = "Blocked";
if ( a1->m_type != Blocked )
v16 = "Friends";
v17 = cocos2d::CCLabelBMFont::create(v16, (const char *)&qword_14052A4D8);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v17, 20);
v18 = v17->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v53, v51 * 0.5, (float)((float)(v52 * 0.5) + 145.0) + v15);
v18->setPosition_0(v17, v19);
cocos2d::CCLabelBMFont::limitLabelWidth(v17, 185.0, 0.80000001, 0.0);
if ( a1->m_type != Blocked )
{
v20 = cocos2d::CCLabelBMFont::create("Tap on a user to view their profile", "chatFont.fnt");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v20, 10);
cocos2d::CCPoint::CCPoint(&v50.origin, 0.0, -21.0);
v21 = (__int64)v17->getPosition_0(v17);
cocos2d::CCPoint::operator+(v21, &v53);
v20->setPosition_0(v20, &v53);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v20->setScale_0)(v20);
}
v22 = cocos2d::CCLabelBMFont::create(" ", "goldFont.fnt");
a1->m_totalFriends = v22;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v22, 10);
v23 = a1->m_totalFriends->__vftable;
cocos2d::CCPoint::CCPoint(&v53, v51 * 0.5, (float)((float)(v52 * 0.5) - 145.0) + 25.0);
v23->setPosition_0(a1->m_totalFriends, v24);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_totalFriends->setScale_0)(a1->m_totalFriends);
v25 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_backBtn_001.png");
v26 = CCMenuItemSpriteExtra::create(v25, nullptr, a1, (cocos2d::SEL_MenuHandler *)FriendsProfilePage::onClose);
HIDWORD(v26->m_pfnSelector.adj) = 1070386381;
v27 = cocos2d::CCMenu::create(v26, 0);
a1->m_buttonMenu = v27;
v28 = v27->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(
&v53,
(float)((float)(v51 * 0.5) - 220.0) + 10.0,
(float)((float)(v52 * 0.5) + 145.0) - 10.0);
v28->setPosition_0(a1->m_buttonMenu, v29);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
if ( !a1->m_type )
{
v30 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_blocked_001.png");
v31 = CCMenuItemSpriteExtra::create(v30, nullptr, a1, (cocos2d::SEL_MenuHandler *)FriendsProfilePage::onBlocked);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v31);
v32 = v31->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(
&v53,
(float)((float)(v51 * 0.5) + 220.0) - 10.0,
(float)((float)(v52 * 0.5) + 145.0) - 10.0);
v33 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v50.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v32->setPosition_0)(v31, v33);
}
v34 = cocos2d::CCLabelBMFont::create("Something went wrong...", "goldFont.fnt");
a1->m_noInternet = v34;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v34, 10);
v35 = a1->m_noInternet->__vftable;
cocos2d::CCPoint::CCPoint(&v53, v51 * 0.5, v52 * 0.5);
v35->setPosition_0(a1->m_noInternet, v36);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_noInternet->setScale_0)(a1->m_noInternet);
a1->m_noInternet->setVisible(a1->m_noInternet, 0);
v37 = LoadingCircle::create();
a1->m_circle = v37;
v37->m_parentLayer = a1->m_mainLayer;
a1->m_circle->m_fade = 0;
cocos2d::CCObject::retain(a1->m_circle);
LoadingCircle::show(a1->m_circle);
a1->m_circle->setVisible(a1->m_circle, 0);
m_sprite = a1->m_circle->m_sprite;
v39 = m_sprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v53, v51 * 0.5, v52 * 0.5);
v39->setPosition_0(m_sprite, v40);
v41 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v42 = CCMenuItemSpriteExtra::create(v41, nullptr, a1, (cocos2d::SEL_MenuHandler *)FriendsProfilePage::onUpdate);
a1->m_refreshBtn = v42;
HIDWORD(v42->m_pfnSelector.adj) = 1069547520;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, a1->m_refreshBtn);
v43 = a1->m_refreshBtn->__vftable;
cocos2d::CCPoint::CCPoint(
&v53,
(float)((float)(v51 * 0.5) + 220.0) - 10.0,
(float)((float)((float)(v52 * 0.5) - 145.0) + 10.0) + 1.0);
v44 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v50.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v43->setPosition_0)(a1->m_refreshBtn, v44);
a1->m_refreshBtn->setVisible(a1->m_refreshBtn, 0);
v45 = &a1->UserListDelegate;
v46 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v53 = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = ((__int64 (__fastcall *)(_QWORD))sub_140141280)(v53);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v46 = (GameLevelManager *)qword_1406C2EC0;
}
v46->m_userListDelegate = v45;
StoredUserList = GameLevelManager::getStoredUserList(v46, a1->m_type);
if ( StoredUserList )
{
v45->getUserListFinished(&a1->UserListDelegate, StoredUserList, a1->m_type);
}
else
{
LOBYTE(v48) = 1;
a1->m_circle->setVisible(a1->m_circle, v48);
FriendsProfilePage::setupUsersBrowser(a1, nullptr, a1->m_type);
v49 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v53 = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = ((__int64 (__fastcall *)(_QWORD))sub_140141280)(v53);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v49 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::getUserList(v49, a1->m_type);
}
return 1;
}
return result;
}