//
// PlayLayer::togglePracticeMode from 0x140519ff0 to 0x14051a0c6 (214 bytes)
//
// 4 xrefs:
// > PauseLayer::onNormalMode @ 0x1404dabdd
// > PlayLayer::fullReset @ 0x1405189b3
// > UILayer::handleAction @ 0x140671a81
// > ??> @ 0x14092ae24
//
// This function is hookable on this platform (idp: pc, 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 11:33:35 +0000
//
__int64 __fastcall PlayLayer::togglePracticeMode(__int64 a1, unsigned __int8 a2)
{
cocos2d::CCObject *v4; // rcx
__int64 result; // rax
if ( *(_BYTE *)(a1 + 13024) != a2 )
{
if ( a2 )
{
PlayLayer::writePersistentSave((_BYTE *)a1);
*(_BYTE *)(a1 + 13024) = a2;
PlayLayer::toggleDebugDraw((cocos2d::CCDrawNode **)a1);
UILayer::toggleCheckpointsMenu(*(_QWORD *)(a1 + 13888), a2);
if ( !*(_BYTE *)(a1 + 13025) )
PlayLayer::playPracticeMusic();
}
else
{
*(_BYTE *)(a1 + 13024) = 0;
PlayLayer::toggleDebugDraw((cocos2d::CCDrawNode **)a1);
UILayer::toggleCheckpointsMenu(*(_QWORD *)(a1 + 13888), a2);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 2168) + 1220LL) != 2 )
{
v4 = *(cocos2d::CCObject **)(a1 + 12912);
if ( v4 )
{
cocos2d::CCObject::release(v4);
*(_QWORD *)(a1 + 12912) = 0;
*(_BYTE *)(a1 + 13096) = 0;
}
}
PlayLayer::resetLevelFromStart((_BYTE *)a1);
}
if ( *(_BYTE *)(a1 + 13024) )
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)a1, 31);
return PlayLayer::dtLiveMarkersChanged(a1);
}
return result;
}