//
// GJLevelScoreCell::loadFromScore from 0x10024ad00 to 0x10024b5f7 (2295 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x100242866
//
// 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 GJLevelScoreCell::loadFromScore(GJLevelScoreCell *a1, GJUserScore *a2)
{
SimplePlayer *v2; // r14
GameManager *v3; // rax
GameManager *v4; // rax
GJUserScore *m_userScore; // rax
char m_glowEnabled; // cl
int m_iconID; // esi
int v8; // edx
int v9; // ecx
int v10; // r8d
int v11; // r9d
const cocos2d::CCPoint *v12; // r13
GJLevelScoreCell *v13; // r15
int m_playerRank; // esi
cocos2d::CCString *v15; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v17; // rbx
__int64 v18; // xmm0_8
GJUserScore *v19; // rax
const char *v20; // rdi
const char *v21; // rcx
bool v22; // zf
const std::string::value_type *v23; // rsi
const char *data; // rdi
cocos2d::CCSprite *v25; // rbx
cocos2d::CCLabelBMFont *v26; // r12
float v27; // xmm0_4
float v28; // xmm1_4
__int64 v29; // r14
float v30; // xmm0_4
GJLevelScoreCell *v31; // rbx
cocos2d::CCLayerColor *m_backgroundLayer; // rdi
GJUserScore *v33; // rax
cocos2d::CCString *v34; // rax
const char *v35; // rax
const char *v36; // rdi
cocos2d::CCLabelBMFont *v37; // r14
double v38; // xmm0_8
int m_secretCoins; // r12d
int v40; // r13d
cocos2d::CCSprite *v41; // rbx
__int64 v42; // r15
std::string *v43; // rax
cocos2d::CCString *v44; // rax
const char *v45; // rax
cocos2d::CCLabelBMFont *v46; // r14
char v47[8]; // [rsp+0h] [rbp-90h] BYREF
CCMenuItemSpriteExtra *v48; // [rsp+8h] [rbp-88h]
_BYTE v49[8]; // [rsp+14h] [rbp-7Ch] BYREF
float v50; // [rsp+1Ch] [rbp-74h]
float v51; // [rsp+20h] [rbp-70h]
float v52; // [rsp+24h] [rbp-6Ch]
_BYTE v53[8]; // [rsp+28h] [rbp-68h] BYREF
std::string v54; // [rsp+30h] [rbp-60h] BYREF
GJLevelScoreCell *v55; // [rsp+48h] [rbp-48h]
std::string m_userName; // [rsp+50h] [rbp-40h] BYREF
double v57; // 0:xmm0_8.8
((void (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->removeAllChildrenWithCleanup)(a1->m_mainLayer, 1);
a1->m_userScore = a2;
v2 = SimplePlayer::create(1);
((void (__fastcall *)(cocos2d::CCLayer *, SimplePlayer *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v2,
1);
((void (__fastcall *)(SimplePlayer *, float))v2->setScale)(v2, 0.80000001);
sub_10028CBE0(&m_userName, 60.0, (float)(a1->m_height * 0.5) + 0.0);
((void (__fastcall *)(SimplePlayer *, std::string *))v2->setPosition)(v2, &m_userName);
v3 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&m_userName.__r_.__value_.__l.0 = GameManager::colorForIdx(v3, a1->m_userScore->m_color1);
((void (__fastcall *)(SimplePlayer *, std::string *))v2->setColor)(v2, &m_userName);
v4 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&m_userName.__r_.__value_.__l.0 = GameManager::colorForIdx(v4, a1->m_userScore->m_color2);
SimplePlayer::setSecondColor(v2, (const cocos2d::ccColor3B *)&m_userName);
SimplePlayer::tryEnableCustomGlowColor(v2, a1->m_userScore->m_color3);
v55 = a1;
m_userScore = a1->m_userScore;
m_glowEnabled = 1;
if ( m_userScore->m_special != 2 )
m_glowEnabled = m_userScore->m_glowEnabled;
v2->m_hasGlowOutline = m_glowEnabled;
m_iconID = m_userScore->m_iconID;
SimplePlayer::updatePlayerFrame(v2, m_iconID, m_userScore->m_iconType);
SimplePlayer::updateColors(v2);
v12 = (const cocos2d::CCPoint *)sub_100792C50(0, m_iconID, v8, v9, v10, v11);
v13 = v55;
((void (__fastcall *)(cocos2d::CCLayer *, const cocos2d::CCPoint *))v55->m_mainLayer->addChild)(v55->m_mainLayer, v12);
sub_10028CBE0(v49, 22.0, v55->m_height * 0.5);
m_playerRank = v13->m_userScore->m_playerRank;
if ( m_playerRank >= 4 )
{
v15 = (cocos2d::CCString *)sub_1007AB580("%i", v47[0]);
CString = cocos2d::CCString::getCString(v15);
v17 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v13->m_mainLayer->addChild)(
v13->m_mainLayer,
v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v17->setPosition)(v17, v49);
v18 = 1101004800;
cocos2d::CCLabelBMFont::limitLabelWidth(v17, 20.0, 0.75, 0.0);
v19 = v13->m_userScore;
if ( (v19->m_userName.m_data.m_short.sizex2 & 1) == 0 )
goto LABEL_5;
LABEL_17:
sub_100006B70(
&m_userName,
v19->m_userName.m_data.m_long.longStorage,
v19->m_userName.m_data.m_long.size,
*(double *)&v18);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_6;
goto LABEL_18;
}
memset(&m_userName, 0, sizeof(m_userName));
v21 = "rankIcon_top100_001.png";
if ( m_playerRank == 2 )
v21 = "rankIcon_top50_001.png";
v22 = m_playerRank == 1;
v23 = "rankIcon_top10_001.png";
if ( !v22 )
v23 = v21;
std::string::assign(&m_userName, v23);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
data = m_userName.__r_.__value_.__l.__data_;
else
data = m_userName.__r_.__value_.__s.__data_;
v25 = cocos2d::CCSprite::createWithSpriteFrameName(data);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v55->m_mainLayer->addChild)(v55->m_mainLayer, v25);
((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *))v25->setPosition)(v25, v49);
v18 = 1061997773;
((void (__fastcall *)(cocos2d::CCSprite *, float))v25->setScale)(v25, 0.80000001);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_userName.__r_.__value_.__l.__data_);
v19 = v55->m_userScore;
if ( (v19->m_userName.m_data.m_short.sizex2 & 1) != 0 )
goto LABEL_17;
LABEL_5:
m_userName = (std::string)v19->m_userName;
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_6:
v20 = m_userName.__r_.__value_.__s.__data_;
goto LABEL_19;
}
LABEL_18:
v20 = m_userName.__r_.__value_.__l.__data_;
LABEL_19:
v26 = cocos2d::CCLabelBMFont::create_3(v20, "goldFont.fnt");
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_userName.__r_.__value_.__l.__data_);
if ( v55->m_userScore->m_levelMode == 1 )
{
v27 = 100.0;
v28 = 0.69999999;
}
else
{
v27 = 130.0;
v28 = 0.80000001;
}
cocos2d::CCLabelBMFont::limitLabelWidth(v26, v27, v28, 0.0);
v48 = CCMenuItemSpriteExtra::create(
v26,
nullptr,
v55,
(cocos2d::SEL_MenuHandler)(unsigned __int64)GJLevelScoreCell::onViewProfile);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v12 + 440LL))(v12, v48);
v51 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getContentSize)(v26);
v52 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getScale)(v26);
v29 = ((__int64 (__fastcall *)(SimplePlayer *))v2->getPosition)(v2);
sub_10028CBE0(&m_userName, 30.0, 0.0);
sub_10028CCE0(v47, v29);
v50 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getContentSize)(v26) * 0.5;
v30 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getScale)(v26);
sub_10028CBE0(v53, v30 * v50, 0.0);
sub_10028CCE0(&v54, v47);
*(cocos2d::CCPoint *)&v57 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&m_userName, v12);
v31 = v55;
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, double))v48->setPosition)(v48, &m_userName, v57);
if ( GJUserScore::isCurrentUser(v31->m_userScore) )
{
m_backgroundLayer = v31->m_backgroundLayer;
m_userName.__r_.__value_.__s.__data_[1] = 10;
*(_WORD *)&m_userName.__r_.__value_.__l.0 = -26906;
((void (__fastcall *)(cocos2d::CCLayerColor *, std::string *))m_backgroundLayer->setColor)(
m_backgroundLayer,
&m_userName);
}
v33 = v31->m_userScore;
*(_WORD *)&m_userName.__r_.__value_.__l.0 = 0;
if ( v33->m_levelMode == 1 )
{
if ( v33->m_leaderboardMode )
GameToolbox::pointsToString(&v54);
else
GameToolbox::msToTimeString(&v54);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_userName.__r_.__value_.__l.__data_);
m_userName = v54;
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_35;
LABEL_30:
v36 = m_userName.__r_.__value_.__l.__data_;
goto LABEL_36;
}
v34 = (cocos2d::CCString *)sub_1007AB580("%i%%", v47[0]);
v35 = cocos2d::CCString::getCString(v34);
std::string::assign(&m_userName, v35);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_30;
LABEL_35:
v36 = m_userName.__r_.__value_.__s.__data_;
LABEL_36:
v37 = cocos2d::CCLabelBMFont::create_3(v36, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))v55->m_mainLayer->addChild_0)(
v55->m_mainLayer,
v37,
2);
if ( v55->m_userScore->m_levelMode == 1 )
{
sub_10028CBE0(&v54, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v37->setAnchorPoint)(v37, &v54);
cocos2d::CCLabelBMFont::limitLabelWidth(v37, 85.0, 0.5, 0.0);
*(_QWORD *)&v38 = LODWORD(v55->m_width);
*(float *)&v38 = *(float *)&v38 + -60.0;
sub_10028CBE0(&v54, *(float *)&v38, v55->m_height * 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v37->setPosition)(v37, &v54);
}
else
{
sub_10028CBE0(&v54, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v37->setAnchorPoint)(v37, &v54);
cocos2d::CCLabelBMFont::limitLabelWidth(v37, 200.0, 0.60000002, 0.0);
*(_QWORD *)&v38 = LODWORD(v51);
*(float *)&v38 = (float)(v51 * v52) + 6.0;
sub_10028CBE0(v53, *(float *)&v38, -1.0);
sub_10028CCE0(&v54, v47);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v37->setPosition)(v37, &v54);
m_secretCoins = v55->m_userScore->m_secretCoins;
if ( m_secretCoins > 0 )
{
v40 = 65;
do
{
v41 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v55->m_mainLayer->addChild)(
v55->m_mainLayer,
v41);
((void (__fastcall *)(cocos2d::CCSprite *, float))v41->setScale)(v41, 0.89999998);
v42 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v37->getPosition)(v37);
HIDWORD(v38) = 0;
*(float *)&v38 = (float)v40;
sub_10028CBE0(v53, (float)v40, 5.0);
sub_10028CCE0(&v54, v42);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v41->setPosition)(v41, &v54);
v40 += 8;
--m_secretCoins;
}
while ( m_secretCoins );
}
}
v43 = (std::string *)v55->m_userScore;
if ( (*(_BYTE *)&v43[29].__r_.__value_.__s.0 & 1) != 0 )
sub_100006B70(&v54, v43[29].__r_.__value_.__l.__data_, v43[29].__r_.__value_.__l.__size_, v38);
else
v54 = v43[29];
v44 = (cocos2d::CCString *)sub_1007AB580("%s ago", v47[0]);
v45 = cocos2d::CCString::getCString(v44);
v46 = cocos2d::CCLabelBMFont::create_3(v45, "chatFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))v55->m_mainLayer->addChild_0)(
v55->m_mainLayer,
v46,
1);
sub_10028CBE0(v53, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v46->setAnchorPoint)(v46, v53);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v46->setScale)(v46, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v46->setColor)(v46, &unk_100818050);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v46->setOpacity)(v46, 125);
sub_10028CBE0(v53, v55->m_width + -11.0, 10.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v46->setPosition)(v46, v53);
if ( v55->m_userScore->m_levelMode == 1 )
cocos2d::CCLabelBMFont::limitLabelWidth(v46, 35.0, 0.5, 0.0);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&m_userName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_userName.__r_.__value_.__l.__data_);
}