//
// LevelInfoLayer::onPlay from 0x3b225c to 0x3b2786 (1322 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x3b2b0a
// > LevelInfoLayer::keyDown @ 0x3b5992
//
// 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; // r0
GJGameLevel *v4; // r3
GJGameLevel *m_level; // r3
GameManager *v6; // r0
MusicDownloadManager *v7; // r0
GameManager *v8; // r0
GJGameLevel *v9; // r5
int v10; // r2
GameManager *v11; // r0
FLAlertLayer *v12; // r4
FMODAudioEngine *v13; // r0
FMODAudioEngine *v14; // r8
cocos2d::CCDelayTime *v15; // r0
cocos2d::CCSequence *v16; // r9
cocos2d::CCFiniteTimeAction *v17; // r0
cocos2d::CCAction *v18; // r0
GJGameLevel *v19; // r3
int seed; // r0
int random; // r2
cocos2d::CCSprite *v22; // r7
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
float width; // s17
const cocos2d::CCSize *v25; // r0
cocos2d::CCSprite *v26; // r7
void (__fastcall *v27)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
float v28; // s17
const cocos2d::CCSize *v29; // r0
cocos2d::CCSprite *v30; // r7
void (__fastcall *v31)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
float v32; // s17
const cocos2d::CCSize *v33; // r0
cocos2d::CCSprite *m_playSprite; // r0
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCSprite *v36; // r7
cocos2d::CCProgressTimer *v37; // r0
cocos2d::CCProgressTimer *v38; // r7
void (__fastcall *v39)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v40; // s17
const cocos2d::CCSize *v41; // r0
char *v42; // r1
FLAlertLayer *v43; // r4
char v44; // [sp+8h] [bp-20h] BYREF
char v45; // [sp+9h] [bp-1Fh]
char v46; // [sp+Ah] [bp-1Eh]
_BYTE v47[4]; // [sp+Ch] [bp-1Ch] BYREF
char v48; // [sp+10h] [bp-18h] BYREF
char v49; // [sp+11h] [bp-17h]
char v50; // [sp+12h] [bp-16h]
cocos2d::CCPoint v51; // [sp+14h] [bp-14h] BYREF
_DWORD v52[2]; // [sp+1Ch] [bp-Ch] BYREF
if ( !a1->m_isBusy && a1->m_enterTransitionFinished )
{
if ( LevelInfoLayer::shouldDownloadLevel(a1) )
{
LevelInfoLayer::downloadLevel(a1);
}
else
{
v3 = GameManager::sharedState();
if ( GameManager::getGameVariable(v3, "0083")
|| (v4 = a1->m_level, !v4->m_songID)
|| v4->m_showedSongWarning
|| (v7 = MusicDownloadManager::sharedState(), MusicDownloadManager::isSongDownloaded(v7, a1->m_level->m_songID)) )
{
m_level = a1->m_level;
if ( m_level->m_coins <= 0
|| m_level->m_coinsVerified.random != m_level->m_coinsVerified.seed
|| (v6 = GameManager::sharedState(), GameManager::getGameVariable(v6, "0063")) )
{
v8 = GameManager::sharedState();
if ( GameManager::getGameVariable(v8, "0082")
|| (v9 = a1->m_level, v10 = v9->m_objectCount.random - v9->m_objectCount.seed, v10 <= 40000)
|| v9->m_highObjectsEnabled )
{
if ( !a1->m_isBusy )
{
((void (__fastcall *)(LevelInfoLayer *))a1->setKeypadEnabled)(a1);
a1->m_isBusy = 1;
v13 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v13, 1);
v14 = FMODAudioEngine::sharedEngine();
sub_776584((int)v52, "playSound_01.ogg");
FMODAudioEngine::playEffect(v14, (int)v52, 1.0, 0, 1050253722);
sub_774008(v52);
GameManager::sharedState()->m_loadingLevel = 1;
v15 = cocos2d::CCDelayTime::create(0.0);
v52[1] = 0;
v52[0] = LevelInfoLayer::playStep2;
v16 = (cocos2d::CCSequence *)v15;
v17 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, LevelInfoLayer::playStep2, 0);
v18 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v16, v17, 0);
cocos2d::CCNode::runAction(a1, v18);
v45 = 46;
v46 = 115;
v47[1] = 87;
v47[2] = -38;
v48 = 100;
v19 = a1->m_level;
v49 = (unsigned __int8)&dword_FC + 3;
v50 = 0;
seed = v19->m_dailyID.seed;
random = v19->m_dailyID.random;
v44 = 0;
v47[0] = 0;
if ( random - seed <= 100000 )
{
if ( v19->m_gauntletLevel )
{
v44 = 23;
v45 = 23;
v46 = 23;
memset(v47, 43, 3);
}
}
else
{
v48 = (unsigned __int8)&dword_FC + 3;
v44 = 23;
v45 = 23;
v46 = 23;
memset(v47, 43, 3);
v49 = 50;
}
v22 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v22->setColor(v22, (const cocos2d::ccColor3B *)&v44);
((void (__fastcall *)(cocos2d::CCSprite *, int))v22->setScale)(v22, 1072735191);
setPosition = v22->setPosition;
width = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v25 = a1->m_playSprite->getContentSize(a1->m_playSprite);
cocos2d::CCPoint::CCPoint(&v51, width * 0.5, v25->height * 0.5);
setPosition(v22, &v51);
a1->m_playSprite->addChild_0(a1->m_playSprite, v22, -5);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v26->setColor(v26, (const cocos2d::ccColor3B *)&v44);
((void (__fastcall *)(cocos2d::CCSprite *, int))v26->setScale)(v26, 1070638039);
v27 = v26->setPosition;
v28 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v29 = a1->m_playSprite->getContentSize(a1->m_playSprite);
cocos2d::CCPoint::CCPoint(&v51, v28 * 0.5, v29->height * 0.5);
v27(v26, &v51);
a1->m_playSprite->addChild_0(a1->m_playSprite, v26, -2);
v30 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v30->setColor(v30, (const cocos2d::ccColor3B *)v47);
((void (__fastcall *)(cocos2d::CCSprite *, int))v30->setScale)(v30, 1071644672);
v31 = v30->setPosition;
v32 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v33 = a1->m_playSprite->getContentSize(a1->m_playSprite);
cocos2d::CCPoint::CCPoint(&v51, v32 * 0.5, v33->height * 0.5);
v31(v30, &v51);
a1->m_playSprite->addChild_0(a1->m_playSprite, v30, -4);
m_playSprite = a1->m_playSprite;
setColor = m_playSprite->setColor;
memset(&v51, 125, 3);
setColor(m_playSprite, (const cocos2d::ccColor3B *)&v51);
v36 = cocos2d::CCSprite::createWithSpriteFrameName("d_circle_01_001.png");
v36->setColor(v36, (const cocos2d::ccColor3B *)&v48);
v37 = cocos2d::CCProgressTimer::create(v36);
a1->m_progressTimer = v37;
v38 = v37;
v39 = v37->setPosition;
v40 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v41 = a1->m_playSprite->getContentSize(a1->m_playSprite);
cocos2d::CCPoint::CCPoint(&v51, v40 * 0.5, v41->height * 0.5);
v39(v38, &v51);
((void (__fastcall *)(cocos2d::CCProgressTimer *, int))a1->m_progressTimer->setScale)(
a1->m_progressTimer,
1071644672);
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
{
LODWORD(v51.x) = &unk_ACDDA8;
if ( v10 <= 80000 )
v42 = "This level has a high object count and can be unstable on some devices. This may eff"
"ect performance, load time etc.";
else
v42 = "This level has a VERY HIGH object count and can be unstable on some devices. This ma"
"y effect performance, load time etc.";
sub_7753D4((int)&v51, v42);
sub_776584((int)v52, (char *)LODWORD(v51.x));
v43 = FLAlertLayer::create(
(int)&a1->FLAlertLayerProtocol,
(int)"High Objects",
(int)v52,
(int)"Cancel",
(int)"Play",
380.0);
sub_774008(v52);
v43->setTag(v43, 10);
v43->show(v43);
sub_774008(&v51);
}
}
else
{
v11 = GameManager::sharedState();
GameManager::setGameVariable(v11, "0063", 1);
sub_776584(
(int)v52,
"This level contains unverified user coins (bronze).\n"
"The coins will not count until they become verified (silver).");
v12 = FLAlertLayer::create(
(int)&a1->FLAlertLayerProtocol,
(int)"Unverified Coins",
(int)v52,
(int)"OK",
0,
300.0);
sub_774008(v52);
v12->show(v12);
}
}
else
{
LevelInfoLayer::showSongWarning(a1);
}
}
}
}