//
// MessagesProfilePage::init from 0x8f31a4 to 0x8f3b08 (2404 bytes)
//
// 2 xrefs:
// > MessagesProfilePage::create @ 0x8f3c64
// > ??> @ 0x64fb0
//
// 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
//
bool MessagesProfilePage::init(MessagesProfilePage *a1, bool a2)
{
char v4; // w23
cocos2d::CCDirector *v6; // x0
cocos2d::CCNode *v7; // x22
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x24
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCLabelBMFont *v10; // x22
void (__fastcall *v11)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCLabelBMFont *v12; // x0
cocos2d::CCLabelBMFont *m_levelsLabel; // x22
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCLabelBMFont *v15; // x22
void (__fastcall *v16)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v17; // x0
CCMenuItemSpriteExtra *v18; // x22
cocos2d::CCMenu *v19; // x22
void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
LoadingCircle *v21; // x0
LoadingCircle *m_loadingCircle; // x0
cocos2d::CCSprite *m_sprite; // x22
void (__fastcall *v24)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
ButtonSprite *v25; // x0
cocos2d::CCNode *v26; // x25
CCMenuItemSpriteExtra *v27; // x25
void (__fastcall *v28)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCSprite *v29; // x28
cocos2d::CCSprite *v30; // x27
CCMenuItemToggler *v31; // x0
CCMenuItemToggler *m_toggleAllToggler; // x27
CCMenuItemSpriteExtra *v33; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v35)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
__int64 v36; // x28
cocos2d::CCLabelBMFont *v37; // x25
void (__fastcall *v38)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCLabelBMFont *v39; // x0
cocos2d::CCLabelBMFont *m_errorLabel; // x24
void (__fastcall *v41)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v42; // x25
CCMenuItemSpriteExtra *v43; // x0
CCMenuItemSpriteExtra *m_prevButton; // x25
cocos2d::CCMenu *v45; // x27
void (__fastcall *v46)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCSprite *v47; // x24
CCMenuItemSpriteExtra *v48; // x0
CCMenuItemSpriteExtra *m_nextButton; // x24
cocos2d::CCMenu *v50; // x26
void (__fastcall *v51)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v52; // x0
CCMenuItemSpriteExtra *v53; // x0
CCMenuItemSpriteExtra *m_refreshButton; // x24
cocos2d::CCMenu *v55; // x26
void (__fastcall *v56)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v57; // x0
CCMenuItemSpriteExtra *v58; // x25
cocos2d::CCMenu *m_buttonMenu; // x27
void (__fastcall *v60)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
float v61; // [xsp+A0h] [xbp+A0h]
float v62; // [xsp+A4h] [xbp+A4h]
cocos2d::CCPoint v63; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v64; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCRect v65; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCPoint v66; // 0:kr08_8.8
cocos2d::CCPoint v67; // 0:kr10_8.8
cocos2d::CCPoint v68; // 0:kr18_8.8
cocos2d::CCPoint v69; // 0:kr20_8.8
cocos2d::CCPoint v70; // 0:kr28_8.8
cocos2d::SEL_MenuHandler v71; // 0:x2.16
cocos2d::SEL_MenuHandler v72; // 0:x2.16
cocos2d::SEL_MenuHandler v73; // 0:x2.16
cocos2d::SEL_MenuHandler v74; // 0:x2.16
cocos2d::SEL_MenuHandler v75; // 0:x2.16
cocos2d::SEL_MenuHandler v76; // 0:x2.16
cocos2d::SEL_MenuHandler v77; // 0:x3.16
cocos2d::CCRect v78; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v4 = FLAlertLayer::init(a1, 0x96u);
if ( v4 )
{
a1->m_sentMessages = a2;
a1->m_noElasticity = (unsigned __int8)&dword_0 + 1;
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
cocos2d::CCRect::CCRect(&v65, 0.0, 0.0, 80.0, 80.0);
v7 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v65,
v78);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v7->__vftable[1].~CCNode_0)(v7, 0xFFFFFFFFLL);
setContentSize = v7->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v65, 440.0, 290.0);
setContentSize(v7, (const cocos2d::CCSize *)&v65);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v7, -1);
setPosition = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, v61 * 0.5, v62 * 0.5);
setPosition(v7, &v65.origin);
v10 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v10, 20);
v11 = v10->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, v61 * 0.5, (float)((float)(v62 * 0.5) + 145.0) - 20.0);
v11(v10, &v65.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v10, 185.0, 0.8, 0.0);
v12 = cocos2d::CCLabelBMFont::create();
a1->m_levelsLabel = v12;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v12, 20);
m_levelsLabel = a1->m_levelsLabel;
setAnchorPoint = m_levelsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v65.origin, 1.0, 0.5);
setAnchorPoint(m_levelsLabel, &v65.origin);
v15 = a1->m_levelsLabel;
v16 = v15->setPosition;
cocos2d::CCPoint::CCPoint(
&v65.origin,
(float)((float)(v61 * 0.5) + 220.0) - 10.0,
(float)((float)(v62 * 0.5) + 145.0) - 20.0);
v16(v15, &v65.origin);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_backBtn_001.png");
v71.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v71.adj = (size_t)MessagesProfilePage::onClose;
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, v71);
CCMenuItemSpriteExtra::setSizeMult(v18, 1.6);
v19 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v18, nullptr);
a1->m_buttonMenu = v19;
v20 = v19->setPosition;
cocos2d::CCPoint::CCPoint(
&v65.origin,
(float)((float)(v61 * 0.5) + -220.0) + 10.0,
(float)((float)(v62 * 0.5) + 145.0) - 10.0);
v20(v19, &v65.origin);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
v21 = LoadingCircle::create();
a1->m_loadingCircle = v21;
v21->m_parentLayer = a1->m_mainLayer;
m_loadingCircle = a1->m_loadingCircle;
m_loadingCircle->m_fade = 0;
cocos2d::CCObject::retain(m_loadingCircle);
LoadingCircle::show(a1->m_loadingCircle);
a1->m_loadingCircle->setVisible(a1->m_loadingCircle, 0);
m_sprite = a1->m_loadingCircle->m_sprite;
v24 = m_sprite->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, v61 * 0.5, v62 * 0.5);
v24(m_sprite, &v65.origin);
if ( !a1->m_sentMessages )
{
v57 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_messagessent_001.png");
v76.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v76.adj = (size_t)MessagesProfilePage::onSentMessages;
v58 = CCMenuItemSpriteExtra::create(v57, nullptr, v76);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v58);
m_buttonMenu = a1->m_buttonMenu;
v60 = v58->setPosition;
cocos2d::CCPoint::CCPoint(
&v65.origin,
(float)((float)(v61 * 0.5) + 220.0) - 10.0,
(float)((float)(v62 * 0.5) + 145.0) - 10.0);
v70 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v65.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v60)(v58, &v64, v70.x, v70.y);
}
v25 = (ButtonSprite *)cocos2d::CCSprite::createWithSpriteFrameName("edit_delBtn_001.png");
v26 = (cocos2d::CCNode *)ButtonSprite::create(
v25,
(cocos2d::CCSprite *)((char *)&qword_20 + 2),
0,
1,
36.0,
1.0,
(cocos2d::CCSprite *)"GJ_button_04.png",
nullptr);
v26->setScale(v26, 0.7);
v72.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v72.adj = (size_t)MessagesProfilePage::onDeleteSelected;
v27 = CCMenuItemSpriteExtra::create(v26, nullptr, v72);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v27);
cocos2d::CCPoint::CCPoint(
&v63,
(float)((float)(v61 * 0.5) + -220.0) + 20.0,
(float)((float)(v62 * 0.5) + -145.0) + 21.0);
v28 = v27->setPosition;
v66 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v63);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v28)(v27, &v65, v66.x, v66.y);
v29 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v30 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
v29->setScale(v29, 0.7);
v30->setScale(v30, 0.7);
v77.adj = 0;
v77.ptr = (void (__cdecl *)(cocos2d::CCObject *))MessagesProfilePage::onToggleAllObjects;
v31 = CCMenuItemToggler::create(v30, v29, a1, v77);
a1->m_toggleAllToggler = v31;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v31);
m_toggleAllToggler = a1->m_toggleAllToggler;
v33 = v27;
getPosition = v27->getPosition;
v35 = m_toggleAllToggler->setPosition;
v36 = (__int64)getPosition(v33);
cocos2d::CCPoint::CCPoint(&v65.origin, 46.0, 0.0);
cocos2d::CCPoint::operator+(&v64, v36, &v65);
v35(m_toggleAllToggler, (const cocos2d::CCPoint *)&v64);
CCMenuItemToggler::setSizeMult(a1->m_toggleAllToggler, 1.1);
v37 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v37, 10);
v38 = v37->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, 80.0, 0.0);
cocos2d::CCPoint::operator+(&v64, &v63, &v65);
v38(v37, (const cocos2d::CCPoint *)&v64);
v37->setScale(v37, 0.6);
v39 = cocos2d::CCLabelBMFont::create();
a1->m_errorLabel = v39;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v39, 10);
m_errorLabel = a1->m_errorLabel;
v41 = m_errorLabel->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, v61 * 0.5, v62 * 0.5);
v41(m_errorLabel, &v65.origin);
a1->m_errorLabel->setScale(a1->m_errorLabel, 0.6);
a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);
v42 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v42->setScale(v42, 0.8);
v73.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v73.adj = (size_t)MessagesProfilePage::onPrevPage;
v43 = CCMenuItemSpriteExtra::create(v42, nullptr, v73);
a1->m_prevButton = v43;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v43);
m_prevButton = a1->m_prevButton;
v45 = a1->m_buttonMenu;
v46 = m_prevButton->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, (float)(v61 * 0.5) + -195.0, v62 * 0.5);
v67 = cocos2d::CCNode::convertToNodeSpace(v45, &v65.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v46)(m_prevButton, &v64, v67.x, v67.y);
CCMenuItemSpriteExtra::setSizeMult(a1->m_prevButton, 2.0);
v47 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v47, 1);
v47->setScale(v47, 0.8);
v74.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v74.adj = (size_t)MessagesProfilePage::onNextPage;
v48 = CCMenuItemSpriteExtra::create(v47, nullptr, v74);
a1->m_nextButton = v48;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v48);
m_nextButton = a1->m_nextButton;
v50 = a1->m_buttonMenu;
v51 = m_nextButton->setPosition;
cocos2d::CCPoint::CCPoint(&v65.origin, (float)(v61 * 0.5) + 195.0, v62 * 0.5);
v68 = cocos2d::CCNode::convertToNodeSpace(v50, &v65.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v51)(m_nextButton, &v64, v68.x, v68.y);
CCMenuItemSpriteExtra::setSizeMult(a1->m_nextButton, 2.0);
a1->m_prevButton->setVisible(a1->m_prevButton, 0);
a1->m_nextButton->setVisible(a1->m_nextButton, 0);
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v75.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v75.adj = (size_t)MessagesProfilePage::onUpdate;
v53 = CCMenuItemSpriteExtra::create(v52, nullptr, v75);
a1->m_refreshButton = v53;
CCMenuItemSpriteExtra::setSizeMult(v53, 1.5);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, a1->m_refreshButton);
m_refreshButton = a1->m_refreshButton;
v55 = a1->m_buttonMenu;
v56 = m_refreshButton->setPosition;
cocos2d::CCPoint::CCPoint(
&v65.origin,
(float)((float)(v61 * 0.5) + 220.0) - 10.0,
(float)((float)((float)(v62 * 0.5) + -145.0) + 10.0) + 1.0);
v69 = cocos2d::CCNode::convertToNodeSpace(v55, &v65.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v56)(m_refreshButton, &v64, v69.x, v69.y);
a1->m_refreshButton->setVisible(a1->m_refreshButton, 0);
MessagesProfilePage::loadPage(a1, 0);
}
return v4;
}