//
// LevelInfoLayer::onPlay from 0x6d88c8 to 0x6d9180 (2232 bytes)
//
// 6 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x6d9768
// > LevelInfoLayer::FLAlert_Clicked @ 0x6d978c
// > LevelInfoLayer::keyDown @ 0x6ddde0
// > ??> @ 0xbf328
// > LevelInfoLayer::init @ 0x6db9f4
// > ??> @ 0x122ea38
//
// 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::onPlay(LevelInfoLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
GJGameLevel *m_level; // x0
GameManager *v5; // x0
GJGameLevel *v6; // x22
int v7; // w1
FLAlertLayer *v8; // x20
void *v9; // x0
char *v10; // x0
unsigned int *v11; // x20
int v12; // w1
MusicDownloadManager *v13; // x0
FMODAudioEngine *v14; // x0
FMODAudioEngine *v15; // x22
cocos2d::CCSequence *v16; // x22
cocos2d::CCFiniteTimeAction *v17; // x0
cocos2d::CCAction *v18; // x0
GJGameLevel *v19; // x1
cocos2d::CCSprite *v20; // x23
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x27
float width; // s0
cocos2d::CCSprite *m_playSprite; // x0
__int128 v24; // q0
const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x1
__int64 v26; // x0
cocos2d::CCSprite *v27; // x23
void (__fastcall *v28)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
float v29; // s0
cocos2d::CCSprite *v30; // x0
__int128 v31; // q0
const cocos2d::CCSize *(__fastcall *v32)(const cocos2d::CCNode *__hidden); // x1
__int64 v33; // x0
cocos2d::CCSprite *v34; // x23
void (__fastcall *v35)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
float v36; // s0
cocos2d::CCSprite *v37; // x0
__int128 v38; // q0
const cocos2d::CCSize *(__fastcall *v39)(const cocos2d::CCNode *__hidden); // x1
__int64 v40; // x0
cocos2d::CCSprite *v41; // x0
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCSprite *v43; // x22
cocos2d::CCProgressTimer *v44; // x0
cocos2d::CCProgressTimer_vtbl *v45; // x2
cocos2d::CCSprite *v46; // x1
cocos2d::CCProgressTimer *v47; // x22
void (__fastcall *v48)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float v49; // s0
cocos2d::CCSprite *v50; // x0
__int128 v51; // q0
const cocos2d::CCSize *(__fastcall *v52)(const cocos2d::CCNode *__hidden); // x1
__int64 v53; // x0
GameManager *v54; // x0
GameManager *v55; // x0
FLAlertLayer *v56; // x20
void *v57; // x0
unsigned int *v58; // x2
int v59; // w1
unsigned int *v60; // x1
int v61; // w2
__int64 v62; // [xsp+0h] [xbp+0h] BYREF
__int128 v63; // [xsp+60h] [xbp+60h]
char v64; // [xsp+78h] [xbp+78h] BYREF
char v65; // [xsp+79h] [xbp+79h]
char v66; // [xsp+7Ah] [xbp+7Ah]
_BYTE v67[8]; // [xsp+80h] [xbp+80h] BYREF
char *v68; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v69; // [xsp+90h] [xbp+90h] BYREF
if ( a1->m_isBusy || !a1->m_enterTransitionFinished )
return;
if ( LevelInfoLayer::shouldDownloadLevel(a1) )
{
LevelInfoLayer::downloadLevel(a1);
return;
}
v3 = GameManager::sharedState();
if ( GameManager::getGameVariable(v3, "0083") )
goto LABEL_31;
m_level = a1->m_level;
if ( m_level->m_songID && !m_level->m_showedSongWarning )
{
v13 = MusicDownloadManager::sharedState();
if ( !MusicDownloadManager::isSongDownloaded(v13, a1->m_level->m_songID) )
{
LevelInfoLayer::showSongWarning(a1);
return;
}
LABEL_31:
m_level = a1->m_level;
}
if ( m_level->m_coins <= 0
|| m_level->m_coinsVerified.random != m_level->m_coinsVerified.seed
|| (v54 = GameManager::sharedState(), GameManager::getGameVariable(v54, "0063")) )
{
v5 = GameManager::sharedState();
if ( GameManager::getGameVariable(v5, "0082")
|| (v6 = a1->m_level, v7 = v6->m_objectCount.random - v6->m_objectCount.seed, v7 <= 40000)
|| v6->m_highObjectsEnabled )
{
if ( !a1->m_isBusy )
{
a1->setKeypadEnabled(a1, 0);
a1->m_isBusy = 1;
v14 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v14, 1);
v15 = FMODAudioEngine::sharedEngine();
sub_D153B8((unsigned int)&v62 + 144, "playSound_01.ogg");
FMODAudioEngine::playEffect((__int64)v15, (__int64)&v69, 1.0, 0.0, 0.3);
if ( (__int64 *)(*(_QWORD *)&v69 - 24LL) != &qword_124B6B0 )
sub_4DB8B0((void *)(*(_QWORD *)&v69 - 24LL));
GameManager::sharedState()->m_loadingLevel = 1;
v16 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(0.0);
v17 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, LevelInfoLayer::playStep2, 0);
v18 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v16, v17, 0);
cocos2d::CCNode::runAction(a1, v18);
v64 = 0;
v65 = 46;
v66 = 115;
v19 = a1->m_level;
v67[1] = 87;
v67[0] = 0;
v67[2] = -38;
LOWORD(v68) = -156;
BYTE2(v68) = 0;
if ( v19->m_dailyID.random - v19->m_dailyID.seed <= 100000 )
{
if ( v19->m_gauntletLevel )
{
v64 = 23;
v65 = 23;
v66 = 23;
memset(v67, 43, 3);
}
}
else
{
memset(v67, 43, 3);
v64 = (unsigned __int8)&dword_14 + 3;
v65 = (unsigned __int8)&dword_14 + 3;
v66 = (unsigned __int8)&dword_14 + 3;
LOWORD(v68) = 13055;
}
v20 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v20->setColor(v20, (const cocos2d::ccColor3B *)&v64);
v20->setScale(v20, 1.88);
setPosition = v20->setPosition;
width = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
m_playSprite = a1->m_playSprite;
*(float *)&v24 = width * 0.5;
getContentSize = m_playSprite->getContentSize;
v63 = v24;
v26 = (__int64)getContentSize(m_playSprite);
cocos2d::CCPoint::CCPoint(&v69, *(float *)&v63, *(float *)(v26 + 4) * 0.5);
setPosition(v20, &v69);
a1->m_playSprite->addChild_0(a1->m_playSprite, v20, -5);
v27 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v27->setColor(v27, (const cocos2d::ccColor3B *)&v64);
v27->setScale(v27, 1.63);
v28 = v27->setPosition;
v29 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v30 = a1->m_playSprite;
*(float *)&v31 = v29 * 0.5;
v32 = v30->getContentSize;
v63 = v31;
v33 = (__int64)v32(v30);
cocos2d::CCPoint::CCPoint(&v69, *(float *)&v63, *(float *)(v33 + 4) * 0.5);
v28(v27, &v69);
a1->m_playSprite->addChild_0(a1->m_playSprite, v27, -2);
v34 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v34->setColor(v34, (const cocos2d::ccColor3B *)v67);
v34->setScale(v34, 1.75);
v35 = v34->setPosition;
v36 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v37 = a1->m_playSprite;
*(float *)&v38 = v36 * 0.5;
v39 = v37->getContentSize;
v63 = v38;
v40 = (__int64)v39(v37);
cocos2d::CCPoint::CCPoint(&v69, *(float *)&v63, *(float *)(v40 + 4) * 0.5);
v35(v34, &v69);
a1->m_playSprite->addChild_0(a1->m_playSprite, v34, -4);
v41 = a1->m_playSprite;
setColor = v41->setColor;
memset(&v69, 125, 3);
setColor(v41, (const cocos2d::ccColor3B *)&v69);
v43 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v43->setColor(v43, (const cocos2d::ccColor3B *)&v68);
v44 = cocos2d::CCProgressTimer::create(v43);
v45 = v44->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v46 = a1->m_playSprite;
v47 = v44;
a1->m_progressTimer = v44;
v48 = v45->setPosition;
v49 = v46->getContentSize(v46)->width;
v50 = a1->m_playSprite;
*(float *)&v51 = v49 * 0.5;
v52 = v50->getContentSize;
v63 = v51;
v53 = (__int64)v52(v50);
cocos2d::CCPoint::CCPoint(&v69, *(float *)&v63, *(float *)(v53 + 4) * 0.5);
v48(v47, &v69);
a1->m_progressTimer->setScale(a1->m_progressTimer, 1.75);
cocos2d::CCProgressTimer::setPercentage(a1->m_progressTimer, 0.0);
a1->m_playSprite->addChild_0(a1->m_playSprite, a1->m_progressTimer, -3);
a1->m_playBtnMenu->setTouchEnabled(a1->m_playBtnMenu, 0);
a1->m_songWidget->m_buttonMenu->setTouchEnabled(a1->m_songWidget->m_buttonMenu, 0);
}
}
else
{
v68 = &byte_124B6C8;
if ( v7 <= 80000 )
sub_D1798C(
&v68,
"This level has a high object count and can be unstable on some devices. This may effect pe"
"rformance, load time etc.",
147);
else
sub_D1798C(
&v68,
"This level has a VERY HIGH object count and can be unstable on some devices. This may effect <"
"cg>performance, load time etc.",
152);
sub_D153B8((int)&v69, v68);
v8 = FLAlertLayer::create((int)a1 + 440, (__int64)"High Objects", (__int64)&v69);
v9 = (void *)(*(_QWORD *)&v69 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v69 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v60 = (unsigned int *)(*(_QWORD *)&v69 - 8LL);
do
v61 = __ldaxr(v60);
while ( __stlxr(v61 - 1, v60) );
}
else
{
v61 = *(_DWORD *)(*(_QWORD *)&v69 - 8LL);
*(_DWORD *)(*(_QWORD *)&v69 - 8LL) = v61 - 1;
}
if ( v61 <= 0 )
operator delete(v9);
}
v8->setTag(v8, 10);
v8->show(v8);
v10 = v68 - 24;
if ( v68 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v68 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v68 - 2);
*((_DWORD *)v68 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v10);
}
}
}
else
{
v55 = GameManager::sharedState();
GameManager::setGameVariable(v55, "0063", 1);
sub_D153B8(
(int)&v69,
"This level contains unverified user coins (bronze).\n"
"The coins will not count until they become verified (silver).");
v56 = FLAlertLayer::create((int)a1 + 440, (__int64)"Unverified Coins", (__int64)&v69);
v57 = (void *)(*(_QWORD *)&v69 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v69 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v58 = (unsigned int *)(*(_QWORD *)&v69 - 8LL);
do
v59 = __ldaxr(v58);
while ( __stlxr(v59 - 1, v58) );
}
else
{
v59 = *(_DWORD *)(*(_QWORD *)&v69 - 8LL);
*(_DWORD *)(*(_QWORD *)&v69 - 8LL) = v59 - 1;
}
if ( v59 <= 0 )
operator delete(v57);
}
v56->show(v56);
}
}