//
// GJUserCell::loadFromScore from 0x1001098cc to 0x10010a01c (1872 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x100100fd4
//
// 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; // x0
int m_friendReqStatus; // w25
char m_glowEnabled; // w21
SimplePlayer *v7; // x23
__n128 v8; // q0
__n128 v9; // q1
GameManager *v10; // x0
GameManager *v11; // x0
GJUserScore *v12; // x8
cocos2d::CCNode *v13; // x21
GJUserScore *v14; // x8
void *v15; // x22
GJUserScore *v16; // x22
GJUserScore *v17; // x8
void **v18; // x0
cocos2d::CCLabelBMFont *v19; // x22
float32x2_t *v20; // x23
float v21; // s9
__n128 v22; // q0
__n128 v23; // q1
CCMenuItemSpriteExtra *v24; // x23
ButtonSprite *v25; // x23
CCMenuItemSpriteExtra *v26; // x24
float v27; // s8
__n128 v28; // q0
__n128 v29; // q1
ButtonSprite *v30; // x23
float m_width; // s9
cocos2d::CCSprite *v32; // x20
CCMenuItemSpriteExtra *v33; // x20
__n128 v34; // q0
__n128 v35; // q1
cocos2d::CCSprite *v36; // x20
CCMenuItemSpriteExtra *v37; // x20
__n128 v38; // q0
__n128 v39; // q1
cocos2d::CCLabelBMFont *v40; // x20
__n128 v41; // q0
__n128 v42; // q1
float v43; // s8
__n128 v44; // q0
__n128 v45; // q1
double v46; // d0
float32x2_t v47; // [xsp+8h] [xbp-98h] BYREF
float32x2_t v48; // [xsp+10h] [xbp-90h] BYREF
std::string __str; // [xsp+18h] [xbp-88h] BYREF
void *__p[2]; // [xsp+30h] [xbp-70h] BYREF
char *longStorage; // [xsp+40h] [xbp-60h]
cocos2d::CCPoint v52; // 0:kr00_8.8
cocos2d::CCPoint v53; // 0:kr08_8.8
cocos2d::CCPoint v54; // 0:kr10_8.8
cocos2d::CCPoint v55; // 0:kr18_8.8
cocos2d::SEL_MenuHandler v56; // 0:x3.16
cocos2d::SEL_MenuHandler v57; // 0:x3.16
cocos2d::SEL_MenuHandler v58; // 0:x3.16
cocos2d::SEL_MenuHandler v59; // 0:x3.16
cocos2d::SEL_MenuHandler v60; // 0:x3.16
((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);
m_friendReqStatus = a2->m_friendReqStatus;
m_glowEnabled = 1;
v7 = SimplePlayer::create(1);
((void (__fastcall *)(cocos2d::CCLayer *, SimplePlayer *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v7,
1);
v8 = ((__n128 (__fastcall *)(SimplePlayer *, float))v7->setScale)(v7, 1.0);
v9.n128_f32[0] = a1->m_height * 0.5;
v8.n128_u32[0] = 30.0;
sub_100022980(v8, v9, __p);
((void (__fastcall *)(SimplePlayer *, void **))v7->setPosition)(v7, __p);
v10 = GameManager::sharedState();
*(cocos2d::ccColor3B *)__p = GameManager::colorForIdx(v10, a1->m_userScore->m_color1);
((void (__fastcall *)(SimplePlayer *, void **))v7->setColor)(v7, __p);
v11 = GameManager::sharedState();
*(cocos2d::ccColor3B *)__p = GameManager::colorForIdx(v11, a1->m_userScore->m_color2);
SimplePlayer::setSecondColor(v7, (const cocos2d::ccColor3B *)__p);
SimplePlayer::tryEnableCustomGlowColor(v7, a1->m_userScore->m_color3);
v12 = a1->m_userScore;
if ( v12->m_special != 2 )
m_glowEnabled = v12->m_glowEnabled;
v7->m_hasGlowOutline = m_glowEnabled & 1;
SimplePlayer::updatePlayerFrame(v7, v12->m_iconID, v12->m_iconType);
SimplePlayer::updateColors(v7);
v13 = (cocos2d::CCNode *)sub_1001D7ED0(0);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCNode *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v13);
v14 = a1->m_userScore;
if ( v14->m_userName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v14->m_userName.m_data.m_long.capacitym1, v14->m_userName.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v14->m_userName.m_data.m_short.sizex2;
longStorage = v14->m_userName.m_data.m_long.longStorage;
}
if ( SHIBYTE(longStorage) < 0 )
{
v15 = __p[1];
operator delete(__p[0]);
if ( v15 )
goto LABEL_15;
}
else if ( HIBYTE(longStorage) )
{
goto LABEL_15;
}
v16 = a1->m_userScore;
sub_100009900(&__str, "-");
std::string::operator=((std::string *)&v16->m_userName, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
LABEL_15:
v17 = a1->m_userScore;
if ( v17->m_userName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v17->m_userName.m_data.m_long.capacitym1, v17->m_userName.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v17->m_userName.m_data.m_short.sizex2;
longStorage = v17->m_userName.m_data.m_long.longStorage;
}
if ( SHIBYTE(longStorage) >= 0 )
v18 = __p;
else
v18 = (void **)__p[0];
v19 = cocos2d::CCLabelBMFont::create_1((const char *)v18, "bigFont.fnt");
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
cocos2d::CCLabelBMFont::limitLabelWidth(v19, 150.0, 0.8, 0.0);
v20 = (float32x2_t *)((__int64 (__fastcall *)(SimplePlayer *))v7->getPosition)(v7);
v21 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v19->getContentSize)(v19) * 0.5;
v22.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v19->getScale)(v19);
v22.n128_f32[0] = (float)(v21 * v22.n128_f32[0]) + 35.0;
v23.n128_u32[0] = 0;
sub_100022980(v22, v23, &v48);
sub_1000229DC(v20, &v48, (float32x2_t *)__p);
v56.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJUserCell::onViewProfile;
v56.adj = 0;
v24 = CCMenuItemSpriteExtra::create(v19, nullptr, a1, v56);
((void (__fastcall *)(cocos2d::CCNode *, CCMenuItemSpriteExtra *))v13->addChild)(v13, v24);
v52 = cocos2d::CCNode::convertToNodeSpace(v13, (const cocos2d::CCPoint *)__p);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v24->setPosition)(
v24,
&v48,
v52.x,
v52.y);
if ( m_friendReqStatus == 4 )
{
v30 = ButtonSprite::create_1("Cancel", 50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_05.png", 28.0);
v58.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJUserCell::onCancelFriendRequest;
v58.adj = 0;
v26 = CCMenuItemSpriteExtra::create(v30, nullptr, a1, v58);
CCMenuItemSpriteExtra::setSizeMult(v26, 1.5);
((void (__fastcall *)(cocos2d::CCNode *, CCMenuItemSpriteExtra *))v13->addChild)(v13, v26);
m_width = a1->m_width;
v28.n128_f32[0] = (float)(m_width
- (float)(*(float *)((__int64 (__fastcall *)(ButtonSprite *))v30->getContentSize)(v30)
* 0.5))
+ -9.0;
v29.n128_f32[0] = a1->m_height * 0.5;
}
else
{
if ( m_friendReqStatus != 2 )
{
LABEL_28:
if ( a2->m_friendReqStatus == 1 )
{
if ( a2->m_messageState != 2 )
{
v32 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_messages_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v32->setScale)(v32, 0.7);
v59.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJUserCell::onSendMessage;
v59.adj = 0;
v33 = CCMenuItemSpriteExtra::create(v32, nullptr, a1, v59);
CCMenuItemSpriteExtra::setSizeMult(v33, 1.2);
v34 = ((__n128 (__fastcall *)(cocos2d::CCNode *, CCMenuItemSpriteExtra *))v13->addChild)(v13, v33);
v34.n128_f32[0] = a1->m_width + -60.0;
v35.n128_f32[0] = a1->m_height * 0.5;
sub_100022980(v34, v35, &v47);
v54 = cocos2d::CCNode::convertToNodeSpace(v13, (const cocos2d::CCPoint *)&v47);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v33->setPosition)(
v33,
&v48,
v54.x,
v54.y);
}
v36 = cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_removeFriend_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v36->setScale)(v36, 0.7);
v60.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJUserCell::onRemoveFriend;
v60.adj = 0;
v37 = CCMenuItemSpriteExtra::create(v36, nullptr, a1, v60);
CCMenuItemSpriteExtra::setSizeMult(v37, 1.2);
v38 = ((__n128 (__fastcall *)(cocos2d::CCNode *, CCMenuItemSpriteExtra *))v13->addChild)(v13, v37);
v38.n128_f32[0] = a1->m_width + -24.0;
v39.n128_f32[0] = a1->m_height * 0.5;
sub_100022980(v38, v39, &v47);
v55 = cocos2d::CCNode::convertToNodeSpace(v13, (const cocos2d::CCPoint *)&v47);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v37->setPosition)(
v37,
&v48,
v55.x,
v55.y);
}
if ( a1->m_userScore->m_newFriendRequest && m_friendReqStatus != 2 && m_friendReqStatus != 4 )
{
v40 = cocos2d::CCLabelBMFont::create_1("New!", "goldFont.fnt");
v41 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v40->setScale)(v40, 0.5);
v41.n128_u32[0] = 0;
v42.n128_u32[0] = 0.5;
sub_100022980(v41, v42, &v48);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v40->setAnchorPoint)(v40, &v48);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v40,
10);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v40->setTag)(v40, 100);
v43 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v19->getContentSize)(v19) * 0.5;
v44.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v19->getScale)(v19);
v44.n128_f32[0] = (float)(v43 * v44.n128_f32[0]) + 10.0;
v45.n128_u32[0] = 0;
sub_100022980(v44, v45, &v47);
*(float32x2_t *)&v46 = sub_1000229DC((float32x2_t *)__p, &v47, &v48);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v40->setPosition)(v40, &v48, v46);
}
return;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v24->setEnabled)(v24, 0);
v25 = ButtonSprite::create_1("Unblock", 50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_05.png", 28.0);
v57.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJUserCell::onUnblockUser;
v57.adj = 0;
v26 = CCMenuItemSpriteExtra::create(v25, nullptr, a1, v57);
CCMenuItemSpriteExtra::setSizeMult(v26, 1.5);
((void (__fastcall *)(cocos2d::CCNode *, CCMenuItemSpriteExtra *))v13->addChild)(v13, v26);
v27 = a1->m_width;
v28.n128_f32[0] = (float)(v27
- (float)(*(float *)((__int64 (__fastcall *)(ButtonSprite *))v25->getContentSize)(v25)
* 0.5))
+ -9.0;
v29.n128_f32[0] = a1->m_height * 0.5;
}
sub_100022980(v28, v29, &v47);
v53 = cocos2d::CCNode::convertToNodeSpace(v13, (const cocos2d::CCPoint *)&v47);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v26->setPosition)(
v26,
&v48,
v53.x,
v53.y);
goto LABEL_28;
}
}