//
// LevelInfoLayer::updateLabelValues from 0x6d997c to 0x6da5bc (3136 bytes)
//
// 5 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x6db008
// > LevelInfoLayer::levelDownloadFinished @ 0x6dd9f0
// > LevelInfoLayer::incrementLikes @ 0x6ddccc
// > LevelInfoLayer::incrementDislikes @ 0x6ddce0
// > ??> @ 0xbe6e0
//
// 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)
{
cocos2d::CCLabelBMFont *m_lengthLabel; // x19
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x20
char *v4; // x0
cocos2d::CCLabelBMFont *m_downloadsLabel; // x19
void (__fastcall *v6)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x20
char *v7; // x0
cocos2d::CCLabelBMFont *m_orbsLabel; // x19
void (__fastcall *v9)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x20
GameStatsManager *v10; // x0
unsigned int AwardedCurrencyForLevel; // w23
GameStatsManager *v12; // x0
int BaseCurrencyForLevel; // w0
cocos2d::CCString *v14; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *m_likesLabel; // x20
void (__fastcall *v17)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x23
int v18; // w19
char *v19; // x0
cocos2d::CCSprite *m_likesIcon; // x20
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // x23
cocos2d::CCSpriteFrameCache *v22; // x0
cocos2d::CCSpriteFrame *v23; // x0
GameManager *v24; // x0
GJGameLevel *m_level; // x2
int AverageDifficulty; // w20
GJGameLevel *v27; // x0
int v28; // w1
cocos2d::CCLabelBMFont *m_starsLabel; // x19
void (__fastcall *v30)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x20
cocos2d::CCString *v31; // x0
const char *v32; // x0
GameStatsManager *v33; // x0
_BOOL4 v34; // w19
float v35; // s9
cocos2d::CCLabelBMFont *v36; // x20
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float *v38; // x0
cocos2d::CCSprite *m_starsIcon; // x20
void (__fastcall *v40)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x23
float *v41; // x0
_BOOL4 v42; // w20
void (__fastcall *setVisible)(cocos2d::CCNode *__hidden, bool); // x2
void (*v44)(void); // x2
bool v45; // w0
float m_iconOffset; // s8
unsigned int v47; // w19
unsigned int v48; // w1
__int64 v49; // x20
void (__fastcall *v50)(__int64, char **); // x24
__int64 v51; // x25
unsigned int i; // w19
unsigned int v53; // w1
__int64 v54; // x0
bool v55; // cf
cocos2d::CCArray *m_coins; // x0
GJGameLevel *v57; // x0
int v58; // w20
float v59; // s10
int v60; // w19
float v61; // s8
char *CoinKey; // x0
GameStatsManager *v63; // x0
GameStatsManager *v64; // x0
_BOOL4 hasPendingUserCoin; // w26
cocos2d::CCSprite *v66; // x20
void (__fastcall *v67)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
void (__fastcall *v68)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x2
const char *v69; // x1
char *v70; // x0
int v71; // w19
unsigned __int8 *v72; // x0
unsigned int *v73; // x3
int v74; // w2
void (__fastcall *v75)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x3
unsigned int *v76; // x1
int v77; // w2
cocos2d::CCLabelBMFont *v78; // x0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
GameManager *v80; // x0
size_t v81; // x0
char *v82; // x0
unsigned int *v83; // x3
int v84; // w1
unsigned int *v85; // x1
int v86; // w2
unsigned int *v87; // x1
int v88; // w2
unsigned int *v89; // x1
int v90; // w2
GameManager *v91; // x0
GameManager *v92; // x0
GameManager *v93; // x0
GameManager *v94; // x0
GameManager *v95; // x0
int v96; // [xsp+88h] [xbp+88h]
char *v97; // [xsp+88h] [xbp+88h]
cocos2d::CCPoint v98; // [xsp+98h] [xbp+98h] BYREF
const char *v99; // [xsp+A0h] [xbp+A0h] BYREF
const unsigned __int8 *v100; // [xsp+A8h] [xbp+A8h] BYREF
char *v101; // [xsp+B0h] [xbp+B0h] BYREF
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, 0);
if ( GJGameLevel::isPlatformer(a1->m_level) )
{
v71 = vcvtms_s32_f32((float)a1->m_level->m_timestamp / 240.0);
sub_D153B8((int)&v100, "<1min");
if ( v71 > 60 )
{
GameToolbox::getTimeString((GameToolbox *)(unsigned int)v71, (_BYTE *)&dword_0 + 1, (__int64)&v101);
v97 = v101;
v81 = strlen(v101);
sub_D1798C(&v100, v97, v81);
v82 = v101 - 24;
if ( v101 - 24 != (char *)&qword_124B6B0 )
{
v83 = (unsigned int *)(v101 - 8);
if ( &pthread_create )
{
do
v84 = __ldaxr(v83);
while ( __stlxr(v84 - 1, v83) );
}
else
{
v84 = *((_DWORD *)v101 - 2);
*((_DWORD *)v101 - 2) = v84 - 1;
}
if ( v84 <= 0 )
operator delete(v82);
}
}
else if ( !v71 )
{
sub_D1798C(&v100, "Dur.", 4);
}
a1->m_exactLengthLabel->setString(a1->m_exactLengthLabel, v100);
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, 1);
v72 = (unsigned __int8 *)(v100 - 24);
if ( v100 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
v73 = (unsigned int *)(v100 - 8);
if ( &pthread_create )
{
do
v74 = __ldaxr(v73);
while ( __stlxr(v74 - 1, v73) );
}
else
{
v74 = *((_DWORD *)v100 - 2);
*((_DWORD *)v100 - 2) = v74 - 1;
}
if ( v74 <= 0 )
operator delete(v72);
}
}
m_lengthLabel = a1->m_lengthLabel;
setString = m_lengthLabel->setString;
GJGameLevel::lengthKeyToString(
(__int64 *)&v101,
(GJGameLevel *)(unsigned int)a1->m_level->m_levelLength,
(int)m_lengthLabel->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
setString(m_lengthLabel, (const unsigned __int8 *)v101);
v4 = v101 - 24;
if ( v101 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v85 = (unsigned int *)(v101 - 8);
do
v86 = __ldaxr(v85);
while ( __stlxr(v86 - 1, v85) );
}
else
{
v86 = *((_DWORD *)v101 - 2);
*((_DWORD *)v101 - 2) = v86 - 1;
}
if ( v86 <= 0 )
operator delete(v4);
}
m_downloadsLabel = a1->m_downloadsLabel;
v6 = m_downloadsLabel->setString;
GameToolbox::pointsToString((GameToolbox *)(unsigned int)a1->m_level->m_downloads, (__int64 *)&v101);
v6(m_downloadsLabel, (const unsigned __int8 *)v101);
v7 = v101 - 24;
if ( v101 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v87 = (unsigned int *)(v101 - 8);
do
v88 = __ldaxr(v87);
while ( __stlxr(v88 - 1, v87) );
}
else
{
v88 = *((_DWORD *)v101 - 2);
*((_DWORD *)v101 - 2) = v88 - 1;
}
if ( v88 <= 0 )
operator delete(v7);
}
m_orbsLabel = a1->m_orbsLabel;
v9 = m_orbsLabel->setString;
v10 = GameStatsManager::sharedState();
AwardedCurrencyForLevel = GameStatsManager::getAwardedCurrencyForLevel(v10, a1->m_level);
v12 = GameStatsManager::sharedState();
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(v12, a1->m_level);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
(const char *)AwardedCurrencyForLevel,
(unsigned int)(int)(float)((float)BaseCurrencyForLevel * 1.25));
CString = cocos2d::CCString::getCString(v14);
v9(m_orbsLabel, (const unsigned __int8 *)CString);
m_likesLabel = a1->m_likesLabel;
v17 = m_likesLabel->setString;
v18 = a1->m_level->m_likes - a1->m_level->m_dislikes;
GameToolbox::pointsToString((GameToolbox *)(unsigned int)v18, (__int64 *)&v101);
v17(m_likesLabel, (const unsigned __int8 *)v101);
v19 = v101 - 24;
if ( v101 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v89 = (unsigned int *)(v101 - 8);
do
v90 = __ldaxr(v89);
while ( __stlxr(v90 - 1, v89) );
}
else
{
v90 = *((_DWORD *)v101 - 2);
*((_DWORD *)v101 - 2) = v90 - 1;
}
if ( v90 <= 0 )
operator delete(v19);
}
m_likesIcon = a1->m_likesIcon;
setDisplayFrame = m_likesIcon->setDisplayFrame;
v22 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( v18 < 0 )
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v22, "GJ_dislikesIcon_001.png");
else
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v22, "GJ_likesIcon_001.png");
setDisplayFrame(m_likesIcon, v23);
v24 = GameManager::sharedState();
m_level = a1->m_level;
if ( v24->m_playerUserID.random - v24->m_playerUserID.seed == m_level->m_userID.random - m_level->m_userID.seed )
{
if ( v18 > 49 )
{
v91 = GameManager::sharedState();
GameManager::reportAchievementWithID(v91, "geometry.ach.creator03", 100, 0);
if ( v18 > 99 )
{
v92 = GameManager::sharedState();
GameManager::reportAchievementWithID(v92, "geometry.ach.creator01", 100, 0);
if ( v18 > 249 )
{
v93 = GameManager::sharedState();
GameManager::reportAchievementWithID(v93, "geometry.ach.creator04", 100, 0);
if ( v18 > 499 )
{
v94 = GameManager::sharedState();
GameManager::reportAchievementWithID(v94, "geometry.ach.creator05", 100, 0);
if ( v18 > 999 )
{
v95 = GameManager::sharedState();
GameManager::reportAchievementWithID(v95, "geometry.ach.creator06", 100, 0);
}
}
}
}
m_level = a1->m_level;
}
if ( m_level->m_stars.random - m_level->m_stars.seed > 0 )
{
v80 = GameManager::sharedState();
GameManager::reportAchievementWithID(v80, "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(&v98, &a1->m_basePosition);
v27 = a1->m_level;
if ( v27->m_demon.random - v27->m_demon.seed == 1 )
{
AverageDifficulty = GJGameLevel::demonIconForDifficulty((DemonDifficultyType)v27->m_demonDifficulty);
v27 = a1->m_level;
v98.y = v98.y + 5.0;
}
if ( v27->m_autoLevel )
v28 = -1;
else
v28 = AverageDifficulty;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v28, Long);
a1->m_difficultySprite->setPosition(a1->m_difficultySprite, &v98);
GJDifficultySprite::updateFeatureStateFromLevel(a1->m_difficultySprite, a1->m_level);
m_starsLabel = a1->m_starsLabel;
v30 = m_starsLabel->setString;
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(a1->m_level->m_stars.random - a1->m_level->m_stars.seed));
v32 = cocos2d::CCString::getCString(v31);
v30(m_starsLabel, (const unsigned __int8 *)v32);
v33 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedStarLevel(v33, a1->m_level) )
{
v78 = a1->m_starsLabel;
setColor = v78->setColor;
LOWORD(v101) = -1;
BYTE2(v101) = 50;
setColor(v78, (const cocos2d::ccColor3B *)&v101);
}
v34 = a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0;
a1->m_starsLabel->setVisible(a1->m_starsLabel, a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0);
a1->m_starsIcon->setVisible(a1->m_starsIcon, v34);
if ( a1->m_level->m_demon.random - a1->m_level->m_demon.seed == 1 )
v35 = -4.0;
else
v35 = 0.0;
v36 = a1->m_starsLabel;
setPosition = v36->setPosition;
v38 = (float *)v36->getPosition(v36);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v101, *v38, v35 + a1->m_baseStarsY);
setPosition(v36, (const cocos2d::CCPoint *)&v101);
m_starsIcon = a1->m_starsIcon;
v40 = m_starsIcon->setPosition;
v41 = (float *)m_starsIcon->getPosition(m_starsIcon);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v101, *v41, v35 + a1->m_baseStarsY);
v40(m_starsIcon, (const cocos2d::CCPoint *)&v101);
v42 = a1->m_orbsLabel->isVisible(a1->m_orbsLabel);
setVisible = a1->m_orbsLabel->setVisible;
if ( v34 )
{
if ( a1->m_challenge )
setVisible(a1->m_orbsLabel, 0);
else
setVisible(a1->m_orbsLabel, 1);
v44 = (void (*)(void))a1->m_orbsIcon->setVisible;
}
else
{
setVisible(a1->m_orbsLabel, 0);
v44 = (void (*)(void))a1->m_orbsIcon->setVisible;
}
v44();
if ( v42 != a1->m_orbsLabel->isVisible(a1->m_orbsLabel) )
{
v45 = a1->m_orbsLabel->isVisible(a1->m_orbsLabel);
m_iconOffset = a1->m_iconOffset;
if ( !v45 )
m_iconOffset = -m_iconOffset;
v47 = 0;
while ( v47 < (unsigned int)cocos2d::CCArray::count(a1->m_icons) )
{
v48 = v47++;
v49 = cocos2d::CCArray::objectAtIndex(a1->m_icons, v48);
v50 = *(void (__fastcall **)(__int64, char **))(*(_QWORD *)v49 + 184LL);
v51 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v49 + 192LL))(v49);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, 0.0, m_iconOffset);
cocos2d::CCPoint::operator+(&v101, v51, &v100);
v50(v49, &v101);
}
}
for ( i = 0; ; ++i )
{
v55 = i >= (unsigned int)cocos2d::CCArray::count(a1->m_coins);
m_coins = a1->m_coins;
if ( v55 )
break;
v53 = i;
v54 = cocos2d::CCArray::objectAtIndex(m_coins, v53);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v54 + 504LL))(v54);
}
cocos2d::CCArray::removeAllObjects(m_coins);
v57 = a1->m_level;
v58 = v57->m_coins;
if ( v58 > 0 )
{
if ( v57->m_stars.random - v57->m_stars.seed <= 0 )
{
v59 = -31.5;
}
else if ( v57->m_dailyID.random - v57->m_dailyID.seed > 0 || v57->m_gauntletLevel )
{
v59 = -60.0;
}
else
{
v59 = -45.5;
}
v60 = 0;
v96 = v57->m_coinsVerified.random - v57->m_coinsVerified.seed;
do
{
if ( v60 == 1 )
{
if ( v58 != 2 )
{
LABEL_38:
v61 = 0.0;
goto LABEL_39;
}
v61 = 5.0;
}
else if ( v60 == 2 )
{
v61 = 10.0;
}
else
{
if ( v60 )
goto LABEL_38;
if ( v58 == 2 )
{
v61 = -5.0;
}
else
{
v61 = 0.0;
if ( v58 > 2 )
v61 = -10.0;
}
}
LABEL_39:
CoinKey = (char *)GJGameLevel::getCoinKey(v57, ++v60);
sub_D153B8((int)&v99, CoinKey);
v63 = GameStatsManager::sharedState();
if ( GameStatsManager::hasUserCoin(v63, v99) )
{
hasPendingUserCoin = 1;
}
else
{
v64 = GameStatsManager::sharedState();
hasPendingUserCoin = GameStatsManager::hasPendingUserCoin(v64, v99);
}
v66 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
a1->addChild(a1, v66);
v67 = v66->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v61, v59 + v35);
cocos2d::CCPoint::operator+(&v101, &a1->m_basePosition, &v100);
v67(v66, (const cocos2d::CCPoint *)&v101);
cocos2d::CCArray::addObject(a1->m_coins, v66);
if ( v96 != 1 )
{
v68 = v66->setColor;
if ( hasPendingUserCoin )
{
LOWORD(v101) = -20481;
BYTE2(v101) = 75;
}
else
{
LOWORD(v101) = 29093;
BYTE2(v101) = 48;
}
v68(v66, (const cocos2d::ccColor3B *)&v101);
LABEL_45:
v69 = v99;
v70 = (char *)(v99 - 24);
if ( v99 - 24 != (const char *)&qword_124B6B0 )
goto LABEL_65;
goto LABEL_46;
}
if ( hasPendingUserCoin )
goto LABEL_45;
v75 = v66->setColor;
LOWORD(v101) = -23131;
BYTE2(v101) = -91;
v75(v66, (const cocos2d::ccColor3B *)&v101);
v69 = v99;
v70 = (char *)(v99 - 24);
if ( v99 - 24 != (const char *)&qword_124B6B0 )
{
LABEL_65:
if ( &pthread_create )
{
v76 = (unsigned int *)(v69 - 8);
do
v77 = __ldaxr(v76);
while ( __stlxr(v77 - 1, v76) );
}
else
{
v77 = *((_DWORD *)v69 - 2);
*((_DWORD *)v69 - 2) = v77 - 1;
}
if ( v77 <= 0 )
operator delete(v70);
}
LABEL_46:
v57 = a1->m_level;
v58 = v57->m_coins;
}
while ( v58 > v60 && v60 <= 2 );
}
}