//
// PauseLayer::onTryEdit from 0x6c85c0 to 0x6c8728 (360 bytes)
//
// 3 xrefs:
// > ??> @ 0x3ebc8
// > PauseLayer::customSetup @ 0x6c7c3c
// > ??> @ 0x1229fe0
//
// 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 PauseLayer::onTryEdit(PauseLayer *a1, cocos2d::CCObject *a2)
{
FLAlertLayer *v3; // x20
void *v4; // x0
unsigned int *v5; // x2
int v6; // w1
__int64 v8; // [xsp+50h] [xbp+50h] BYREF
if ( GameManager::sharedState()->m_playLayer->m_level->m_levelType == Editor )
{
PauseLayer::onEdit(a1, a2);
}
else
{
sub_D153B8((int)&v8, "Are you sure you want to open the editor?\n(Read-Only)");
v3 = FLAlertLayer::create((int)a1 + 552, (__int64)"Edit Level", (__int64)&v8);
v4 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v8 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
v3->setTag(v3, 1);
v3->show(v3);
}
}