//
// FRequestProfilePage::init from 0x14013da70 to 0x14013e56b (2811 bytes)
//
// 2 xrefs:
// > FRequestProfilePage::create @ 0x14013da1f
// > ??> @ 0x1406ca1ac
//
// 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
bool FRequestProfilePage::init(FRequestProfilePage *a1, bool 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
const char *v14; // rcx
struct cocos2d::CCLabelBMFont *v15; // rsi
cocos2d::CCLabelBMFont_vtbl *v16; // rbx
const cocos2d::CCPoint *v17; // rax
struct cocos2d::CCLabelBMFont *v18; // rdi
__int64 v19; // rax
cocos2d::CCLabelBMFont *v20; // rax
cocos2d::CCLabelBMFont_vtbl *v21; // rbx
const cocos2d::CCPoint *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
LoadingCircle *v30; // rax
cocos2d::CCSprite *m_sprite; // rbx
cocos2d::CCSprite_vtbl *v32; // rdi
const cocos2d::CCPoint *v33; // rax
struct cocos2d::CCSprite *v34; // rax
CCMenuItemSpriteExtra *v35; // rdi
CCMenuItemSpriteExtra_vtbl *v36; // rbx
struct cocos2d::CCPoint v37; // rax
cocos2d::CCSprite *v38; // rdi
ButtonSprite *v39; // rbx
int v40; // r9d
CCMenuItemSpriteExtra *v41; // rsi
CCMenuItemSpriteExtra_vtbl *v42; // rbx
struct cocos2d::CCPoint v43; // rax
struct cocos2d::CCSprite *v44; // rdi
struct cocos2d::CCSprite *v45; // rbx
CCMenuItemToggler *v46; // rdi
__int64 v47; // rax
struct cocos2d::CCLabelBMFont *v48; // rbx
cocos2d::CCLabelBMFont *v49; // rax
cocos2d::CCLabelBMFont_vtbl *v50; // rbx
const cocos2d::CCPoint *v51; // rax
struct cocos2d::CCSprite *v52; // rbx
CCMenuItemSpriteExtra *v53; // rax
CCMenuItemSpriteExtra_vtbl *v54; // rbx
struct cocos2d::CCPoint v55; // rax
cocos2d::CCSprite *v56; // rbx
CCMenuItemSpriteExtra *v57; // rax
CCMenuItemSpriteExtra_vtbl *v58; // rbx
struct cocos2d::CCPoint v59; // rax
__int64 v60; // rax
struct cocos2d::CCSprite *v61; // rax
CCMenuItemSpriteExtra *v62; // rax
CCMenuItemSpriteExtra_vtbl *v63; // rbx
struct cocos2d::CCPoint v64; // rax
bool v65; // [rsp+38h] [rbp-89h]
ButtonSprite *v66; // [rsp+58h] [rbp-69h] BYREF
cocos2d::CCRect v67; // [rsp+60h] [rbp-61h] BYREF
float v68; // [rsp+138h] [rbp+77h]
float v69; // [rsp+13Ch] [rbp+7Bh]
cocos2d::CCPoint v70; // [rsp+140h] [rbp+7Fh] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
a1->m_noElasticity = 1;
a1->m_sent = a2;
v6 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6);
cocos2d::CCRect::CCRect(&v67, 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 *)&v70, 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(&v70, v68 * 0.5, v69 * 0.5);
v12->setPosition_0(v8, v13);
v14 = "Friend Requests";
if ( a1->m_sent )
v14 = "Sent Requests";
v15 = cocos2d::CCLabelBMFont::create(v14, (const char *)&qword_14052A4D8);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v15, 20);
v16 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v70, v68 * 0.5, (float)((float)(v69 * 0.5) + 145.0) - 17.0);
v16->setPosition_0(v15, v17);
cocos2d::CCLabelBMFont::limitLabelWidth(v15, 185.0, 0.80000001, 0.0);
v18 = cocos2d::CCLabelBMFont::create("Tap on a user to view their profile", "chatFont.fnt");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v18, 10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v66, 0.0, -20.0);
v19 = (__int64)v15->getPosition_0(v15);
cocos2d::CCPoint::operator+(v19, &v70);
v18->setPosition_0(v18, &v70);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v18->setScale_0)(v18);
v20 = cocos2d::CCLabelBMFont::create(" ", "goldFont.fnt");
a1->m_pageLabel = v20;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v20, 20);
v21 = a1->m_pageLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v70, 1.0, 0.5);
v21->setAnchorPoint(a1->m_pageLabel, v22);
v23 = a1->m_pageLabel->__vftable;
cocos2d::CCPoint::CCPoint(
&v70,
(float)((float)(v68 * 0.5) + 220.0) - 10.0,
(float)((float)(v69 * 0.5) + 145.0) - 20.0);
v23->setPosition_0(a1->m_pageLabel, v24);
v25 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_backBtn_001.png");
v26 = CCMenuItemSpriteExtra::create(v25, nullptr, a1, (cocos2d::SEL_MenuHandler *)FRequestProfilePage::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(
&v70,
(float)((float)(v68 * 0.5) - 220.0) + 10.0,
(float)((float)(v69 * 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);
v30 = LoadingCircle::create();
a1->m_circle = v30;
v30->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;
v32 = m_sprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v70, v68 * 0.5, v69 * 0.5);
v32->setPosition_0(m_sprite, v33);
if ( !a1->m_sent )
{
v34 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_pending_001.png");
v35 = CCMenuItemSpriteExtra::create(
v34,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)FRequestProfilePage::onSentRequests);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v35);
v36 = v35->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(
&v70,
(float)((float)(v68 * 0.5) + 220.0) - 10.0,
(float)((float)(v69 * 0.5) + 145.0) - 10.0);
v37 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v66);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v36->setPosition_0)(v35, v37);
}
if ( !a2 )
{
v38 = cocos2d::CCSprite::createWithSpriteFrameName("edit_delBtn_001.png");
v66 = (ButtonSprite *)operator new(0x2C0u);
v39 = ButtonSprite::ButtonSprite(v66);
if ( v39 )
{
if ( ButtonSprite::init(v39, v38, 34, v40, 36.0, 1.0, v65, "GJ_button_04.png", 0) )
{
cocos2d::CCObject::autorelease(v39);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v39->~ButtonSprite)(v39, 1);
v39 = nullptr;
}
}
((void (__fastcall *)(ButtonSprite *))v39->setScale_0)(v39);
v41 = CCMenuItemSpriteExtra::create(
v39,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)FRequestProfilePage::onDeleteSelected);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v41);
cocos2d::CCPoint::CCPoint(
&v70,
(float)((float)(v68 * 0.5) - 220.0) + 20.0,
(float)((float)(v69 * 0.5) - 145.0) + 21.0);
v42 = v41->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v43 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v66);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v42->setPosition_0)(v41, v43);
v44 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v45 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v44->setScale_0)(v44);
((void (__fastcall *)(struct cocos2d::CCSprite *))v45->setScale_0)(v45);
v46 = CCMenuItemToggler::create(v45, v44, a1, (cocos2d::SEL_MenuHandler *)FRequestProfilePage::onToggleAllObjects);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v46);
cocos2d::CCPoint::CCPoint(&v67.origin, 46.0, 0.0);
v47 = (__int64)v41->getPosition_0(v41);
cocos2d::CCPoint::operator+(v47, &v66);
v46->setPosition_0(v46, (const cocos2d::CCPoint *)&v66);
*(_DWORD *)(*(_QWORD *)&v46->m_nScriptTapHandler + 372LL) = 1066192077;
HIDWORD(v46->m_offButton->m_pfnSelector.adj) = 1066192077;
CCMenuItemToggler::toggle(v46, (bool)v46->m_onButton);
v48 = cocos2d::CCLabelBMFont::create("All", "goldFont.fnt");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v48, 10);
cocos2d::CCPoint::CCPoint(&v67.origin, 80.0, 0.0);
cocos2d::CCPoint::operator+(&v70, &v66);
v48->setPosition_0(v48, (const cocos2d::CCPoint *)&v66);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v48->setScale_0)(v48);
}
v49 = cocos2d::CCLabelBMFont::create("Something went wrong...", "goldFont.fnt");
a1->m_errorLabel = v49;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v49, 10);
v50 = a1->m_errorLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v70, v68 * 0.5, v69 * 0.5);
v50->setPosition_0(a1->m_errorLabel, v51);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_errorLabel->setScale_0)(a1->m_errorLabel);
a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v52->setScale_0)(v52);
v53 = CCMenuItemSpriteExtra::create(v52, nullptr, a1, (cocos2d::SEL_MenuHandler *)FRequestProfilePage::onPrevPage);
a1->m_prevButton = v53;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v53);
v54 = a1->m_prevButton->__vftable;
cocos2d::CCPoint::CCPoint(&v70, (float)(v68 * 0.5) - 195.0, v69 * 0.5);
v55 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v67.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v54->setPosition_0)(a1->m_prevButton, v55);
HIDWORD(a1->m_prevButton->m_pfnSelector.adj) = 0x40000000;
v56 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v56, 1);
((void (__fastcall *)(cocos2d::CCSprite *))v56->setScale_0)(v56);
v57 = CCMenuItemSpriteExtra::create(v56, nullptr, a1, (cocos2d::SEL_MenuHandler *)FRequestProfilePage::onNextPage);
a1->m_nextButton = v57;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v57);
v58 = a1->m_nextButton->__vftable;
cocos2d::CCPoint::CCPoint(&v70, (float)(v68 * 0.5) + 195.0, v69 * 0.5);
v59 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v67.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v58->setPosition_0)(a1->m_nextButton, v59);
HIDWORD(a1->m_nextButton->m_pfnSelector.adj) = 0x40000000;
a1->m_prevButton->setVisible(a1->m_prevButton, 0);
a1->m_nextButton->setVisible(a1->m_nextButton, 0);
v60 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v70 = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = ((__int64 (__fastcall *)(_QWORD))sub_140141280)(v70);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v60 = qword_1406C2EC0;
}
*(_QWORD *)(v60 + 824) = &a1->FriendRequestDelegate;
v61 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v62 = CCMenuItemSpriteExtra::create(v61, nullptr, a1, (cocos2d::SEL_MenuHandler *)FRequestProfilePage::onUpdate);
a1->m_refreshButton = v62;
HIDWORD(v62->m_pfnSelector.adj) = 1069547520;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, a1->m_refreshButton);
v63 = a1->m_refreshButton->__vftable;
cocos2d::CCPoint::CCPoint(
&v70,
(float)((float)(v68 * 0.5) + 220.0) - 10.0,
(float)((float)((float)(v69 * 0.5) - 145.0) + 10.0) + 1.0);
v64 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v67.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v63->setPosition_0)(
a1->m_refreshButton,
v64);
a1->m_refreshButton->setVisible(a1->m_refreshButton, 0);
FRequestProfilePage::loadPage(a1, 0);
return 1;
}
return result;
}