//
// LevelInfoLayer::updateLabelValues from 0x3b2c54 to 0x3b3368 (1812 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x3b3b66
// > LevelInfoLayer::levelDownloadFinished @ 0x3b57d8
// > LevelInfoLayer::incrementLikes @ 0x3b5906
// > LevelInfoLayer::incrementDislikes @ 0x3b5918
//
// 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 LevelInfoLayer::updateLabelValues(LevelInfoLayer *a1)
{
int v2; // s15
cocos2d::CCLabelBMFont *m_lengthLabel; // r6
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r7
cocos2d::CCLabelBMFont *m_downloadsLabel; // r6
void (__fastcall *v6)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r7
cocos2d::CCLabelBMFont *m_orbsLabel; // r6
void (__fastcall *v8)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r7
GameStatsManager *v9; // r0
const char *AwardedCurrencyForLevel; // r8
GameStatsManager *v11; // r0
int BaseCurrencyForLevel; // r0
cocos2d::CCString *v13; // r0
const char *CString; // r0
cocos2d::CCLabelBMFont *m_likesLabel; // r7
signed int v16; // r6
void (__fastcall *v17)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r8
cocos2d::CCSprite *m_likesIcon; // r7
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r8
cocos2d::CCSpriteFrameCache *v20; // r0
const char *v21; // r1
cocos2d::CCSpriteFrame *v22; // r0
GameManager *v23; // r0
GameManager *v24; // r0
GameManager *v25; // r0
GameManager *v26; // r0
GameManager *v27; // r0
GameManager *v28; // r0
GameManager *v29; // r0
int AverageDifficulty; // r7
GJGameLevel *m_level; // r3
int v32; // r0
int v33; // r1
cocos2d::CCLabelBMFont *m_starsLabel; // r6
void (__fastcall *v35)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r7
cocos2d::CCString *v36; // r0
const char *v37; // r0
GameStatsManager *v38; // r0
cocos2d::CCLabelBMFont *v39; // r0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
float v41; // s18
_BOOL4 v42; // r6
cocos2d::CCLabelBMFont *v43; // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float *v45; // r0
cocos2d::CCSprite *m_starsIcon; // r7
void (__fastcall *v47)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
float *v48; // r0
int v49; // r7
_BOOL4 v50; // r1
_BOOL4 v51; // r1
unsigned int i; // r6
int v53; // r0
float m_iconOffset; // s16
unsigned int v55; // r6
int v56; // r0
int v57; // r8
void (__fastcall *v58)(int, cocos2d::CCPoint *); // r9
int v59; // r10
bool v60; // cf
cocos2d::CCArray *m_coins; // r0
unsigned int v62; // r1
int v63; // r0
GJGameLevel *v64; // r6
float v65; // s17
int random; // r2
int seed; // r3
int v68; // r6
GJGameLevel *v69; // r0
int v70; // r3
float v71; // s16
char *CoinKey; // r0
GameStatsManager *v73; // r0
GameStatsManager *v74; // r0
_BOOL4 hasPendingUserCoin; // r9
cocos2d::CCSprite *v76; // r7
void (__fastcall *v77)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r3
char v78; // r2
void (__fastcall *v79)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r2
void (__fastcall *v80)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+0h] [bp-34h]
int v81; // [sp+4h] [bp-30h]
char *v82; // [sp+10h] [bp-24h] BYREF
cocos2d::CCPoint v83; // [sp+14h] [bp-20h] BYREF
cocos2d::CCPoint v84; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v85; // [sp+24h] [bp-10h] BYREF
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, 0);
if ( GJGameLevel::isPlatformer(a1->m_level) )
{
v2 = (int)floorf((float)a1->m_level->m_timestamp / 240.0);
sub_776584((int)&v84, "<1min");
if ( v2 <= 60 )
{
if ( !v2 )
sub_7753D4((int)&v84, "Dur.");
}
else
{
GameToolbox::getTimeString((GameToolbox *)&v85, v2, 1);
sub_7753D4((int)&v84, (char *)LODWORD(v85.x));
sub_774008(&v85);
}
a1->m_exactLengthLabel->setString(a1->m_exactLengthLabel, (const unsigned __int8 *)LODWORD(v84.x));
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, 1);
sub_774008(&v84);
}
m_lengthLabel = a1->m_lengthLabel;
setString = m_lengthLabel->setString;
GJGameLevel::lengthKeyToString((GJGameLevel *)&v85, a1->m_level->m_levelLength);
setString(m_lengthLabel, (const unsigned __int8 *)LODWORD(v85.x));
sub_774008(&v85);
m_downloadsLabel = a1->m_downloadsLabel;
v6 = m_downloadsLabel->setString;
GameToolbox::pointsToString((GameToolbox *)&v85, a1->m_level->m_downloads);
v6(m_downloadsLabel, (const unsigned __int8 *)LODWORD(v85.x));
sub_774008(&v85);
m_orbsLabel = a1->m_orbsLabel;
v8 = m_orbsLabel->setString;
v9 = GameStatsManager::sharedState();
AwardedCurrencyForLevel = (const char *)GameStatsManager::getAwardedCurrencyForLevel(v9, a1->m_level);
v11 = GameStatsManager::sharedState();
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(v11, a1->m_level);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
AwardedCurrencyForLevel,
(int)(float)((float)BaseCurrencyForLevel * 1.25));
CString = cocos2d::CCString::getCString(v13);
v8(m_orbsLabel, (const unsigned __int8 *)CString);
m_likesLabel = a1->m_likesLabel;
v16 = a1->m_level->m_likes - a1->m_level->m_dislikes;
v17 = m_likesLabel->setString;
GameToolbox::pointsToString((GameToolbox *)&v85, v16);
v17(m_likesLabel, (const unsigned __int8 *)LODWORD(v85.x));
sub_774008(&v85);
m_likesIcon = a1->m_likesIcon;
setDisplayFrame = m_likesIcon->setDisplayFrame;
v20 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( v16 < 0 )
v21 = "GJ_dislikesIcon_001.png";
else
v21 = "GJ_likesIcon_001.png";
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v20, v21);
setDisplayFrame(m_likesIcon, v22);
v23 = GameManager::sharedState();
if ( v23->m_playerUserID.random - v23->m_playerUserID.seed == a1->m_level->m_userID.random
- a1->m_level->m_userID.seed )
{
if ( v16 > 49 )
{
v24 = GameManager::sharedState();
GameManager::reportAchievementWithID(v24, "geometry.ach.creator03", 100, 0);
if ( v16 > 99 )
{
v25 = GameManager::sharedState();
GameManager::reportAchievementWithID(v25, "geometry.ach.creator01", 100, 0);
if ( v16 > 249 )
{
v26 = GameManager::sharedState();
GameManager::reportAchievementWithID(v26, "geometry.ach.creator04", 100, 0);
if ( v16 >= 500 )
{
v27 = GameManager::sharedState();
GameManager::reportAchievementWithID(v27, "geometry.ach.creator05", 100, 0);
if ( v16 >= 1000 )
{
v28 = GameManager::sharedState();
GameManager::reportAchievementWithID(v28, "geometry.ach.creator06", 100, 0);
}
}
}
}
}
if ( a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0 )
{
v29 = GameManager::sharedState();
GameManager::reportAchievementWithID(v29, "geometry.ach.creator02", 100, 0);
}
}
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_lengthLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_exactLengthLabel, 42.0, 0.35, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_downloadsLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_likesLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_orbsLabel, 60.0, 0.5, 0.0);
AverageDifficulty = GJGameLevel::getAverageDifficulty(a1->m_level);
cocos2d::CCPoint::CCPoint(&v83, &a1->m_basePosition);
m_level = a1->m_level;
if ( m_level->m_demon.random - m_level->m_demon.seed == 1 )
{
v32 = GJGameLevel::demonIconForDifficulty((DemonDifficultyType)m_level->m_demonDifficulty);
v83.y = v83.y + 5.0;
AverageDifficulty = v32;
}
if ( a1->m_level->m_autoLevel )
v33 = -1;
else
v33 = AverageDifficulty;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v33, Long);
a1->m_difficultySprite->setPosition(a1->m_difficultySprite, &v83);
GJDifficultySprite::updateFeatureStateFromLevel(a1->m_difficultySprite, a1->m_level);
m_starsLabel = a1->m_starsLabel;
v35 = m_starsLabel->setString;
v36 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(a1->m_level->m_stars.random - a1->m_level->m_stars.seed));
v37 = cocos2d::CCString::getCString(v36);
v35(m_starsLabel, (const unsigned __int8 *)v37);
v38 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedStarLevel(v38, a1->m_level) )
{
v39 = a1->m_starsLabel;
setColor = v39->setColor;
LOWORD(v85.x) = -1;
BYTE2(v85.x) = 50;
setColor(v39, (const cocos2d::ccColor3B *)&v85);
}
v41 = 0.0;
v42 = a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0;
a1->m_starsLabel->setVisible(a1->m_starsLabel, v42);
a1->m_starsIcon->setVisible(a1->m_starsIcon, v42);
v43 = a1->m_starsLabel;
setPosition = v43->setPosition;
if ( a1->m_level->m_demon.random - a1->m_level->m_demon.seed == 1 )
v41 = -4.0;
v45 = (float *)v43->getPosition(v43);
cocos2d::CCPoint::CCPoint(&v85, *v45, v41 + a1->m_baseStarsY);
setPosition(v43, &v85);
m_starsIcon = a1->m_starsIcon;
v47 = m_starsIcon->setPosition;
v48 = (float *)m_starsIcon->getPosition(m_starsIcon);
cocos2d::CCPoint::CCPoint(&v85, *v48, v41 + a1->m_baseStarsY);
v47(m_starsIcon, &v85);
v49 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel);
v50 = v42 && !a1->m_challenge;
a1->m_orbsLabel->setVisible(a1->m_orbsLabel, v50);
v51 = v42 && !a1->m_challenge;
a1->m_orbsIcon->setVisible(a1->m_orbsIcon, v51);
if ( ((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel) != v49 )
{
v53 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel);
m_iconOffset = a1->m_iconOffset;
if ( !v53 )
m_iconOffset = -m_iconOffset;
v55 = 0;
while ( v55 < cocos2d::CCArray::count(a1->m_icons) )
{
v56 = cocos2d::CCArray::objectAtIndex(a1->m_icons, v55++);
v57 = v56;
v58 = *(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v56 + 92);
v59 = (*(int (__fastcall **)(int))(*(_DWORD *)v56 + 96))(v56);
cocos2d::CCPoint::CCPoint(&v84, 0.0, m_iconOffset);
cocos2d::CCPoint::operator+(&v85, v59, &v84);
v58(v57, &v85);
}
}
for ( i = 0; ; ++i )
{
v60 = i >= cocos2d::CCArray::count(a1->m_coins);
m_coins = a1->m_coins;
if ( v60 )
break;
v62 = i;
v63 = cocos2d::CCArray::objectAtIndex(m_coins, v62);
(*(void (__fastcall **)(int))(*(_DWORD *)v63 + 252))(v63);
}
cocos2d::CCArray::removeAllObjects(m_coins);
v64 = a1->m_level;
if ( v64->m_coins > 0 )
{
if ( v64->m_stars.random - v64->m_stars.seed > 0 )
{
if ( v64->m_dailyID.random - v64->m_dailyID.seed > 0 )
{
v65 = -60.0;
}
else
{
v65 = -60.0;
if ( !v64->m_gauntletLevel )
v65 = -45.5;
}
}
else
{
v65 = -31.5;
}
random = v64->m_coinsVerified.random;
seed = v64->m_coinsVerified.seed;
v68 = 0;
v81 = random - seed;
while ( 1 )
{
v69 = a1->m_level;
v70 = v69->m_coins;
if ( v68 >= v70 || v68 == 3 )
return;
if ( v68 == 1 )
{
v71 = 5.0;
if ( v70 != 2 )
v71 = 0.0;
}
else
{
if ( v68 == 2 )
{
v71 = 10.0;
goto LABEL_62;
}
if ( !v68 )
{
if ( v70 == 2 )
{
v71 = -5.0;
goto LABEL_62;
}
if ( v70 > 2 )
{
v71 = -10.0;
goto LABEL_62;
}
}
v71 = 0.0;
}
LABEL_62:
CoinKey = (char *)GJGameLevel::getCoinKey(v69, ++v68);
sub_776584((int)&v82, CoinKey);
v73 = GameStatsManager::sharedState();
if ( GameStatsManager::hasUserCoin(v73, v82) )
{
hasPendingUserCoin = 1;
}
else
{
v74 = GameStatsManager::sharedState();
hasPendingUserCoin = GameStatsManager::hasPendingUserCoin(v74, v82);
}
v76 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
a1->addChild(a1, v76);
v80 = v76->setPosition;
cocos2d::CCPoint::CCPoint(&v84, v71, v65 + v41);
cocos2d::CCPoint::operator+(&v85, &a1->m_basePosition, &v84);
v80(v76, &v85);
cocos2d::CCArray::addObject(a1->m_coins, v76);
if ( v81 == 1 )
{
if ( !hasPendingUserCoin )
{
v79 = v76->setColor;
LOWORD(v85.x) = -23131;
BYTE2(v85.x) = -91;
v79(v76, (const cocos2d::ccColor3B *)&v85);
}
}
else
{
v77 = v76->setColor;
if ( hasPendingUserCoin )
{
LOWORD(v85.x) = -20481;
v78 = 75;
}
else
{
LOWORD(v85.x) = 29093;
v78 = 48;
}
BYTE2(v85.x) = v78;
v77(v76, (const cocos2d::ccColor3B *)&v85);
}
sub_774008(&v82);
}
}
}