//
// ProfilePage::onFriend from 0x1007bdb30 to 0x1007bde64 (820 bytes)
//
// 1 xrefs:
// > ProfilePage::loadPageFromUserInfo @ 0x1007bbe11
//
// 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 *v2; // rax
unsigned int m_accountID; // ecx
ButtonSprite **v4; // rbx
void *v5; // rdi
GameLevelManager *v6; // rax
GJFriendRequest *v7; // rax
FriendRequestPopup *v8; // rax
ButtonSprite *v9; // rax
ButtonSprite **v10; // rdi
__int64 v11; // rsi
__int128 v12; // [rsp+8h] [rbp-88h] BYREF
void *__p; // [rsp+18h] [rbp-78h]
_QWORD v14[2]; // [rsp+20h] [rbp-70h] BYREF
void *v15; // [rsp+30h] [rbp-60h]
__int128 v16; // [rsp+38h] [rbp-58h] BYREF
void *v17; // [rsp+48h] [rbp-48h]
__int128 v18; // [rsp+50h] [rbp-40h] BYREF
void *v19; // [rsp+60h] [rbp-30h]
__int128 v20; // [rsp+68h] [rbp-28h] BYREF
void *v21; // [rsp+78h] [rbp-18h]
v2 = GJAccountManager::sharedState();
if ( v2->m_accountID > v2->m_unkInt1 )
{
switch ( a1->m_score->m_friendReqStatus )
{
case 0:
LOBYTE(v20) = 28;
strcpy((char *)&v20 + 1, "Friend request");
m_accountID = a1->m_accountID;
LOWORD(v12) = 0;
v4 = (ButtonSprite **)ShareCommentLayer::create(&v20, 0x8Cu, 2u, m_accountID, &v12);
if ( (v12 & 1) != 0 )
operator delete(__p);
if ( (v20 & 1) == 0 )
goto LABEL_18;
v5 = v21;
goto LABEL_9;
case 1:
v19 = operator new(0x30u);
*(_QWORD *)&v18 = 49;
*((_QWORD *)&v18 + 1) = 44;
strcpy((char *)v19, "Are you sure you want to remove this friend?");
v4 = (ButtonSprite **)FLAlertLayer::create(
(int)a1 + 632,
(int)"Unfriend",
&v18,
(int)"Back",
(int)"Unfriend",
0,
380.0,
0.0,
1.0);
if ( (v18 & 1) != 0 )
operator delete(v19);
v9 = *v4;
v10 = v4;
v11 = 2;
goto LABEL_17;
case 3:
v6 = GameLevelManager::sharedState();
v7 = GameLevelManager::friendRequestFromAccountID(v6, a1->m_score->m_accountID);
a1->m_score->m_newFriendRequest = 0;
v8 = FriendRequestPopup::create(v7);
((void (__fastcall *)(FriendRequestPopup *))v8->show)(v8);
return;
case 4:
v17 = operator new(0x38u);
*(_QWORD *)&v16 = 57;
*((_QWORD *)&v16 + 1) = 52;
strcpy((char *)v17, "Are you sure you want to remove this friend request?");
v4 = (ButtonSprite **)FLAlertLayer::create(
(int)a1 + 632,
(int)"Cancel friend request",
&v16,
(int)"Back",
(int)"Remove",
0,
380.0,
0.0,
1.0);
if ( (v16 & 1) != 0 )
operator delete(v17);
v9 = *v4;
v10 = v4;
v11 = 1;
LABEL_17:
(*(void (__fastcall **)(ButtonSprite **, __int64))&v9->m_fVertexZ)(v10, v11);
ButtonSprite::updateBGImage(v4[75], "GJ_button_06.png");
goto LABEL_18;
default:
return;
}
}
v15 = operator new(0x70u);
v14[0] = 113;
v14[1] = 111;
strcpy(
(char *)v15,
"Create an to send messages, add friends and more! You can create an account from the main menu.");
v4 = (ButtonSprite **)FLAlertLayer::create_1(
0,
(int)"No Account",
(__int64)v14,
(int)"OK",
0,
COERCE_DOUBLE(1135214592));
if ( (v14[0] & 1) != 0 )
{
v5 = v15;
LABEL_9:
operator delete(v5);
}
LABEL_18:
(*(void (__fastcall **)(ButtonSprite **))&(*v4)[1].m_fTextureTop)(v4);
}