//
// GJUserCell::loadFromScore from 0x10024ba20 to 0x10024c18d (1901 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x100242657
//
// 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 GJUserCell::loadFromScore(GJUserCell *a1, GJUserScore *a2)
{
GJUserScore *m_userScore; // rdi
SimplePlayer *v5; // r13
__int128 v6; // xmm0
GameManager *v7; // rax
GameManager *v8; // rax
GJUserScore *v9; // rax
char m_glowEnabled; // cl
int m_iconID; // esi
int v12; // edx
int v13; // ecx
int v14; // r8d
int v15; // r9d
const cocos2d::CCPoint *v16; // r15
GJUserScore *v17; // rax
std::string *v18; // rax
char v19; // al
__int64 v20; // r14
std::string *p_m_userName; // rdi
GJUserScore *v22; // rax
std::string *v23; // rax
const char *v24; // rdi
cocos2d::CCLabelBMFont *v25; // r14
__int64 v26; // r13
float v27; // xmm0_4
CCMenuItemSpriteExtra *v28; // r13
ButtonSprite *v29; // rax
ButtonSprite *v30; // r14
void (__fastcall *v31)(GJUserCell *, cocos2d::CCObject *); // rcx
CCMenuItemSpriteExtra *v32; // r13
float *v33; // rax
cocos2d::CCSprite *v34; // r14
CCMenuItemSpriteExtra *v35; // r14
cocos2d::CCSprite *v36; // r14
CCMenuItemSpriteExtra *v37; // r14
cocos2d::CCLabelBMFont *v38; // r14
cocos2d::CCLabelBMFont_vtbl *v39; // rax
cocos2d::CCLabelBMFont *v40; // rbx
float *v41; // rax
float v42; // xmm0_4
std::string __str; // [rsp+18h] [rbp-88h] BYREF
cocos2d::CCLabelBMFont *v44; // [rsp+30h] [rbp-70h]
char v45[8]; // [rsp+3Ch] [rbp-64h] BYREF
char v46; // [rsp+44h] [rbp-5Ch] BYREF
float m_width; // [rsp+4Ch] [rbp-54h]
__int128 v48; // [rsp+50h] [rbp-50h] BYREF
void *__p; // [rsp+60h] [rbp-40h]
float v50; // [rsp+74h] [rbp-2Ch]
double v51; // 0:xmm0_8.8
double v52; // 0:xmm0_8.8
double v53; // 0:xmm0_8.8
double v54; // 0:xmm0_8.8
((void (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->removeAllChildrenWithCleanup)(a1->m_mainLayer, 1);
m_userScore = a1->m_userScore;
if ( m_userScore )
{
cocos2d::CCObject::release(m_userScore);
a1->m_userScore = nullptr;
}
if ( a2 )
{
a1->m_userScore = a2;
cocos2d::CCObject::retain(a2);
v50 = *(float *)&a2->m_friendReqStatus;
v5 = SimplePlayer::create(1);
((void (__fastcall *)(cocos2d::CCLayer *, SimplePlayer *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v5,
1);
((void (__fastcall *)(SimplePlayer *, float))v5->setScale)(v5, 1.0);
*(_QWORD *)&v6 = 1106247680;
sub_10028CBE0(&v48, 30.0, a1->m_height * 0.5);
((void (__fastcall *)(SimplePlayer *, __int128 *))v5->setPosition)(v5, &v48);
v7 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v48 = GameManager::colorForIdx(v7, a1->m_userScore->m_color1);
((void (__fastcall *)(SimplePlayer *, __int128 *))v5->setColor)(v5, &v48);
v8 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v48 = GameManager::colorForIdx(v8, a1->m_userScore->m_color2);
SimplePlayer::setSecondColor(v5, (const cocos2d::ccColor3B *)&v48);
SimplePlayer::tryEnableCustomGlowColor(v5, a1->m_userScore->m_color3);
v9 = a1->m_userScore;
m_glowEnabled = 1;
if ( v9->m_special != 2 )
m_glowEnabled = v9->m_glowEnabled;
v5->m_hasGlowOutline = m_glowEnabled;
m_iconID = v9->m_iconID;
SimplePlayer::updatePlayerFrame(v5, m_iconID, v9->m_iconType);
SimplePlayer::updateColors(v5);
v16 = (const cocos2d::CCPoint *)sub_100792C50(0, m_iconID, v12, v13, v14, v15);
((void (__fastcall *)(cocos2d::CCLayer *, const cocos2d::CCPoint *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v16);
v17 = a1->m_userScore;
if ( (v17->m_userName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(
&v48,
v17->m_userName.m_data.m_long.longStorage,
v17->m_userName.m_data.m_long.size,
COERCE_DOUBLE(1106247680));
v19 = v48;
if ( (v48 & 1) != 0 )
{
LABEL_8:
v20 = *((_QWORD *)&v48 + 1);
operator delete(__p);
if ( v20 )
goto LABEL_14;
LABEL_12:
p_m_userName = (std::string *)&a1->m_userScore->m_userName;
*(_WORD *)&__str.__r_.__value_.__l.0 = 11522;
__str.__r_.__value_.__s.__data_[1] = 0;
std::string::operator=(p_m_userName, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
LABEL_14:
v22 = a1->m_userScore;
if ( (v22->m_userName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(
&v48,
v22->m_userName.m_data.m_long.longStorage,
v22->m_userName.m_data.m_long.size,
*(double *)&v6);
if ( (v48 & 1) == 0 )
goto LABEL_16;
}
else
{
v23 = &v22->m_userName;
__p = v23->m_data.m_long.longStorage;
v48 = *(_OWORD *)&v23->m_data.m_short.sizex2;
if ( (v48 & 1) == 0 )
{
LABEL_16:
v24 = (char *)&v48 + 1;
goto LABEL_19;
}
}
v24 = (const char *)__p;
LABEL_19:
v25 = cocos2d::CCLabelBMFont::create_3(v24, "bigFont.fnt");
if ( (v48 & 1) != 0 )
operator delete(__p);
cocos2d::CCLabelBMFont::limitLabelWidth(v25, 150.0, 0.80000001, 0.0);
v26 = ((__int64 (__fastcall *)(SimplePlayer *))v5->getPosition)(v5);
*(float *)&v44 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v25->getContentSize)(v25) * 0.5;
v27 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v25->getScale)(v25);
sub_10028CBE0(&v46, (float)(v27 * *(float *)&v44) + 35.0, 0.0);
sub_10028CCE0(&v48, v26);
v44 = v25;
v28 = CCMenuItemSpriteExtra::create(
v25,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)GJUserCell::onViewProfile);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v16 + 440LL))(v16, v28);
*(cocos2d::CCPoint *)&v51 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v46, v16);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))v28->setPosition)(v28, &v46, v51);
if ( LODWORD(v50) == 4 )
{
v29 = ButtonSprite::create_1("Cancel", 50, 0, 0.60000002, 0, "bigFont.fnt", "GJ_button_05.png", 28.0);
v30 = v29;
v31 = GJUserCell::onCancelFriendRequest;
}
else
{
if ( LODWORD(v50) != 2 )
{
LABEL_26:
if ( a2->m_friendReqStatus == 1 )
{
if ( a2->m_messageState != 2 )
{
v34 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_messages_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v34->setScale)(v34, 0.69999999);
v35 = CCMenuItemSpriteExtra::create(
v34,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)GJUserCell::onSendMessage);
CCMenuItemSpriteExtra::setSizeMult(v35, 1.2);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v16 + 440LL))(
v16,
v35);
sub_10028CBE0(v45, a1->m_width + -60.0, a1->m_height * 0.5);
*(cocos2d::CCPoint *)&v53 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v46, v16);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))v35->setPosition)(v35, &v46, v53);
}
v36 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_removeFriend_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v36->setScale)(v36, 0.69999999);
v37 = CCMenuItemSpriteExtra::create(
v36,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)GJUserCell::onRemoveFriend);
CCMenuItemSpriteExtra::setSizeMult(v37, 1.2);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v16 + 440LL))(
v16,
v37);
sub_10028CBE0(v45, a1->m_width + -24.0, a1->m_height * 0.5);
*(cocos2d::CCPoint *)&v54 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v46, v16);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))v37->setPosition)(v37, &v46, v54);
}
if ( a1->m_userScore->m_newFriendRequest && LODWORD(v50) != 2 && LODWORD(v50) != 4 )
{
v38 = cocos2d::CCLabelBMFont::create_3("New!", "goldFont.fnt");
v39 = v38->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v50 = 0.5;
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v39->setScale)(v38);
sub_10028CBE0(&v46, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v38->setAnchorPoint)(v38, &v46);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v38,
10);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v38->setTag)(v38, 100);
v40 = v44;
v41 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v44->getContentSize)(v44);
v50 = v50 * *v41;
v42 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v40->getScale)(v40);
sub_10028CBE0(v45, (float)(v42 * v50) + 10.0, 0.0);
sub_10028CCE0(&v46, &v48);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v38->setPosition)(v38, &v46);
}
return;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v28->setEnabled)(v28, 0);
v29 = ButtonSprite::create_1("Unblock", 50, 0, 0.60000002, 0, "bigFont.fnt", "GJ_button_05.png", 28.0);
v30 = v29;
v31 = GJUserCell::onUnblockUser;
}
v32 = CCMenuItemSpriteExtra::create(v29, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)v31);
CCMenuItemSpriteExtra::setSizeMult(v32, 1.5);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v16 + 440LL))(v16, v32);
m_width = a1->m_width;
v33 = (float *)((__int64 (__fastcall *)(ButtonSprite *))v30->getContentSize)(v30);
sub_10028CBE0(v45, (float)(m_width - (float)(*v33 * 0.5)) + -9.0, 0.5 * a1->m_height);
*(cocos2d::CCPoint *)&v52 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v46, v16);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))v32->setPosition)(v32, &v46, v52);
goto LABEL_26;
}
}
else
{
v18 = &v17->m_userName;
__p = v18->m_data.m_long.longStorage;
v6 = *(_OWORD *)&v18->m_data.m_short.sizex2;
v48 = *(_OWORD *)&v18->m_data.m_short.sizex2;
v19 = v48;
if ( (v48 & 1) != 0 )
goto LABEL_8;
}
if ( v19 )
goto LABEL_14;
goto LABEL_12;
}
}