//
// FriendRequestPopup::loadFromGJFriendRequest from 0xa2b940 to 0xa2c0b4 (1908 bytes)
//
// 2 xrefs:
// > FriendRequestPopup::init @ 0xa31db4
// > ??> @ 0x7a4b8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:59:45 +0000
//
__int64 __fastcall FriendRequestPopup::loadFromGJFriendRequest(FriendRequestPopup *this, GJFriendRequest *a2)
{
GameLevelManager *v3; // x0
cocos2d::CCDirector *v4; // x0
cocos2d::CCDirector *v5; // x0
__int64 v6; // x0
__int64 v7; // x2
__int64 v8; // x0
__int64 v9; // x1
__int64 v10; // x1
char *v11; // x1
EmoteSprite *v12; // x0
int v13; // w0
EmoteSprite *v14; // x0
float v15; // s9
const char *v16; // x1
size_t v17; // x0
EmoteSprite *v18; // x0
int v19; // w0
__int64 v20; // x23
void (__fastcall *v21)(__int64, __int64 *); // x26
__int64 v22; // x1
__int64 v23; // x2
__int64 v24; // x4
__int64 v25; // x5
__int64 v26; // x23
__int64 v27; // x0
__int64 v28; // x2
__int64 v29; // x0
__int64 v30; // x1
const char *v31; // x1
cocos2d::CCString *v32; // x0
cocos2d::CCLabelBMFont *CString; // x0
const char *v34; // x2
__int64 v35; // x23
void (__fastcall *v36)(__int64, __int64 *); // x24
void (__fastcall *v37)(__int64, __int64 *); // x24
const char *v38; // x6
__int64 v39; // x0
int v40; // w27
float v41; // s9
__int64 v42; // x0
__int64 v43; // x25
cocos2d::CCNode *v44; // x28
const char *v45; // x6
__int64 v46; // x0
__int64 v47; // x25
void (__fastcall *v48)(__int64, __int64 *); // x27
__int64 v49; // x0
__int64 v50; // x25
cocos2d::CCNode *v51; // x26
void (__fastcall *v52)(__int64, __int64 *); // x20
__int64 v54; // x0
__int64 v55; // x22
cocos2d::CCNode *v56; // x0
void (__fastcall *v57)(__int64, __int64 *); // x20
int v58; // w0
int v59; // w0
char *v60; // [xsp+78h] [xbp+78h]
void (__fastcall *v61)(__int64, __int64 *); // [xsp+78h] [xbp+78h]
__int64 v62; // [xsp+88h] [xbp+88h] BYREF
_BYTE v63[8]; // [xsp+90h] [xbp+90h] BYREF
_BYTE v64[8]; // [xsp+98h] [xbp+98h] BYREF
_BYTE v65[8]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v66; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v67; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v68; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v69; // [xsp+C0h] [xbp+C0h]
void *v70; // [xsp+C8h] [xbp+C8h]
__int64 v71[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v72; // [xsp+E0h] [xbp+E0h]
__int64 v73; // [xsp+E8h] [xbp+E8h] BYREF
__int64 v74; // [xsp+F0h] [xbp+F0h]
void *v75; // [xsp+F8h] [xbp+F8h]
__int64 v76; // [xsp+100h] [xbp+100h] BYREF
__int64 v77; // [xsp+108h] [xbp+108h]
void *v78; // [xsp+110h] [xbp+110h]
if ( a2 && !*((_QWORD *)this + 87) )
{
*((_QWORD *)this + 87) = a2;
v3 = (GameLevelManager *)cocos2d::CCObject::retain(a2);
v4 = (cocos2d::CCDirector *)GameLevelManager::sharedState(v3);
*((_QWORD *)v4 + 170) = (char *)this + 664;
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize(&v62, v5);
v68 = 0;
v6 = *((_QWORD *)this + 87);
v69 = 0;
v7 = v6 + 328;
v70 = nullptr;
if ( (*(_BYTE *)(v6 + 328) & 1) != 0 )
{
std::string::__init(&v68, *(void **)(v6 + 344), *(_QWORD *)(v6 + 336));
}
else
{
v8 = *(_QWORD *)v7;
v9 = *(_QWORD *)(v7 + 8);
v70 = *(void **)(v7 + 16);
v68 = v8;
v69 = v9;
}
v10 = (unsigned __int8)v68 >> 1;
if ( (v68 & 1) != 0 )
v10 = v69;
if ( !v10 )
{
if ( *((_BYTE *)this + 689) )
v11 = "Friend request sent";
else
v11 = "Sent you a friend request";
std::string::assign(&v68, v11);
}
v12 = (EmoteSprite *)GameToolbox::stripNonBreakingSpaces((unsigned __int8 *)&v68);
v13 = EmoteSprite::maxEmotesComment(v12);
v14 = (EmoteSprite *)EmoteSprite::effectiveLength((char *)&v68, v13);
if ( (int)v14 <= 180 )
{
v58 = EmoteSprite::maxEmotesComment(v14);
v59 = EmoteSprite::effectiveLength((char *)&v68, v58);
if ( v59 > 70 )
v15 = (float)((float)((float)(180 - v59) / 180.0) * 0.3) + 0.7;
else
v15 = 1.0;
}
else
{
v15 = 0.7;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v63, *(float *)&v62 * 0.5, (float)(*((float *)&v62 + 1) * 0.5) + -4.0);
v16 = (char *)&v68 + 1;
if ( (v68 & 1) != 0 )
v16 = (const char *)v70;
v60 = (char *)v16;
v71[0] = 0;
v71[1] = 0;
v72 = nullptr;
v17 = strlen(v16);
std::string::__init(v71, v60, v17);
v18 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 0.5, 0.5);
v19 = EmoteSprite::maxEmotesComment(v18);
v20 = TextArea::create((char *)v71, "chatFont.fnt", (const cocos2d::CCPoint *)&v67, 1, v19, 1.0, 231.0 / v15, 20.0);
if ( (v71[0] & 1) != 0 )
operator delete(v72);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v20);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v66, 0.0, 1.0);
cocos2d::CCPoint::operator+(&v67, v63);
v21(v20, &v67);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, v15);
v22 = *((_QWORD *)this + 87);
v73 = 0;
v23 = v22 + 352;
v74 = 0;
LOBYTE(v22) = *(_BYTE *)(v22 + 352);
v75 = nullptr;
if ( (v22 & 1) != 0 )
{
std::string::__init(&v73, *(void **)(v23 + 16), *(_QWORD *)(v23 + 8));
}
else
{
v24 = *(_QWORD *)v23;
v25 = *(_QWORD *)(v23 + 8);
v75 = *(void **)(v23 + 16);
v73 = v24;
v74 = v25;
}
v26 = (unsigned __int8)v73 >> 1;
if ( (v73 & 1) != 0 )
{
v26 = v74;
operator delete(v75);
}
if ( v26 )
{
v27 = *((_QWORD *)this + 87);
v76 = 0;
v28 = v27 + 352;
v77 = 0;
LOBYTE(v27) = *(_BYTE *)(v27 + 352);
v78 = nullptr;
if ( (v27 & 1) != 0 )
{
std::string::__init(&v76, *(void **)(v28 + 16), *(_QWORD *)(v28 + 8));
}
else
{
v29 = *(_QWORD *)v28;
v30 = *(_QWORD *)(v28 + 8);
v78 = *(void **)(v28 + 16);
v76 = v29;
v77 = v30;
}
v31 = (char *)&v76 + 1;
if ( (v76 & 1) != 0 )
v31 = (const char *)v78;
v32 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s ago", v31);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v32);
v35 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v34);
if ( (v76 & 1) != 0 )
operator delete(v78);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v35,
1);
v36 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v35 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, 1.0, 0.5);
v36(v35, &v67);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v35 + 160LL))(v35, 0.6);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v35 + 1072LL))(v35, &unk_116D890);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v35 + 1024LL))(v35, 4294967265LL);
v37 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v35 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v67,
(float)((float)(*(float *)&v62 * 0.5) + 170.0) - 8.0,
(float)((float)(*((float *)&v62 + 1) * 0.5) + 95.0) - 12.0);
v37(v35, &v67);
}
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v64,
*(float *)&v62 * 0.5,
(float)((float)(*((float *)&v62 + 1) * 0.5) + -95.0) + 22.0);
if ( *((_BYTE *)this + 689) )
{
v54 = ButtonSprite::create(
(ButtonSprite *)"Cancel",
(const char *)&dword_40 + 1,
0,
1,
0.55,
"bigFont.fnt",
"GJ_button_06.png",
v38,
26.0);
v55 = CCMenuItemSpriteExtra::create(v54, 0, (__int64)this, (__int64)FriendRequestPopup::onRemove, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v55);
v56 = *((cocos2d::CCNode **)this + 69);
v57 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 184LL);
cocos2d::CCNode::convertToNodeSpace(&v67, v56, (const cocos2d::CCPoint *)v64);
v57(v55, &v67);
}
else
{
v39 = *((_QWORD *)this + 87);
v40 = *(unsigned __int8 *)(v39 + 377);
if ( *(_BYTE *)(v39 + 377) )
v41 = 50.0;
else
v41 = 95.0;
v42 = ButtonSprite::create(
(ButtonSprite *)"Accept",
(const char *)&dword_40 + 1,
0,
1,
0.55,
"bigFont.fnt",
"GJ_button_01.png",
v38,
26.0);
v43 = CCMenuItemSpriteExtra::create(v42, 0, (__int64)this, (__int64)FriendRequestPopup::onAccept, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v43);
v44 = *((cocos2d::CCNode **)this + 69);
v61 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v43 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, -v41, 0.0);
cocos2d::CCPoint::operator+(&v66, v64);
cocos2d::CCNode::convertToNodeSpace(&v67, v44, (const cocos2d::CCPoint *)&v66);
v61(v43, &v67);
if ( !v40 )
{
v46 = ButtonSprite::create(
(ButtonSprite *)"Ignore",
(const char *)&dword_40 + 1,
0,
1,
0.55,
"bigFont.fnt",
"GJ_button_04.png",
v45,
26.0);
v47 = CCMenuItemSpriteExtra::create(v46, 0, (__int64)this, (__int64)FriendRequestPopup::onIgnore, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v47);
v48 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCNode::convertToNodeSpace(&v67, *((cocos2d::CCNode **)this + 69), (const cocos2d::CCPoint *)v64);
v48(v47, &v67);
}
v49 = ButtonSprite::create(
(ButtonSprite *)"Block",
(const char *)&dword_40 + 1,
0,
1,
0.55,
"bigFont.fnt",
"GJ_button_06.png",
v45,
26.0);
v50 = CCMenuItemSpriteExtra::create(v49, 0, (__int64)this, (__int64)FriendRequestPopup::onBlock, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v50);
v51 = *((cocos2d::CCNode **)this + 69);
v52 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, v41, 0.0);
cocos2d::CCPoint::operator+(&v66, v64);
cocos2d::CCNode::convertToNodeSpace(&v67, v51, (const cocos2d::CCPoint *)&v66);
v52(v50, &v67);
}
if ( (v68 & 1) != 0 )
operator delete(v70);
}
return _stack_chk_guard;
}