//
// ProfilePage::onFriend from 0x10019ae20 to 0x10019b028 (520 bytes)
//
// 1 xrefs:
// > ProfilePage::loadPageFromUserInfo @ 0x100199990
//
// 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 ProfilePage::onFriend(ProfilePage *a1, cocos2d::CCObject *a2)
{
GJAccountManager *v3; // x0
int m_friendReqStatus; // w8
ButtonSprite **v5; // x19
__int64 m_accountID; // x19
GameLevelManager *v7; // x0
GJFriendRequest *v8; // x0
FriendRequestPopup *v9; // x0
void *__p[2]; // [xsp+0h] [xbp-70h] BYREF
char v11; // [xsp+17h] [xbp-59h]
void *v12[2]; // [xsp+18h] [xbp-58h] BYREF
char v13; // [xsp+2Fh] [xbp-41h]
void *v14[2]; // [xsp+30h] [xbp-40h] BYREF
char v15; // [xsp+47h] [xbp-29h]
void *v16[2]; // [xsp+48h] [xbp-28h] BYREF
char v17; // [xsp+5Fh] [xbp-11h]
v3 = GJAccountManager::sharedState();
if ( v3->m_accountID <= v3->m_unkInt1 )
{
ProfilePage::showNoAccountError((ProfilePage *)v3);
return;
}
m_friendReqStatus = a1->m_score->m_friendReqStatus;
if ( m_friendReqStatus <= 2 )
{
if ( !m_friendReqStatus )
{
sub_100009900(v16, "Friend request");
m_accountID = (unsigned int)a1->m_accountID;
sub_100009900(v14, "");
v5 = (ButtonSprite **)ShareCommentLayer::create(v16, 140, 2, m_accountID, v14);
if ( v15 < 0 )
operator delete(v14[0]);
if ( v17 < 0 )
operator delete(v16[0]);
goto LABEL_19;
}
if ( m_friendReqStatus != 1 )
return;
sub_100009900(__p, "Are you sure you want to remove this friend?");
v5 = (ButtonSprite **)FLAlertLayer::create(
&a1->FLAlertLayerProtocol,
"Unfriend",
__p,
"Back",
"Unfriend",
0,
380.0,
0.0,
1.0);
if ( v11 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(ButtonSprite **, __int64))&(*v5)->m_fVertexZ)(v5, 2);
LABEL_14:
ButtonSprite::updateBGImage(v5[75], "GJ_button_06.png");
LABEL_19:
(*(void (__fastcall **)(ButtonSprite **))&(*v5)[1].m_fTextureTop)(v5);
return;
}
if ( m_friendReqStatus == 3 )
{
v7 = GameLevelManager::sharedState();
v8 = GameLevelManager::friendRequestFromAccountID(v7, a1->m_score->m_accountID);
a1->m_score->m_newFriendRequest = 0;
v9 = FriendRequestPopup::create(v8);
((void (__fastcall *)(FriendRequestPopup *))v9->show)(v9);
return;
}
if ( m_friendReqStatus == 4 )
{
sub_100009900(v12, "Are you sure you want to remove this friend request?");
v5 = (ButtonSprite **)FLAlertLayer::create(
&a1->FLAlertLayerProtocol,
"Cancel friend request",
v12,
"Back",
"Remove",
0,
380.0,
0.0,
1.0);
if ( v13 < 0 )
operator delete(v12[0]);
(*(void (__fastcall **)(ButtonSprite **, __int64))&(*v5)->m_fVertexZ)(v5, 1);
goto LABEL_14;
}
}