//
// EditLevelLayer::onPlay from 0x7eed44 to 0x7eef88 (580 bytes)
//
// 6 xrefs:
// > EditLevelLayer::FLAlert_Clicked @ 0x7f1d08
// > EditLevelLayer::FLAlert_Clicked @ 0x7f1d50
// > EditLevelLayer::keyDown @ 0x7f1da4
// > ??> @ 0xbd2e0
// > EditLevelLayer::init @ 0x7f0adc
// > ??> @ 0x15457b0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:54:34 +0000
//
__int64 __fastcall EditLevelLayer::onPlay(EditLevelLayer *this, cocos2d::CCObject *a2)
{
__int64 v3; // x0
__int64 v4; // x2
__int64 v5; // x1
FLAlertLayer *v6; // x20
__int64 v7; // x2
FMODAudioEngine *v9; // x0
FMODAudioEngine *v10; // x0
FMODAudioEngine *v11; // x0
__int64 v12; // x22
cocos2d::CCDelayTime *v13; // x0
cocos2d::CCSequence *v14; // x21
cocos2d::CCFiniteTimeAction *v15; // x0
cocos2d::CCAction *v16; // x0
__int64 v17; // [xsp+30h] [xbp+30h] BYREF
__int64 v18; // [xsp+38h] [xbp+38h]
void *v19; // [xsp+40h] [xbp+40h]
if ( !*(_BYTE *)(cocos2d::CCDirector::sharedDirector(_stack_chk_guard) + 176) && !*((_BYTE *)this + 496) )
{
v3 = *((_QWORD *)this + 59);
v4 = *(_BYTE *)(v3 + 1472) >> 1;
if ( (*(_BYTE *)(v3 + 1472) & 1) != 0 )
v4 = *(_QWORD *)(v3 + 1480);
if ( v4 && (*(_DWORD *)(v3 + 1520) != *(_DWORD *)(v3 + 788) || *(_DWORD *)(v3 + 1524) != 4) )
GJGameLevel::clearPlatformerSave((GJGameLevel *)v3);
if ( *((_BYTE *)this + 536) )
goto LABEL_16;
v5 = *(_BYTE *)(*((_QWORD *)this + 59) + 1472LL) >> 1;
if ( (*(_BYTE *)(*((_QWORD *)this + 59) + 1472LL) & 1) != 0 )
v5 = *(_QWORD *)(*((_QWORD *)this + 59) + 1480LL);
if ( !v5 )
{
LABEL_16:
EditLevelLayer::closeTextInputs((cocos2d::CCArray **)this);
v9 = (FMODAudioEngine *)(*(__int64 (__fastcall **)(EditLevelLayer *, _QWORD))(*(_QWORD *)this + 1072LL))(this, 0);
*((_BYTE *)this + 496) = 1;
v10 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v9);
v11 = (FMODAudioEngine *)FMODAudioEngine::stopAllMusic(v10, 1);
v12 = FMODAudioEngine::sharedEngine(v11);
v17 = 0;
v18 = 0;
v19 = nullptr;
std::string::__init(&v17, "playSound_01.ogg", 0x10u);
FMODAudioEngine::playEffect(v12, (char *)&v17, 1.0, 0.0, 0.3);
if ( (v17 & 1) != 0 )
operator delete(v19);
v13 = (cocos2d::CCDelayTime *)EditLevelLayer::verifyLevelName(this);
v14 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v13, 0.0);
v15 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, EditLevelLayer::playStep2, 0);
v16 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v14, v15, 0);
cocos2d::CCNode::runAction(this, v16);
}
else
{
v17 = 0;
v18 = 0;
v19 = nullptr;
std::string::__init(
&v17,
"There is a saved checkpoint for this level.\nDo you want to load it?",
0x5Bu);
v6 = (FLAlertLayer *)FLAlertLayer::create(
(__int64)this + 416,
(cocos2d::CCLabelBMFont *)"Load Save",
(char *)&v17,
(ButtonSprite *)"New Game",
(ButtonSprite *)"Load Save",
380.0);
if ( (v17 & 1) != 0 )
operator delete(v19);
FLAlertLayer::addCloseButton(v6);
v7 = *(_QWORD *)v6;
*((_BYTE *)v6 + 656) = 1;
(*(void (__fastcall **)(FLAlertLayer *, __int64))(v7 + 72))(v6, 11);
(*(void (__fastcall **)(FLAlertLayer *))(*(_QWORD *)v6 + 1312LL))(v6);
}
}
return _stack_chk_guard;
}