//
// LevelInfoLayer::updateLabelValues from 0x1000294a4 to 0x100029dfc (2392 bytes)
//
// 3 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x1000277d4
// > LevelInfoLayer::levelDownloadFinished @ 0x100029edc
// > LevelInfoLayer::likedItem @ 0x10002acd4
//
// 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 LevelInfoLayer::updateLabelValues(LevelInfoLayer *a1)
{
__int64 v1; // x20
void **v3; // x1
std::string *v4; // x1
cocos2d::CCLabelBMFont *m_lengthLabel; // x20
std::string *v6; // x1
cocos2d::CCLabelBMFont *m_downloadsLabel; // x20
std::string *v8; // x1
cocos2d::CCLabelBMFont *m_orbsLabel; // x20
GameStatsManager *v10; // x0
int AwardedCurrencyForLevel; // w21
GameStatsManager *v12; // x0
int BaseCurrencyForLevel; // w0
cocos2d::CCString *v14; // x0
const char *CString; // x0
int v16; // w20
cocos2d::CCLabelBMFont *m_likesLabel; // x21
std::string *v18; // x1
cocos2d::CCSprite *m_likesIcon; // x21
cocos2d::CCSpriteFrameCache *v20; // x0
const char *v21; // x1
cocos2d::CCSpriteFrame *v22; // x0
GameManager *v23; // x0
GameManager *v24; // x0
GameManager *v25; // x0
GameManager *v26; // x0
GameManager *v27; // x0
GameManager *v28; // x0
GameManager *v29; // x0
int AverageDifficulty; // w20
GJGameLevel *m_level; // x8
int v32; // w1
cocos2d::CCLabelBMFont *m_starsLabel; // x20
cocos2d::CCString *v34; // x0
const char *v35; // x0
GameStatsManager *v36; // x0
cocos2d::CCLabelBMFont *v37; // x0
GJGameLevel *v38; // x8
int random; // w21
int seed; // w22
float v41; // s9
cocos2d::CCLabelBMFont *v42; // x20
__n128 v43; // q0
__n128 v44; // q1
cocos2d::CCSprite *m_starsIcon; // x20
__n128 v46; // q0
__n128 v47; // q1
int v48; // w20
bool v49; // w8
bool v50; // w8
float v51; // s8
__int64 v52; // x20
__int64 v53; // x21
float32x2_t *v54; // x22
__n128 v55; // q0
__n128 v56; // q1
double v57; // d0
__int64 v58; // x20
__int64 v59; // x0
GJGameLevel *v60; // x0
int m_coins; // w8
float v62; // w9
int v63; // w20
int v64; // w25
float v65; // s8
float v66; // s9
float v67; // s0
char *CoinKey; // x0
GameStatsManager *v69; // x0
std::string *v70; // x1
_BOOL4 hasPendingUserCoin; // w23
GameStatsManager *v72; // x0
std::string *v73; // x1
cocos2d::CCSprite *v74; // x22
__n128 v75; // q0
__n128 v76; // q1
double v77; // d0
int v78; // w8
float32x2_t v79; // [xsp+10h] [xbp-C0h] BYREF
float32x2_t v80; // [xsp+18h] [xbp-B8h] BYREF
void *__p[2]; // [xsp+20h] [xbp-B0h] BYREF
char v82; // [xsp+37h] [xbp-99h]
std::string v83; // [xsp+38h] [xbp-98h] BYREF
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_exactLengthLabel->setVisible)(a1->m_exactLengthLabel, 0);
if ( GJGameLevel::isPlatformer(a1->m_level) )
{
LODWORD(v1) = vcvtms_s32_f32((float)a1->m_level->m_timestamp / 240.0);
sub_100009900(&v83, "<1min");
if ( (int)v1 < 61 )
{
if ( !(_DWORD)v1 )
std::string::assign(&v83, "Dur.");
}
else
{
GameToolbox::getTimeString(__p, v1, 1);
if ( v82 >= 0 )
v3 = __p;
else
v3 = (void **)__p[0];
std::string::assign(&v83, (const std::string::value_type *)v3);
if ( v82 < 0 )
operator delete(__p[0]);
}
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v4 = &v83;
else
v4 = (std::string *)v83.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))a1->m_exactLengthLabel->setString)(
a1->m_exactLengthLabel,
v4);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))a1->m_exactLengthLabel->setVisible)(
a1->m_exactLengthLabel,
1);
if ( SHIBYTE(v83.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v83.__r_.__value_.__l.__data_);
}
m_lengthLabel = a1->m_lengthLabel;
GJGameLevel::lengthKeyToString(&v83, (unsigned int)a1->m_level->m_levelLength);
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v6 = &v83;
else
v6 = (std::string *)v83.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))m_lengthLabel->setString)(m_lengthLabel, v6);
if ( SHIBYTE(v83.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v83.__r_.__value_.__l.__data_);
m_downloadsLabel = a1->m_downloadsLabel;
GameToolbox::pointsToString(&v83);
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v8 = &v83;
else
v8 = (std::string *)v83.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))m_downloadsLabel->setString)(m_downloadsLabel, v8);
if ( SHIBYTE(v83.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v83.__r_.__value_.__l.__data_);
m_orbsLabel = a1->m_orbsLabel;
v10 = GameStatsManager::sharedState();
AwardedCurrencyForLevel = GameStatsManager::getAwardedCurrencyForLevel(v10, a1->m_level);
v12 = GameStatsManager::sharedState();
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(v12, a1->m_level);
v14 = (cocos2d::CCString *)sub_100268F4C(
"%i/%i",
AwardedCurrencyForLevel,
(int)(float)((float)BaseCurrencyForLevel * 1.25));
CString = cocos2d::CCString::getCString(v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_orbsLabel->setString)(m_orbsLabel, CString);
v16 = a1->m_level->m_likes - a1->m_level->m_dislikes;
m_likesLabel = a1->m_likesLabel;
GameToolbox::pointsToString(&v83);
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v18 = &v83;
else
v18 = (std::string *)v83.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))m_likesLabel->setString)(m_likesLabel, v18);
if ( SHIBYTE(v83.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v83.__r_.__value_.__l.__data_);
m_likesIcon = a1->m_likesIcon;
v20 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( v16 < 0 )
v21 = "GJ_dislikesIcon_001.png";
else
v21 = "GJ_likesIcon_001.png";
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v20, v21);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_likesIcon->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 >= 50 )
{
v24 = GameManager::sharedState();
GameManager::reportAchievementWithID(v24, "geometry.ach.creator03", 100, 0);
if ( (unsigned int)v16 >= 0x64 )
{
v25 = GameManager::sharedState();
GameManager::reportAchievementWithID(v25, "geometry.ach.creator01", 100, 0);
if ( (unsigned int)v16 >= 0xFA )
{
v26 = GameManager::sharedState();
GameManager::reportAchievementWithID(v26, "geometry.ach.creator04", 100, 0);
if ( (unsigned int)v16 >= 0x1F4 )
{
v27 = GameManager::sharedState();
GameManager::reportAchievementWithID(v27, "geometry.ach.creator05", 100, 0);
if ( (unsigned int)v16 >= 0x3E8 )
{
v28 = GameManager::sharedState();
GameManager::reportAchievementWithID(v28, "geometry.ach.creator06", 100, 0);
}
}
}
}
}
if ( a1->m_level->m_stars.random > a1->m_level->m_stars.seed )
{
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);
sub_1000229B8((__int64 *)__p, (__int64 *)&a1->m_basePosition);
m_level = a1->m_level;
if ( m_level->m_demon.random - m_level->m_demon.seed == 1 )
{
AverageDifficulty = GJGameLevel::demonIconForDifficulty((DemonDifficultyType)m_level->m_demonDifficulty);
*((float *)__p + 1) = *((float *)__p + 1) + 5.0;
m_level = a1->m_level;
}
if ( m_level->m_autoLevel )
v32 = -1;
else
v32 = AverageDifficulty;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v32, Long);
((void (__fastcall *)(GJDifficultySprite *, void **))a1->m_difficultySprite->setPosition)(a1->m_difficultySprite, __p);
GJDifficultySprite::updateFeatureStateFromLevel(a1->m_difficultySprite, a1->m_level);
m_starsLabel = a1->m_starsLabel;
v34 = (cocos2d::CCString *)sub_100268F4C("%i", a1->m_level->m_stars.random - a1->m_level->m_stars.seed);
v35 = cocos2d::CCString::getCString(v34);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_starsLabel->setString)(m_starsLabel, v35);
v36 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedStarLevel(v36, a1->m_level) )
{
v37 = a1->m_starsLabel;
v83.__r_.__value_.__s.__data_[2] = 50;
LOWORD(v83.__r_.__value_.__l.__data_) = -1;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v37->setColor)(v37, &v83);
}
v38 = a1->m_level;
random = v38->m_stars.random;
seed = v38->m_stars.seed;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))a1->m_starsLabel->setVisible)(a1->m_starsLabel, random > seed);
((void (__fastcall *)(cocos2d::CCSprite *, bool))a1->m_starsIcon->setVisible)(a1->m_starsIcon, random > seed);
if ( a1->m_level->m_demon.random - a1->m_level->m_demon.seed == 1 )
v41 = -4.0;
else
v41 = 0.0;
v42 = a1->m_starsLabel;
v43.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v42->getPosition)(v42);
v44.n128_f32[0] = v41 + a1->m_baseStarsY;
sub_100022980(v43, v44, &v83);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v42->setPosition)(v42, &v83);
m_starsIcon = a1->m_starsIcon;
v46.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCSprite *))m_starsIcon->getPosition)(m_starsIcon);
v47.n128_f32[0] = v41 + a1->m_baseStarsY;
sub_100022980(v46, v47, &v83);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))m_starsIcon->setPosition)(m_starsIcon, &v83);
v48 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel);
v49 = random > seed && !a1->m_challenge;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))a1->m_orbsLabel->setVisible)(a1->m_orbsLabel, v49);
v50 = random > seed && !a1->m_challenge;
((void (__fastcall *)(cocos2d::CCSprite *, bool))a1->m_orbsIcon->setVisible)(a1->m_orbsIcon, v50);
if ( v48 != ((unsigned int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel) )
{
v51 = ((unsigned int (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel)
? a1->m_iconOffset
: -a1->m_iconOffset;
if ( (unsigned int)sub_10024A36C(a1->m_icons) )
{
v52 = 0;
do
{
v53 = sub_10024A388(a1->m_icons, v52);
v54 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v53 + 192LL))(v53);
v55.n128_u32[0] = 0;
v56.n128_f32[0] = v51;
sub_100022980(v55, v56, &v80);
*(float32x2_t *)&v57 = sub_1000229DC(v54, &v80, (float32x2_t *)&v83);
(*(void (__fastcall **)(__int64, std::string *, double))(*(_QWORD *)v53 + 184LL))(v53, &v83, v57);
v52 = (unsigned int)(v52 + 1);
}
while ( (unsigned int)v52 < (unsigned int)sub_10024A36C(a1->m_icons) );
}
}
if ( (unsigned int)sub_10024A36C(a1->m_coins) )
{
v58 = 0;
do
{
v59 = sub_10024A388(a1->m_coins, v58);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v59 + 504LL))(v59);
v58 = (unsigned int)(v58 + 1);
}
while ( (unsigned int)v58 < (unsigned int)sub_10024A36C(a1->m_coins) );
}
sub_10024A45C(a1->m_coins);
v60 = a1->m_level;
m_coins = v60->m_coins;
if ( m_coins > 0 )
{
if ( v60->m_stars.random <= v60->m_stars.seed )
{
v62 = -31.5;
}
else if ( v60->m_dailyID.random > v60->m_dailyID.seed || v60->m_gauntletLevel )
{
v62 = -60.0;
}
else
{
v62 = -45.5;
}
v63 = 0;
v64 = v60->m_coinsVerified.random - v60->m_coinsVerified.seed;
v65 = v41 + v62;
do
{
if ( v63 == 2 )
{
v66 = 10.0;
}
else if ( v63 == 1 )
{
if ( m_coins == 2 )
v66 = 5.0;
else
v66 = 0.0;
}
else
{
if ( (unsigned int)m_coins <= 2 )
v67 = 0.0;
else
v67 = -10.0;
if ( m_coins == 2 )
v66 = -5.0;
else
v66 = v67;
}
CoinKey = (char *)GJGameLevel::getCoinKey(v60, ++v63);
sub_100009900(&v83, CoinKey);
v69 = GameStatsManager::sharedState();
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v70 = &v83;
else
v70 = (std::string *)v83.__r_.__value_.__r.__words[0];
if ( GameStatsManager::hasUserCoin(v69, (const char *)v70) )
{
hasPendingUserCoin = 1;
}
else
{
v72 = GameStatsManager::sharedState();
if ( (v83.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v73 = &v83;
else
v73 = (std::string *)v83.__r_.__value_.__r.__words[0];
hasPendingUserCoin = GameStatsManager::hasPendingUserCoin(v72, (const char *)v73);
}
v74 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
v75 = ((__n128 (__fastcall *)(LevelInfoLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v74);
v75.n128_f32[0] = v66;
v76.n128_f32[0] = v65;
sub_100022980(v75, v76, &v79);
*(float32x2_t *)&v77 = sub_1000229DC((float32x2_t *)&a1->m_basePosition, &v79, &v80);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, double))v74->setPosition)(v74, &v80, v77);
sub_10024A2D0(a1->m_coins, v74);
if ( v64 == 1 )
{
if ( !hasPendingUserCoin )
{
v80.i8[2] = -91;
v80.i16[0] = -23131;
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v74->setColor)(v74, &v80);
}
}
else
{
v78 = 4960255;
if ( !hasPendingUserCoin )
v78 = 3174821;
v80.i16[0] = v78;
v80.i8[2] = BYTE2(v78);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v74->setColor)(v74, &v80);
}
if ( SHIBYTE(v83.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v83.__r_.__value_.__l.__data_);
if ( (unsigned int)(v63 - 1) > 1 )
break;
v60 = a1->m_level;
m_coins = v60->m_coins;
}
while ( v63 < m_coins );
}
}