//
// EditorUI::onPlaytest from 0x1401b4770 to 0x1401b4986 (534 bytes)
//
// 4 xrefs:
// > EditorUI::onPlaytest @ 0x1401b4955
// > EditorUI::handleAction @ 0x1401c1d9a
// > EditorUI::init @ 0x1401aabd8
// > ??> @ 0x14091a0fc
//
// 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:27:57 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall EditorUI::onPlaytest(__int64 a1, __int64 a2)
{
__int64 v4; // rax
char v5; // si
char v6; // di
__int64 v7; // rcx
int v8; // eax
__int64 v9; // rcx
__int64 *v10; // r14
__int64 v11; // rbp
cocos2d::CCSpriteFrameCache *v12; // rax
const char *v13; // rdx
struct cocos2d::CCSpriteFrame *v14; // rax
__int64 v15; // rdx
void *v16; // [rsp+40h] [rbp+8h]
if ( !*(_BYTE *)(a1 + 1660) )
{
v4 = EditorSFXManager::sharedState();
EditorSFXManager::playAction(v4, 210);
v5 = 0;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 2204LL) != 1 )
{
v5 = 1;
GJBaseGameLayer::pauseAudio();
}
v6 = 0;
*(_BYTE *)(a1 + 664) = 0;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 2204LL) != 1 )
EditorUI::toggleMode(a1, *(_QWORD *)(a1 + 984));
EditorUI::deselectAll(a1);
v7 = *(_QWORD *)(a1 + 1512);
v8 = *(_DWORD *)(v7 + 2204);
switch ( v8 )
{
case 1:
LevelEditorLayer::onPausePlaytest();
break;
case 2:
LevelEditorLayer::onResumePlaytest();
break;
case 0:
*(float *)(a1 + 1656) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 4296) + 168LL))(*(_QWORD *)(v7 + 4296));
LevelEditorLayer::onPlaytest(*(_QWORD *)(a1 + 1512));
if ( !*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 12912LL) )
goto LABEL_16;
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v16 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
if ( (unsigned __int8)GameManager::getGameVariable(v9, "0150") )
v6 = 1;
else
LABEL_16:
v6 = 0;
break;
}
EditorUI::showUI(a1, *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 2204LL) != 1);
v10 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1048) + 952LL))(*(_QWORD *)(a1 + 1048));
v11 = *v10;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 2204LL) == 1 )
{
v12 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v13 = "GJ_pauseEditorBtn_001.png";
}
else
{
v12 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v13 = "GJ_playEditorBtn_001.png";
}
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v12, v13);
(*(void (__fastcall **)(__int64 *, struct cocos2d::CCSpriteFrame *))(v11 + 1008))(v10, v14);
LOBYTE(v15) = *(_BYTE *)(a1 + 1661) == 0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1056) + 336LL))(*(_QWORD *)(a1 + 1056), v15);
EditorUI::updatePlaybackBtn(a1);
if ( v6 )
EditorUI::onPlaytest(a1, a2);
if ( v5 )
*(_BYTE *)(*(_QWORD *)(a1 + 1512) + 14438LL) = 1;
}
}