//
// LevelListLayer::updateStatsArt from 0x58fc10 to 0x5905f2 (2530 bytes)
//
// 5 xrefs:
// > LevelListLayer::iconSelectClosed @ 0x590630
// > LevelListLayer::loadLevelsFinished @ 0x5906c0
// > LevelListLayer::init @ 0x591808
// > LevelListLayer::likedItem @ 0x591c0c
// > LevelListLayer::onEnter @ 0x5939d8
//
// 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 LevelListLayer::updateStatsArt(LevelListLayer *a1)
{
cocos2d::CCArray *m_objects; // r3
cocos2d::CCSprite *m_diffSprite; // r6
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r7
cocos2d::CCSpriteFrameCache *v5; // r8
cocos2d::CCSpriteFrame *v6; // r0
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r6
cocos2d::CCObject **v9; // r5
int v10; // r0
int v11; // t1
cocos2d::CCDirector *v12; // r0
int v13; // r0
const char *v14; // r1
GJLevelList *m_levelList; // r3
int m_levelsToClaim; // r6
_BOOL4 hasClaimedListReward; // r9
int v18; // r10
GameStatsManager *v19; // r0
cocos2d::CCNode *v20; // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const char *v22; // r1
float *v23; // r11
void (__fastcall *v24)(float *, cocos2d::CCRect *); // r3
char v25; // r2
float v26; // s16
void (__fastcall *v27)(float *, cocos2d::CCRect *); // r8
void (__fastcall *v28)(float *, cocos2d::CCRect *); // r8
float v29; // s15
float v30; // s15
void (__fastcall *v31)(float *, cocos2d::CCRect *); // r8
float v32; // s14
float v33; // s15
float v34; // r3
cocos2d::CCString *v35; // r0
cocos2d::CCLabelBMFont *v36; // r8
int v37; // r11
float v38; // s16
cocos2d::CCSprite *v39; // r5
void (__fastcall *v40)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCLabelBMFont *v41; // r11
const char *v42; // r0
cocos2d::CCSprite *v43; // r8
int v44; // r0
float v45; // s15
int v46; // r11
cocos2d::CCLabelBMFont *v47; // r11
cocos2d::CCSprite *v48; // r11
void (__fastcall *v49)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v50; // r7
cocos2d::CCSprite *v51; // r9
void (__fastcall *v52)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r7
int v53; // r8
int v54; // r0
cocos2d::CCString *v55; // r0
cocos2d::CCLabelBMFont *v56; // r7
void (__fastcall *v57)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v58; // r10
cocos2d::CCNode *v59; // r8
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r7
cocos2d::CCNode *v61; // r7
void (__fastcall *v62)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
float width; // s16
int v64; // r0
CCSpriteGrayscale *v65; // r10
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r2
CCMenuItemSpriteExtra *v67; // r5
int v68; // r11
int v69; // r2
bool v70; // r3
void (__fastcall *v71)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCSprite *v72; // r8
void (__fastcall *v73)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
int v74; // r10
cocos2d::CCLabelBMFont *v75; // r10
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
void (__fastcall *v77)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
int v78; // r8
cocos2d::CCArray *v79; // r0
cocos2d::CCObject *v80; // r1
cocos2d::CCSprite *v81; // r7
void (__fastcall *v82)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v83; // r8
cocos2d::CCLabelBMFont *v84; // r8
void (__fastcall *v85)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v86; // r7
char *v87; // [sp+8h] [bp-44h]
void (__fastcall *v88)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-40h]
int v89; // [sp+Ch] [bp-40h]
void (__fastcall *v90)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-40h]
int v91; // [sp+Ch] [bp-40h]
void (__fastcall *v92)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-38h]
void (__fastcall *v93)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-38h]
_BYTE v94[4]; // [sp+18h] [bp-34h] BYREF
cocos2d::CCSize v95; // [sp+1Ch] [bp-30h] BYREF
cocos2d::CCPoint v96; // [sp+24h] [bp-28h] BYREF
cocos2d::CCPoint v97; // [sp+2Ch] [bp-20h] BYREF
cocos2d::CCRect v98; // [sp+34h] [bp-18h] BYREF
a1->m_exited = 0;
m_objects = a1->m_objects;
if ( m_objects )
{
data = m_objects->data;
if ( data->num )
{
arr = data->arr;
v9 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v9 )
{
v11 = (int)*arr++;
v10 = v11;
if ( !v11 )
break;
(*(void (__fastcall **)(int))(*(_DWORD *)v10 + 260))(v10);
}
}
}
cocos2d::CCArray::removeAllObjects(a1->m_objects);
m_diffSprite = a1->m_diffSprite;
setDisplayFrame = m_diffSprite->setDisplayFrame;
v5 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
GJLevelList::frameForListDifficulty((int)&v98, (const char *)a1->m_levelList->m_difficulty, 2);
v6 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v5, (const char *)LODWORD(v98.origin.x));
setDisplayFrame(m_diffSprite, v6);
sub_774008(&v98);
a1->m_featureSprite->setVisible(a1->m_featureSprite, a1->m_levelList->m_featured);
v12 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v95, v12);
v87 = (char *)GJLevelList::completedLevels(a1->m_levelList);
v13 = GJLevelList::totalLevels(a1->m_levelList);
m_levelList = a1->m_levelList;
m_levelsToClaim = v13;
if ( m_levelList->m_diamonds > 0 && m_levelList->m_levelsToClaim > 0 )
{
v19 = GameStatsManager::sharedState();
hasClaimedListReward = GameStatsManager::hasClaimedListReward(v19, a1->m_levelList);
if ( !hasClaimedListReward )
m_levelsToClaim = a1->m_levelList->m_levelsToClaim;
v18 = 1;
}
else
{
hasClaimedListReward = 0;
v18 = 0;
}
v94[0] = 0;
v94[1] = 0;
v94[2] = 0;
v20 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v14);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v20->__vftable[1].getTag)(v20, v94);
((void (__fastcall *)(cocos2d::CCNode *, int))v20->__vftable[1].~CCNode_0)(v20, 125);
((void (__fastcall *)(cocos2d::CCNode *, int))v20->setScaleY)(v20, 1061997773);
((void (__fastcall *)(cocos2d::CCNode *, int))v20->setScaleX)(v20, 1061997773);
a1->addChild_0(a1, v20, 3);
cocos2d::CCArray::addObject(a1->m_objects, v20);
setPosition = v20->setPosition;
cocos2d::CCPoint::CCPoint(&v98.origin, v95.width * 0.5, 16.0);
setPosition(v20, &v98.origin);
v23 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v22);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v23 + 64))(v23, 1065017672);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v23 + 72))(v23, 1061326684);
v24 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v23 + 472);
if ( !v18 || hasClaimedListReward )
{
LOWORD(v98.origin.x) = -16816;
v25 = -1;
}
else
{
LOWORD(v98.origin.x) = 21759;
v25 = 50;
}
BYTE2(v98.origin.x) = v25;
v24(v23, &v98);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v23 + 448))(v23, 225);
v26 = v23[86] - (float)(v23[86] * 0.98);
v20->addChild_0(v20, (cocos2d::CCNode *)v23, 1);
v27 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v23 + 140);
cocos2d::CCPoint::CCPoint(&v98.origin, 0.0, 0.5);
v27(v23, &v98);
v28 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v23 + 92);
v29 = v20->getContentSize(v20)->height * 0.5;
cocos2d::CCPoint::CCPoint(&v98.origin, v26 * 0.5, v29);
v28(v23, &v98);
if ( m_levelsToClaim <= 0 )
v30 = 0.0;
else
v30 = *(float *)&m_levelsToClaim;
v31 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v23 + 560);
if ( m_levelsToClaim > 0 )
v30 = (float)(int)v87 / (float)SLODWORD(v30);
v32 = v23[86];
v33 = v32 * v30;
if ( v32 > v33 )
v34 = v33;
else
v34 = v23[86];
cocos2d::CCRect::CCRect(&v98, 0.0, 0.0, v34, v23[87]);
v31(v23, &v98);
v35 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i/%i", v87, m_levelsToClaim);
cocos2d::CCString::getCString(v35);
v36 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v36, 4);
cocos2d::CCArray::addObject(a1->m_objects, v36);
v88 = v36->setPosition;
v37 = (int)v20->getPosition(v20);
cocos2d::CCPoint::CCPoint(&v97, 0.0, 1.0);
cocos2d::CCPoint::operator+(&v98, v37, &v97);
v88(v36, &v98.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v36->setScale)(v36, 1056964608);
if ( a1->m_levelList->m_listType != Editor )
{
if ( v18 )
{
v38 = 52.0;
if ( !hasClaimedListReward )
v38 = 45.0;
}
else
{
v38 = 52.0;
}
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_downloadsIcon_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v39->setScale)(v39, 1061997773);
v40 = v39->setPosition;
cocos2d::CCPoint::CCPoint(&v98.origin, 26.0, (float)(v95.height * 0.5) + 88.0);
v40(v39, &v98.origin);
a1->addChild_0(a1, v39, 1);
cocos2d::CCArray::addObject(a1->m_objects, v39);
GameToolbox::intToShortString((GameToolbox *)&v98, a1->m_levelList->m_downloads);
v41 = cocos2d::CCLabelBMFont::create();
sub_774008(&v98);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v41->setScale)(v41, 1053609165);
v92 = v41->setPosition;
v89 = (int)v39->getPosition(v39);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -21.0);
cocos2d::CCPoint::operator+(&v98, v89, &v97);
v92(v41, &v98.origin);
a1->addChild_0(a1, v41, 1);
cocos2d::CCArray::addObject(a1->m_objects, v41);
if ( a1->m_levelList->m_likes >= 0 )
v42 = "GJ_likesIcon_001.png";
else
v42 = "GJ_dislikesIcon_001.png";
v43 = cocos2d::CCSprite::createWithSpriteFrameName(v42);
((void (__fastcall *)(cocos2d::CCSprite *, int))v43->setScale)(v43, 1061997773);
v90 = v43->setPosition;
v44 = (int)v39->getPosition(v39);
v45 = 4.0;
if ( a1->m_levelList->m_likes >= 0 )
v45 = 0.0;
v46 = v44;
cocos2d::CCPoint::CCPoint(&v97, 0.0, v45 - v38);
cocos2d::CCPoint::operator+(&v98, v46, &v97);
v90(v43, &v98.origin);
a1->addChild_0(a1, v43, 1);
cocos2d::CCArray::addObject(a1->m_objects, v43);
GameToolbox::intToShortString((GameToolbox *)&v98, a1->m_levelList->m_likes);
v47 = cocos2d::CCLabelBMFont::create();
sub_774008(&v98);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v47->setScale)(v47, 1053609165);
v93 = v47->setPosition;
v91 = (int)v43->getPosition(v43);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -21.0);
cocos2d::CCPoint::operator+(&v98, v91, &v97);
v93(v47, &v98.origin);
a1->addChild_0(a1, v47, 1);
cocos2d::CCArray::addObject(a1->m_objects, v47);
if ( v18 )
{
if ( hasClaimedListReward )
{
v81 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_diamondsIcon_001.png");
a1->addChild(a1, v81);
cocos2d::CCArray::addObject(a1->m_objects, v81);
v82 = v81->setPosition;
v83 = (int)v43->getPosition(v43);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -v38);
cocos2d::CCPoint::operator+(&v98, v83, &v97);
v82(v81, &v98.origin);
((void (__fastcall *)(cocos2d::CCSprite *, int))v81->setScale)(v81, 1063675494);
GameToolbox::intToShortString((GameToolbox *)&v98, a1->m_levelList->m_diamonds);
v84 = cocos2d::CCLabelBMFont::create();
sub_774008(&v98);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v84->setScale)(v84, 1053609165);
v85 = v84->setPosition;
v86 = (int)v81->getPosition(v81);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -21.0);
cocos2d::CCPoint::operator+(&v98, v86, &v97);
v85(v84, &v98.origin);
a1->addChild_0(a1, v84, 1);
v79 = a1->m_objects;
v80 = v84;
}
else
{
v48 = cocos2d::CCSprite::createWithSpriteFrameName("diamond_small01_001.png");
a1->addChild_0(a1, v48, 10);
cocos2d::CCArray::addObject(a1->m_objects, v48);
v49 = v48->setPosition;
v50 = (int)v20->getPosition(v20);
cocos2d::CCPoint::CCPoint(&v97, 125.0, 0.0);
cocos2d::CCPoint::operator+(&v98, v50, &v97);
v49(v48, &v98.origin);
v51 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png");
a1->addChild(a1, v51);
cocos2d::CCArray::addObject(a1->m_objects, v51);
v52 = v51->setPosition;
v53 = (int)v43->getPosition(v43);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -v38);
cocos2d::CCPoint::operator+(&v98, v53, &v97);
v52(v51, &v98.origin);
((void (__fastcall *)(cocos2d::CCSprite *, int))v51->setScale)(v51, 1061997773);
v54 = GJLevelList::totalLevels(a1->m_levelList);
v55 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i/%i", v87, v54);
cocos2d::CCString::getCString(v55);
v56 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v56);
cocos2d::CCArray::addObject(a1->m_objects, v56);
v57 = v56->setPosition;
v58 = (int)v51->getPosition(v51);
cocos2d::CCPoint::CCPoint(&v97, 0.0, -21.0);
cocos2d::CCPoint::operator+(&v98, v58, &v97);
v57(v56, &v98.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v56->setScale)(v56, 1053609165);
v59 = cocos2d::CCNode::create();
setContentSize = v59->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v98, 50.0, 50.0);
setContentSize(v59, (const cocos2d::CCSize *)&v98);
v61 = cocos2d::CCNode::create();
v61->setContentSize(v61, &stru_AC7EF8);
v59->addChild(v59, v61);
v62 = v61->setPosition;
width = v59->getContentSize(v59)->width;
v64 = (int)v59->getContentSize(v59);
cocos2d::CCPoint::CCPoint(&v98.origin, width * 0.5, *(float *)(v64 + 4) * 0.5);
v62(v61, &v98.origin);
if ( (int)v87 < a1->m_levelList->m_levelsToClaim )
{
sub_776584((int)&v98, "GJ_rewardBtn_001.png");
v65 = CCSpriteGrayscale::createWithSpriteFrameName((const char **)&v98);
sub_774008(&v98);
CCSpriteWithHue::setEvenLuminance(v65, 1.0);
setColor = v65->setColor;
LOWORD(v98.origin.x) = -20561;
BYTE2(v98.origin.x) = -81;
setColor(v65, (const cocos2d::ccColor3B *)&v98);
}
else
{
v65 = (CCSpriteGrayscale *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_rewardBtn_001.png");
}
((void (__fastcall *)(CCSpriteGrayscale *, int))v65->setScale)(v65, 1058642330);
v61->addChild(v61, v65);
LODWORD(v98.origin.x) = LevelListLayer::onClaimReward;
v98.origin.y = 0.0;
v67 = CCMenuItemSpriteExtra::create(
v59,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onClaimReward, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v67);
v68 = (int)v51->getPosition(v51);
cocos2d::CCPoint::CCPoint(&v96, 0.0, -54.0);
cocos2d::CCPoint::operator+(&v97, v68, &v96);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_rewardPosition, COERCE_FLOAT(&v97), v69, v70);
v71 = v67->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v97, a1->m_buttonMenu, &a1->m_rewardPosition);
v71(v67, &v97);
v72 = cocos2d::CCSprite::createWithSpriteFrameName("diamond_small01_001.png");
v61->addChild(v61, v72);
v73 = v72->setPosition;
v74 = (int)v65->getPosition(v65);
cocos2d::CCPoint::CCPoint(&v96, 8.0, -25.0);
cocos2d::CCPoint::operator+(&v97, v74, &v96);
v73(v72, &v97);
GameToolbox::intToString((GameToolbox *)&v97, a1->m_levelList->m_diamonds);
v75 = cocos2d::CCLabelBMFont::create();
sub_774008(&v97);
v61->addChild(v61, v75);
setAnchorPoint = v75->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v97, 1.0, 0.5);
setAnchorPoint(v75, &v97);
v77 = v75->setPosition;
v78 = (int)v72->getPosition(v72);
cocos2d::CCPoint::CCPoint(&v96, -8.0, 0.0);
cocos2d::CCPoint::operator+(&v97, v78, &v96);
v77(v75, &v97);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v75->setScale)(v75, 1053609165);
v79 = a1->m_objects;
v80 = v67;
}
cocos2d::CCArray::addObject(v79, v80);
}
}
}