//
// EditorUI::onPlaytest from 0x100008780 to 0x100008944 (452 bytes)
//
// 3 xrefs:
// > EditorUI::onPlaytest @ 0x10000891c
// > EditorUI::handleAction @ 0x10060b88b
// > EditorUI::init @ 0x100006201
//
// 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 12:18:48 +0000
//
void __fastcall EditorUI::onPlaytest(__int64 a1, __int64 a2)
{
__int64 v3; // rax
__int64 v4; // rsi
int v5; // r13d
bool v6; // zf
__int64 v7; // rdi
int v8; // eax
__int64 v9; // rdi
__int64 v10; // rdx
__int64 v11; // rax
char GameVariable; // r15
__int64 v13; // r12
int v14; // r14d
__int64 v15; // rax
const char *v16; // rsi
__int64 v17; // rax
if ( *(_BYTE *)(a1 + 1588) )
return;
v3 = EditorSFXManager::sharedState(a1);
v4 = 210;
EditorSFXManager::playAction_1(v3, 210);
v5 = *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 1972LL);
if ( v5 == 1 )
{
*(_BYTE *)(a1 + 616) = 0;
}
else
{
GJBaseGameLayer::pauseAudio();
v6 = *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 1972LL) == 1;
*(_BYTE *)(a1 + 616) = 0;
if ( !v6 )
{
v4 = *(_QWORD *)(a1 + 936);
EditorUI::toggleMode(a1, v4);
}
}
EditorUI::deselectAll(a1);
v7 = *(_QWORD *)(a1 + 1440);
v8 = *(_DWORD *)(v7 + 1972);
if ( v8 )
{
if ( v8 == 2 )
{
LevelEditorLayer::onResumePlaytest();
}
else if ( v8 == 1 )
{
LevelEditorLayer::onPausePlaytest();
}
goto LABEL_13;
}
*(float *)(a1 + 1584) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 3920) + 168LL))(*(_QWORD *)(v7 + 3920));
v9 = *(_QWORD *)(a1 + 1440);
LevelEditorLayer::onPlaytest(v9);
if ( !*(_QWORD *)(*(_QWORD *)(a1 + 1440) + 12432LL) )
{
LABEL_13:
GameVariable = 0;
goto LABEL_14;
}
v11 = GameManager::sharedState(v9, v4, v10);
GameVariable = GameManager::getGameVariable(v11, "0150");
LABEL_14:
EditorUI::showUI(a1, *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 1972LL) != 1);
v13 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1000) + 1072LL))(*(_QWORD *)(a1 + 1000));
v14 = *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 1972LL);
v15 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v16 = "GJ_playEditorBtn_001.png";
if ( v14 == 1 )
v16 = "GJ_pauseEditorBtn_001.png";
v17 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v15, v16);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v13 + 1160LL))(v13, v17);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 1008) + 344LL))(
*(_QWORD *)(a1 + 1008),
*(unsigned __int8 *)(a1 + 1589) ^ 1u);
EditorUI::updatePlaybackBtn(a1);
if ( GameVariable )
EditorUI::onPlaytest(a1, a2);
if ( v5 != 1 )
*(_BYTE *)(*(_QWORD *)(a1 + 1440) + 13806LL) = 1;
}