//
// GJRequestCell::loadFromScore from 0x339124 to 0x3396a2 (1406 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x33bd4c
//
// 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 GJRequestCell::loadFromScore(GJRequestCell *a1, GJUserScore *a2)
{
GJUserScore *m_score; // r0
float v5; // s16
IconType m_iconType; // r3
SimplePlayer *v7; // r6
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r7
void (__fastcall *setColor)(SimplePlayer *__hidden, const cocos2d::ccColor3B *); // r7
GameManager *v10; // r0
int v11; // r0
GameManager *v12; // r0
int v13; // r0
GJUserScore *v14; // r3
int m_iconID; // r1
char v16; // r2
cocos2d::CCMenuItem *v17; // r1
cocos2d::CCNode *v18; // r7
int v19; // r8
GJUserScore *v20; // r8
cocos2d::CCLabelBMFont *v21; // r8
int v22; // r6
float width; // s18
float v24; // r0
CCMenuItemSpriteExtra *v25; // r11
void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
ButtonSprite *v27; // r0
ButtonSprite *v28; // r9
CCMenuItemSpriteExtra *v29; // r11
float m_width; // s18
float *v31; // r0
ButtonSprite *v32; // r11
cocos2d::CCLabelBMFont *m_label; // r3
CCMenuItemSpriteExtra *v34; // r11
cocos2d::CCSprite *v35; // r5
cocos2d::CCSprite *v36; // r11
CCMenuItemToggler *v37; // r0
bool m_toggled; // r1
CCMenuItemToggler *m_toggler; // r10
void (__fastcall *v40)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r6
cocos2d::CCLabelBMFont *v41; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
void (__fastcall *v43)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r4
float v44; // s16
float v45; // r0
float v46; // [sp+10h] [bp-5Ch]
int v47; // [sp+10h] [bp-5Ch]
void (__fastcall *v48)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+18h] [bp-54h]
void (__fastcall *v49)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+18h] [bp-54h]
void (__fastcall *v50)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+18h] [bp-54h]
int v51; // [sp+20h] [bp-4Ch]
cocos2d::CCLabelBMFont *v52; // [sp+24h] [bp-48h]
cocos2d::CCPoint v53; // [sp+2Ch] [bp-40h] BYREF
cocos2d::CCPoint v54; // [sp+34h] [bp-38h] BYREF
cocos2d::CCPoint v55; // [sp+3Ch] [bp-30h] BYREF
void (*v56)(GJRequestCell *, cocos2d::CCObject *); // [sp+44h] [bp-28h]
int v57; // [sp+48h] [bp-24h]
void (*v58)(GJRequestCell *, cocos2d::CCObject *); // [sp+4Ch] [bp-20h]
int v59; // [sp+50h] [bp-1Ch]
cocos2d::CCPoint v60; // [sp+54h] [bp-18h] BYREF
cocos2d::CCPoint v61; // [sp+5Ch] [bp-10h] BYREF
cocos2d::SEL_MenuHandler v62; // 0:r3.4,4:^0.4
a1->m_mainLayer->removeAllChildrenWithCleanup(a1->m_mainLayer, 1);
if ( a2 )
{
cocos2d::CCObject::retain(a2);
m_score = a1->m_score;
if ( m_score )
cocos2d::CCObject::release(m_score);
v5 = 1.0;
m_iconType = a2->m_iconType;
a1->m_score = a2;
if ( m_iconType == Ship )
v5 = 0.9;
v7 = SimplePlayer::create((int)&dword_0 + 1);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v7, 1);
((void (__fastcall *)(SimplePlayer *, _DWORD))v7->setScale)(v7, v5 * 0.9);
setPosition = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v61, 60.0, a1->m_height * 0.5);
setPosition(v7, &v61);
setColor = v7->setColor;
v10 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v11 = GameManager::colorForIdx(v10, a1->m_score->m_color1);
LOWORD(v61.x) = v11;
BYTE2(v61.x) = BYTE2(v11);
setColor(v7, (const cocos2d::ccColor3B *)&v61);
v12 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v13 = GameManager::colorForIdx(v12, a1->m_score->m_color2);
LOWORD(v61.x) = v13;
BYTE2(v61.x) = BYTE2(v13);
SimplePlayer::setSecondColor(v7, (const cocos2d::ccColor3B *)&v61);
SimplePlayer::tryEnableCustomGlowColor(v7, a1->m_score->m_color3);
v14 = a1->m_score;
m_iconID = v14->m_iconID;
v16 = v14->m_special == 2 || v14->m_glowEnabled;
v7->m_hasGlowOutline = v16;
SimplePlayer::updatePlayerFrame(v7, m_iconID, v14->m_iconType);
SimplePlayer::updateColors(v7);
v18 = (cocos2d::CCNode *)cocos2d::CCMenu::create(nullptr, v17);
a1->m_mainLayer->addChild(a1->m_mainLayer, v18);
sub_775C20(&v61, &a1->m_score->m_userName);
v19 = *(_DWORD *)(LODWORD(v61.x) - 12);
sub_774008(&v61);
if ( !v19 )
{
v20 = a1->m_score;
sub_776584((int)&v61, "-");
sub_775D40(&v20->m_userName, &v61);
sub_774008(&v61);
}
sub_775C20(&v61, &a1->m_score->m_userName);
v21 = cocos2d::CCLabelBMFont::create();
sub_774008(&v61);
cocos2d::CCLabelBMFont::limitLabelWidth(v21, 120.0, 0.8, 0.0);
v22 = (int)v7->getPosition(v7);
width = v21->getContentSize(v21)->width;
v24 = v21->getScale(v21);
cocos2d::CCPoint::CCPoint(&v61, (float)((float)(width * 0.5) * v24) + 25.0, 0.0);
cocos2d::CCPoint::operator+(&v53, v22, &v61);
v57 = 0;
v56 = GJRequestCell::onViewProfile;
v25 = CCMenuItemSpriteExtra::create(
v21,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJRequestCell::onViewProfile, (unsigned int)a1));
v18->addChild(v18, v25);
v26 = v25->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v61, v18, &v53);
v26(v25, &v61);
v27 = ButtonSprite::create(
(ButtonSprite *)"View",
(const char *)&word_32,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(25.0),
COERCE_FLOAT(&v53));
v59 = 0;
v58 = GJRequestCell::onViewFriendRequest;
v28 = v27;
v29 = CCMenuItemSpriteExtra::create(
v27,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJRequestCell::onViewFriendRequest, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v29, 1.5);
v18->addChild(v18, v29);
m_width = a1->m_width;
v48 = v29->setPosition;
v31 = (float *)v28->getContentSize(v28);
cocos2d::CCPoint::CCPoint(&v60, (float)(m_width - (float)(*v31 * 0.5)) - 45.0, a1->m_height * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v61, v18, &v60);
v48(v29, &v61);
v32 = ButtonSprite::create(
(ButtonSprite *)"X",
(const char *)&word_32,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_06.png",
(const char *)0x41FA0000,
v46);
((void (__fastcall *)(ButtonSprite *, int))v32->setScale)(v32, 1061997773);
m_label = v32->m_label;
v52 = m_label;
v49 = m_label->setPosition;
v51 = (int)m_label->getPosition(m_label);
cocos2d::CCPoint::CCPoint(&v60, 1.5, -0.5);
cocos2d::CCPoint::operator+(&v61, v51, &v60);
v49(v52, &v61);
v60.y = 0.0;
LODWORD(v60.x) = GJRequestCell::onDeleteRequest;
v34 = CCMenuItemSpriteExtra::create(
v32,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJRequestCell::onDeleteRequest, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v34, 1.5);
v18->addChild(v18, v34);
v50 = v34->setPosition;
cocos2d::CCPoint::CCPoint(&v55, a1->m_width - 22.0, a1->m_height * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v61, v18, &v55);
v50(v34, &v61);
v35 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v36 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v35->setScale)(v35, 1060320051);
((void (__fastcall *)(cocos2d::CCSprite *, int))v36->setScale)(v36, 1060320051);
v62.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJRequestCell::onToggle;
v62.adj = 0;
v61.y = 0.0;
LODWORD(v61.x) = GJRequestCell::onToggle;
v37 = CCMenuItemToggler::create(v36, v35, a1, v62);
m_toggled = a1->m_score->m_toggled;
a1->m_toggler = v37;
CCMenuItemToggler::toggle(v37, m_toggled);
v18->addChild(v18, a1->m_toggler);
m_toggler = a1->m_toggler;
v40 = m_toggler->setPosition;
cocos2d::CCPoint::CCPoint(&v54, 20.0, a1->m_height * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v55, v18, &v54);
v40(m_toggler, &v55);
CCMenuItemToggler::setSizeMult(a1->m_toggler, 1.2);
if ( a1->m_score->m_newFriendRequest )
{
v41 = cocos2d::CCLabelBMFont::create();
v41->setColor(v41, (const cocos2d::ccColor3B *)&unk_9AA442);
v41->setScale(v41, 0.5);
setAnchorPoint = v41->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v55, 0.0, 0.5);
setAnchorPoint(v41, &v55);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v41, 10);
v41->setTag(v41, 100);
v43 = v41->setPosition;
v44 = v21->getContentSize(v21)->width;
v45 = v21->getScale(v21);
cocos2d::CCPoint::CCPoint(&v54, (float)((float)(v44 * 0.5) * v45) + 5.0, 0.0);
cocos2d::CCPoint::operator+(&v55, v47, &v54);
v43(v41, &v55);
}
}
}