//
// LevelPage::updateDynamicPage from 0x100402430 to 0x100403310 (3808 bytes)
//
// 1 xrefs:
// > LevelSelectLayer::updatePageWithObject @ 0x1004023d8
//
// 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 LevelPage::updateDynamicPage(LevelPage *a1, GJGameLevel *a2)
{
GJGameLevel *m_level; // x0
unsigned int v5; // w21
__int64 v6; // x0
cocos2d::CCDirector *v7; // x0
int v8; // w20
unsigned int v9; // w20
__int64 v10; // x0
unsigned int v11; // w20
__int64 v12; // x0
float m_progressWidth; // s9
int NormalPercent; // w0
float v15; // s8
cocos2d::CCSprite *m_normalProgressBar; // x20
float v17; // s0
float v18; // s2
cocos2d::CCSprite *m_practiceProgressBar; // x20
int v20; // w0
cocos2d::CCString *v21; // x0
const char *CString; // x0
cocos2d::CCString *v23; // x0
const char *v24; // x0
GameStatsManager *v25; // x0
int Stat; // w20
int m_requiredCoins; // w23
cocos2d::CCLabelBMFont *m_nameLabel; // x21
GJGameLevel *v29; // x8
std::string *p_m_levelName; // x8
int v31; // w0
unsigned int v32; // w20
__int64 v33; // x0
cocos2d::CCSprite *v34; // x20
CCMenuItemSpriteExtra *v35; // x0
cocos2d::CCMenu *v36; // x21
__n128 v37; // q0
__n128 v38; // q1
cocos2d::CCSprite *v39; // x21
float v40; // s8
__n128 v41; // q1
__n128 v42; // q0
__n128 v43; // q0
__n128 v44; // q1
cocos2d::CCMoveBy *v45; // x0
cocos2d::CCEaseInOut *v46; // x21
__n128 v47; // q0
__n128 v48; // q1
cocos2d::CCMoveBy *v49; // x0
char v50; // w0
__int64 v51; // x1
__int64 v52; // x2
__int64 v53; // x3
__int64 v54; // x4
__int64 v55; // x5
__int64 v56; // x6
__int64 v57; // x7
cocos2d::CCSequence *v58; // x0
cocos2d::CCRepeatForever *v59; // x0
cocos2d::CCParticleSystemQuad *v60; // x21
float v61; // s8
__int64 v62; // x0
__n128 v63; // q0
__n128 v64; // q1
cocos2d::CCParticleSystemQuad *v65; // x22
float v66; // s8
__int64 v67; // x0
__n128 v68; // q0
__n128 v69; // q1
cocos2d::CCParticleSystemQuad *v70; // x23
float v71; // s8
__int64 v72; // x0
__n128 v73; // q0
__n128 v74; // q1
int v75; // w20
void **v76; // x1
__n128 v77; // q0
cocos2d::CCLabelBMFont *v78; // x21
float *v79; // x0
cocos2d::CCLabelBMFont *v80; // x21
GJDifficulty m_difficulty; // w8
GJDifficulty v82; // w9
int v83; // w8
cocos2d::CCString *v84; // x0
const char *v85; // x21
cocos2d::CCSprite *m_difficultySprite; // x22
cocos2d::CCSpriteFrameCache *v87; // x0
cocos2d::CCSpriteFrame *v88; // x0
cocos2d::CCSprite *v89; // x0
float width; // s8
float v91; // s8
float v92; // s9
__n128 v93; // q0
cocos2d::CCSprite *v94; // x21
__n128 v95; // q1
cocos2d::CCLabelBMFont *v96; // x21
__n128 v97; // q0
__n128 v98; // q1
cocos2d::CCLabelBMFont *m_starsLabel; // x21
cocos2d::CCString *v100; // x0
const char *v101; // x0
GameStatsManager *v102; // x0
_BOOL4 hasCompletedStarLevel; // w8
cocos2d::CCLabelBMFont *v104; // x0
int i; // w21
GameStatsManager *v106; // x22
const char *CoinKey; // x0
_BOOL4 hasSecretCoin; // w23
const char *v109; // x24
unsigned int v110; // w21
__int64 v111; // x22
cocos2d::CCSpriteFrameCache *v112; // x0
cocos2d::CCSpriteFrame *v113; // x0
unsigned int v114; // w21
__int64 v115; // x0
cocos2d::CCSprite *v116; // x21
__n128 v117; // q0
__n128 v118; // q1
cocos2d::CCSprite *v119; // x22
__n128 v120; // q0
__n128 v121; // q1
cocos2d::CCString *v122; // x0
const char *v123; // x0
cocos2d::CCLabelBMFont *v124; // x20
__n128 v125; // q0
__n128 v126; // q1
float32x2_t *v127; // x23
__n128 v128; // q0
__n128 v129; // q1
double v130; // d0
cocos2d::CCArray *m_dynamicObjects; // x0
GameStatsManager *v132; // x0
unsigned int BaseCurrencyForLevel; // w21
GameStatsManager *v134; // x0
int AwardedCurrencyForLevel; // w22
cocos2d::CCSprite *v136; // x20
cocos2d::CCString *v137; // x0
const char *v138; // x0
cocos2d::CCLabelBMFont *v139; // x21
__n128 v140; // q0
__n128 v141; // q1
__n128 v142; // q0
__n128 v143; // q1
float v144; // s8
float v145; // s9
float v146; // s8
__n128 v147; // q1
__n128 v148; // q0
unsigned int v149; // w20
__int64 v150; // x0
cocos2d::CCLabelBMFont *v151; // x20
__n128 v152; // q0
__n128 v153; // q1
GameObject *m_coinObject; // x0
int v155; // [xsp+18h] [xbp-E8h]
int v156; // [xsp+28h] [xbp-D8h] BYREF
void *__p[2]; // [xsp+30h] [xbp-D0h] BYREF
char v158; // [xsp+47h] [xbp-B9h]
void *v159[2]; // [xsp+48h] [xbp-B8h] BYREF
char v160; // [xsp+5Fh] [xbp-A1h]
void *__dst[2]; // [xsp+60h] [xbp-A0h] BYREF
char *longStorage; // [xsp+70h] [xbp-90h]
float v163; // [xsp+80h] [xbp-80h]
float v164; // [xsp+84h] [xbp-7Ch]
cocos2d::SEL_MenuHandler v165; // 0:x3.16
if ( !a1->m_isBusy )
{
m_level = a1->m_level;
if ( m_level )
{
if ( a2->m_levelID.random - a2->m_levelID.seed == m_level->m_levelID.random - m_level->m_levelID.seed )
return;
cocos2d::CCObject::release(m_level);
a1->m_level = nullptr;
}
if ( (unsigned int)sub_10024A36C((__int64)a1->m_dynamicObjects) )
{
v5 = 0;
do
{
v6 = sub_10024A388((__int64)a1->m_dynamicObjects, v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 504LL))(v6);
++v5;
}
while ( v5 < (unsigned int)sub_10024A36C((__int64)a1->m_dynamicObjects) );
}
sub_10024A45C((__int64)a1->m_dynamicObjects);
a1->m_secretDoor = nullptr;
a1->m_level = a2;
cocos2d::CCObject::retain(a2);
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v7);
v8 = a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed;
if ( v8 < 1 )
{
v31 = sub_10024A36C((__int64)a1->m_progressObjects);
if ( v8 == -2 )
{
if ( v31 )
{
v32 = 0;
do
{
v33 = sub_10024A388((__int64)a1->m_progressObjects, v32);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v33 + 328LL))(v33, 0);
++v32;
}
while ( v32 < (unsigned int)sub_10024A36C((__int64)a1->m_progressObjects) );
}
v34 = cocos2d::CCSprite::createWithSpriteFrameName("theTowerDoor_001.png");
v165.ptr = (void (__cdecl *)(cocos2d::CCObject *))LevelPage::onTheTower;
v165.adj = 0;
v35 = CCMenuItemSpriteExtra::create(v34, nullptr, a1, v165);
v36 = cocos2d::CCMenu::createWithItem(v35);
v37 = ((__n128 (__fastcall *)(LevelPage *, cocos2d::CCMenu *))a1->addChild)(a1, v36);
v37.n128_f32[0] = v163 * 0.5;
v38.n128_f32[0] = (float)(v164 * 0.5) + -5.0;
sub_100022980(v37, v38, __dst);
((void (__fastcall *)(cocos2d::CCMenu *, void **))v36->setPosition)(v36, __dst);
sub_10024A2D0((__int64)a1->m_dynamicObjects);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("theTowerLabel_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *))v34->addChild)(v34, v39);
v40 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34) * 0.5;
v41.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34) + 4) + 23.0;
v42.n128_f32[0] = v40;
sub_100022980(v42, v41, __dst);
v43 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, void **))v39->setPosition)(v39, __dst);
v43.n128_u32[0] = 0;
v44.n128_u32[0] = 5.0;
sub_100022980(v43, v44, __dst);
v45 = cocos2d::CCMoveBy::create(2.5, (const cocos2d::CCPoint *)__dst);
v46 = cocos2d::CCEaseInOut::create(v45, 1.8);
v47.n128_u32[0] = 0;
v48.n128_u32[0] = -5.0;
sub_100022980(v47, v48, __dst);
v49 = cocos2d::CCMoveBy::create(2.5, (const cocos2d::CCPoint *)__dst);
v50 = (unsigned __int8)cocos2d::CCEaseInOut::create(v49, 1.8);
v58 = sub_10018A494(v46, v51, v52, v53, v54, v55, v56, v57, v50);
v59 = cocos2d::CCRepeatForever::create(v58);
cocos2d::CCNode::runAction(v34, v59);
sub_100009900(
__dst,
"30a-1a2.2a0.48a11a90a180a29a0a11a0a0a0a0a0a0a0a5a1a0a0a0.0745098a0a0a0a0.611765a0a1a0a2a1a0a0a0a0a0.937255a0a1"
"a0a1a0a0.54a0a0.57a0a56a0a11a0a-25a17a1a2a1a0a0a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0");
v60 = GameToolbox::particleFromString((__int64)__dst, nullptr, 0);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCParticleSystemQuad *, __int64))v34->addChild_0)(
v34,
v60,
11);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v60->setScale)(v60, 1.0);
cocos2d::CCParticleSystem::resetSystem(v60);
v61 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v62 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v63.n128_f32[0] = v61 * 0.5;
v64.n128_f32[0] = *(float *)(v62 + 4) * 0.5;
sub_100022980(v63, v64, v159);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v60->setPosition)(v60, v159);
sub_100009900(
v159,
"20a-1a2a0.3a8a90a90a0a2a27a30a0a0a0a0a0a0a75a28a0a360a0a0a0.839216a0a1a0a0.05a0a0a0a0a0a0.184314a0a0a0a1a0a0.0"
"5a0a0.73a0a0.71a0a0a0a0a0a0a0a0a2a1a1a0a0a184a0a0a0a0a0a0a1a0a0a0a0a0a0a0");
v65 = GameToolbox::particleFromString((__int64)v159, nullptr, 0);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCParticleSystemQuad *, __int64))v34->addChild_0)(
v34,
v65,
11);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v65->setScale)(v65, 1.0);
cocos2d::CCParticleSystem::resetSystem(v65);
v66 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v67 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v68.n128_f32[0] = v66 * 0.5;
v69.n128_f32[0] = *(float *)(v67 + 4) * 0.5;
sub_100022980(v68, v69, __p);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v65->setPosition)(v65, __p);
sub_100009900(
__p,
"3a-1a3a0.3a1a90a90a0a2a11a13a0a0a0a0a0a0a15a5a0a0a0a0a0.839216a0a1a0a0.15a0.16a0a0a0a0a0.184314a0a0a0a1a0a0.21"
"a0.07a1a0a1a0a0a0a0a0a0a0a0a2a1a1a0a0a34a0a0a0a0a0a0a1a0a0a0a0a0a0a0");
v70 = GameToolbox::particleFromString((__int64)__p, nullptr, 0);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCParticleSystemQuad *, __int64))v34->addChild_0)(
v34,
v70,
11);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v70->setScale)(v70, 1.0);
cocos2d::CCParticleSystem::resetSystem(v70);
v71 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v72 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v34->getContentSize)(v34);
v73.n128_f32[0] = v71 * 0.5;
v74.n128_f32[0] = *(float *)(v72 + 4) * 0.5;
sub_100022980(v73, v74, &v156);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, int *))v70->setPosition)(v70, &v156);
v75 = 20;
do
{
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v60->update)(v60, 0.1);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v65->update)(v65, 0.1);
--v75;
}
while ( v75 );
if ( v158 < 0 )
operator delete(__p[0]);
if ( v160 < 0 )
operator delete(v159[0]);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__dst[0]);
}
else
{
if ( v31 )
{
v149 = 0;
do
{
v150 = sub_10024A388((__int64)a1->m_progressObjects, v149);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v150 + 328LL))(v150, 0);
++v149;
}
while ( v149 < (unsigned int)sub_10024A36C((__int64)a1->m_progressObjects) );
}
v151 = cocos2d::CCLabelBMFont::create_1("Coming Soon!", "bigFont.fnt");
v152 = ((__n128 (__fastcall *)(LevelPage *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v151);
v152.n128_f32[0] = v163 * 0.5;
v153.n128_f32[0] = (float)(v164 * 0.5) + 50.0;
sub_100022980(v152, v153, __dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v151->setPosition)(v151, __dst);
sub_10024A2D0((__int64)a1->m_dynamicObjects);
LevelPage::addSecretDoor(a1);
}
}
else
{
if ( (unsigned int)sub_10024A36C((__int64)a1->m_progressObjects) )
{
v9 = 0;
do
{
v10 = sub_10024A388((__int64)a1->m_progressObjects, v9);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 328LL))(v10, 1);
++v9;
}
while ( v9 < (unsigned int)sub_10024A36C((__int64)a1->m_progressObjects) );
}
if ( (unsigned int)sub_10024A36C((__int64)a1->m_levelObjects) )
{
v11 = 0;
do
{
v12 = sub_10024A388((__int64)a1->m_levelObjects, v11);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v12 + 328LL))(v12, 1);
++v11;
}
while ( v11 < (unsigned int)sub_10024A36C((__int64)a1->m_levelObjects) );
}
m_progressWidth = a1->m_progressWidth;
NormalPercent = GJGameLevel::getNormalPercent(a1->m_level);
v15 = a1->m_progressWidth;
if ( m_progressWidth > (float)(m_progressWidth * (float)((float)NormalPercent / 100.0)) )
v15 = v15 * (float)((float)GJGameLevel::getNormalPercent(a1->m_level) / 100.0);
m_normalProgressBar = a1->m_normalProgressBar;
sub_100022990((float *)__dst, 0.0, 0.0, v15, m_normalProgressBar->m_obRect.size.height);
((void (__fastcall *)(cocos2d::CCSprite *, void **))m_normalProgressBar->setTextureRect)(
m_normalProgressBar,
__dst);
v17 = a1->m_progressWidth;
if ( v17 <= (float)(v17 * (float)((float)a1->m_level->m_practicePercent / 100.0)) )
v18 = a1->m_progressWidth;
else
v18 = v17 * (float)((float)a1->m_level->m_practicePercent / 100.0);
m_practiceProgressBar = a1->m_practiceProgressBar;
sub_100022990((float *)__dst, 0.0, 0.0, v18, m_practiceProgressBar->m_obRect.size.height);
((void (__fastcall *)(cocos2d::CCSprite *, void **))m_practiceProgressBar->setTextureRect)(
m_practiceProgressBar,
__dst);
v20 = GJGameLevel::getNormalPercent(a1->m_level);
v21 = (cocos2d::CCString *)sub_100268F4C("%i%%", v20);
CString = cocos2d::CCString::getCString(v21);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_normalProgressLabel->setString)(
a1->m_normalProgressLabel,
CString);
v23 = (cocos2d::CCString *)sub_100268F4C("%i%%", a1->m_level->m_practicePercent);
v24 = cocos2d::CCString::getCString(v23);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_practiceProgressLabel->setString)(
a1->m_practiceProgressLabel,
v24);
v25 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v25, "8");
m_requiredCoins = a1->m_level->m_requiredCoins;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_nameLabel->setScale)(a1->m_nameLabel, 1.0);
m_nameLabel = a1->m_nameLabel;
v29 = a1->m_level;
if ( v29->m_levelName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__dst, (void *)v29->m_levelName.m_data.m_long.capacitym1, v29->m_levelName.m_data.m_long.size);
}
else
{
p_m_levelName = &v29->m_levelName;
*(_OWORD *)__dst = *(_OWORD *)&p_m_levelName->m_data.m_short.sizex2;
longStorage = p_m_levelName->m_data.m_long.longStorage;
}
if ( SHIBYTE(longStorage) >= 0 )
v76 = __dst;
else
v76 = (void **)__dst[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))m_nameLabel->setString)(m_nameLabel, v76);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__dst[0]);
v77.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_nameLabel->getContentSize)(a1->m_nameLabel);
if ( v77.n128_f32[0] > 250.0 )
{
v78 = a1->m_nameLabel;
v79 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v78->getContentSize)(
v78,
v77.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v78->setScale)(v78, 250.0 / *v79);
}
v80 = a1->m_nameLabel;
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v80->getScale)(v80, v77) <= 1.0 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_nameLabel->getScale)(a1->m_nameLabel);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v80->setScale)(v80);
m_difficulty = a1->m_level->m_difficulty;
if ( (unsigned int)m_difficulty >= Demon )
v82 = Demon;
else
v82 = a1->m_level->m_difficulty;
if ( m_difficulty < Easy )
v83 = 1;
else
v83 = v82;
v84 = (cocos2d::CCString *)sub_100268F4C("diffIcon_%02d_btn_001.png", v83);
v85 = cocos2d::CCString::getCString(v84);
m_difficultySprite = a1->m_difficultySprite;
v87 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v88 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v87, v85);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_difficultySprite->setDisplayFrame)(
m_difficultySprite,
v88);
v89 = a1->m_difficultySprite;
width = v89->m_obRect.size.width;
v91 = width * ((float (__fastcall *)(cocos2d::CCSprite *))v89->getScale)(v89);
v92 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_nameLabel->getContentSize)(a1->m_nameLabel);
v93.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_nameLabel->getScale)(a1->m_nameLabel);
v94 = a1->m_difficultySprite;
v93.n128_f32[0] = (float)(v91 * 0.5)
+ (float)((float)(a1->m_levelDisplaySize.width * 0.5)
- (float)((float)((float)((float)(v91 * 0.5)
+ (float)((float)(v92 * v93.n128_f32[0]) + 5.0))
+ 30.0)
* 0.5));
v95.n128_f32[0] = (float)(a1->m_levelDisplaySize.height * 0.5) + 3.0;
sub_100022980(v93, v95, __dst);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v94->setPosition)(v94, __dst);
v96 = a1->m_nameLabel;
v97.n128_f32[0] = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_difficultySprite->getPosition)(a1->m_difficultySprite)
+ 30.0;
v98.n128_f32[0] = (float)(a1->m_levelDisplaySize.height * 0.5) + 3.0;
sub_100022980(v97, v98, __dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v96->setPosition)(v96, __dst);
m_starsLabel = a1->m_starsLabel;
v100 = (cocos2d::CCString *)sub_100268F4C("%i", a1->m_level->m_stars.random - a1->m_level->m_stars.seed);
v101 = cocos2d::CCString::getCString(v100);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_starsLabel->setString)(m_starsLabel, v101);
v102 = GameStatsManager::sharedState();
hasCompletedStarLevel = GameStatsManager::hasCompletedStarLevel(v102, a1->m_level);
v104 = a1->m_starsLabel;
v155 = m_requiredCoins;
if ( hasCompletedStarLevel )
{
BYTE2(__dst[0]) = 50;
LOWORD(__dst[0]) = -1;
}
((void (*)(void))v104->setColor)();
for ( i = 1; i != 4; i = v110 + 2 )
{
v106 = GameStatsManager::sharedState();
CoinKey = GJGameLevel::getCoinKey(a1->m_level, i);
hasSecretCoin = GameStatsManager::hasSecretCoin(v106, CoinKey);
if ( hasSecretCoin )
v109 = "GJ_coinsIcon_001.png";
else
v109 = "GJ_coinsIcon_gray_001.png";
v110 = i - 1;
v111 = sub_10024A388((__int64)a1->m_coins, v110);
v112 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v113 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v112, v109);
(*(void (__fastcall **)(__int64, cocos2d::CCSpriteFrame *))(*(_QWORD *)v111 + 1144LL))(v111, v113);
if ( hasSecretCoin )
{
BYTE2(__dst[0]) = -1;
LOWORD(__dst[0]) = -1;
}
else
{
BYTE2(__dst[0]) = -31;
LOWORD(__dst[0]) = -7711;
}
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v111 + 944LL))(v111, __dst);
}
if ( v155 <= Stat )
{
v132 = GameStatsManager::sharedState();
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(v132, a1->m_level);
v134 = GameStatsManager::sharedState();
AwardedCurrencyForLevel = GameStatsManager::getAwardedCurrencyForLevel(v134, a1->m_level);
v136 = cocos2d::CCSprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::CCSprite *))a1->m_levelDisplay->addChild)(
a1->m_levelDisplay,
v136);
((void (__fastcall *)(cocos2d::CCSprite *, float))v136->setScale)(v136, 0.7);
v137 = (cocos2d::CCString *)sub_100268F4C(
"%i/%i",
AwardedCurrencyForLevel,
BaseCurrencyForLevel + (int)vcvts_n_f32_s32(BaseCurrencyForLevel, 2u));
v138 = cocos2d::CCString::getCString(v137);
v139 = cocos2d::CCLabelBMFont::create_1(v138, "bigFont.fnt");
v140 = ((__n128 (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::CCLabelBMFont *))a1->m_levelDisplay->addChild)(
a1->m_levelDisplay,
v139);
v140.n128_u32[0] = 0;
v141.n128_u32[0] = 0.5;
sub_100022980(v140, v141, __dst);
v142 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v139->setAnchorPoint)(v139, __dst);
v142.n128_u32[0] = 8.0;
v143.n128_u32[0] = 12.0;
sub_100022980(v142, v143, __dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v139->setPosition)(v139, __dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v139->setScale)(v139, 0.4);
v144 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v139->getPosition)(v139);
v145 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v139->getContentSize)(v139);
v146 = (float)(v144 + (float)(v145 * ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v139->getScale)(v139)))
+ 9.0;
v147.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v139->getPosition)(v139) + 4)
+ -0.5;
v148.n128_f32[0] = v146;
sub_100022980(v148, v147, __dst);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v136->setPosition)(v136, __dst);
sub_10024A2D0((__int64)a1->m_dynamicObjects);
m_dynamicObjects = a1->m_dynamicObjects;
}
else
{
if ( (unsigned int)sub_10024A36C((__int64)a1->m_levelObjects) )
{
v114 = 0;
do
{
v115 = sub_10024A388((__int64)a1->m_levelObjects, v114);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v115 + 328LL))(v115, 0);
++v114;
}
while ( v114 < (unsigned int)sub_10024A36C((__int64)a1->m_levelObjects) );
}
v116 = cocos2d::CCSprite::createWithSpriteFrameName("GJLargeLock_001.png");
v117 = ((__n128 (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::CCSprite *))a1->m_levelDisplay->addChild)(
a1->m_levelDisplay,
v116);
v117.n128_f32[0] = a1->m_levelDisplaySize.width * 0.5;
v118.n128_f32[0] = a1->m_levelDisplaySize.height * 0.5;
sub_100022980(v117, v118, __dst);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v116->setPosition)(v116, __dst);
v119 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_coinsIcon_001.png");
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::CCSprite *))a1->m_levelDisplay->addChild)(
a1->m_levelDisplay,
v119);
v120 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float))v119->setScale)(v119, 1.0);
v120.n128_f32[0] = a1->m_levelDisplaySize.width + -15.0;
v121.n128_u32[0] = 15.0;
sub_100022980(v120, v121, __dst);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v119->setPosition)(v119, __dst);
v122 = (cocos2d::CCString *)sub_100268F4C("%i/%i", Stat, v155);
v123 = cocos2d::CCString::getCString(v122);
v124 = cocos2d::CCLabelBMFont::create_1(v123, "bigFont.fnt");
v125 = ((__n128 (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::CCLabelBMFont *))a1->m_levelDisplay->addChild)(
a1->m_levelDisplay,
v124);
v125.n128_u32[0] = 1.0;
v126.n128_u32[0] = 0.5;
sub_100022980(v125, v126, __dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v124->setAnchorPoint)(v124, __dst);
v127 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v119->getPosition)(v119);
v128.n128_u32[0] = -15.0;
v129.n128_u32[0] = 0.5;
sub_100022980(v128, v129, v159);
*(float32x2_t *)&v130 = sub_1000229DC(v127, (float32x2_t *)v159, (float32x2_t *)__dst);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **, double))v124->setPosition)(v124, __dst, v130);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v124->setScale)(v124, 0.7);
sub_10024A2D0((__int64)a1->m_dynamicObjects);
sub_10024A2D0((__int64)a1->m_dynamicObjects);
m_dynamicObjects = a1->m_dynamicObjects;
}
sub_10024A2D0((__int64)m_dynamicObjects);
}
m_coinObject = a1->m_coinObject;
if ( m_coinObject )
((void (__fastcall *)(GameObject *, bool))m_coinObject->setVisible)(
m_coinObject,
a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed == -1);
a1->m_isBusy = 0;
}
}