//
// EditLevelLayer::onEdit from 0x6e2ae4 to 0x6e2c7c (408 bytes)
//
// 4 xrefs:
// > EditLevelLayer::FLAlert_Clicked @ 0x6e3150
// > ??> @ 0xacd28
// > EditLevelLayer::init @ 0x6e0b04
// > ??> @ 0x122dfa8
//
// 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 EditLevelLayer::onEdit(EditLevelLayer *a1, cocos2d::CCObject *a2)
{
FMODAudioEngine *v3; // x23
void *v4; // x0
cocos2d::CCDirector *v5; // x21
cocos2d::CCScene *v6; // x0
cocos2d::CCTransitionFade *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+60h] [xbp+60h] BYREF
if ( !cocos2d::CCDirector::sharedDirector()->m_bIsTransitioning && !a1->m_exiting )
{
EditLevelLayer::closeTextInputs(a1);
a1->setKeypadEnabled(a1, 0);
a1->m_exiting = 1;
GameManager::sharedState()->m_sceneEnum = 3;
EditLevelLayer::verifyLevelName(a1);
v3 = FMODAudioEngine::sharedEngine();
GJGameLevel::getAudioFileName(&v10, a1->m_level);
FMODAudioEngine::loadMusic((__int64)v3, &v10, 1u, 0, 0, 0, 1.0, 0.0, 1.0);
v4 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v4);
}
v5 = cocos2d::CCDirector::sharedDirector();
v6 = LevelEditorLayer::scene(a1->m_level, 0);
v7 = cocos2d::CCTransitionFade::create(0.5, v6);
cocos2d::CCDirector::replaceScene(v5, v7);
}
}