//
// EditorUI::onPlaytest from 0x1004713fc to 0x1004715a8 (428 bytes)
//
// 3 xrefs:
// > EditorUI::handleAction @ 0x100162714
// > EditorUI::onPlaytest @ 0x100471578
// > EditorUI::init @ 0x10046f358
//
// This function is hookable on this platform (idp: arm, 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:05:38 +0000
//
__int64 __fastcall EditorUI::onPlaytest(__int64 result, __int64 a2, __n128 a3)
{
__int64 v4; // x19
__int64 v5; // x0
double v6; // d0
int v7; // w23
int v8; // w8
__int64 v9; // x0
int v10; // w8
__int64 v11; // x0
_BOOL4 GameVariable; // w21
double v13; // d0
__int64 v14; // x22
int v15; // w24
__int64 v16; // x0
char *v17; // x1
__int64 v18; // x0
if ( (*(_BYTE *)(result + 1588) & 1) != 0 )
return result;
v4 = result;
v5 = EditorSFXManager::sharedState(a3);
EditorSFXManager::playAction_1(v5, 210);
v7 = *(_DWORD *)(*(_QWORD *)(v4 + 1440) + 1972LL);
if ( v7 == 1 )
{
*(_BYTE *)(v4 + 616) = 0;
}
else
{
GJBaseGameLayer::pauseAudio();
v8 = *(_DWORD *)(*(_QWORD *)(v4 + 1440) + 1972LL);
*(_BYTE *)(v4 + 616) = 0;
if ( v8 != 1 )
EditorUI::toggleMode(v4, *(_QWORD *)(v4 + 936));
}
EditorUI::deselectAll(v4, v6);
v9 = *(_QWORD *)(v4 + 1440);
v10 = *(_DWORD *)(v9 + 1972);
if ( v10 )
{
if ( v10 == 2 )
{
sub_100405110(v9);
}
else if ( v10 == 1 )
{
sub_100405040(v9);
}
goto LABEL_13;
}
*(float *)(v4 + 1584) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v9 + 3920) + 168LL))(*(_QWORD *)(v9 + 3920));
LevelEditorLayer::onPlaytest(*(_QWORD *)(v4 + 1440));
if ( !*(_QWORD *)(*(_QWORD *)(v4 + 1440) + 12432LL) )
{
LABEL_13:
GameVariable = 0;
goto LABEL_14;
}
v11 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v11, "0150");
LABEL_14:
v13 = EditorUI::showUI(v4, *(_DWORD *)(*(_QWORD *)(v4 + 1440) + 1972LL) != 1);
v14 = (*(__int64 (__fastcall **)(_QWORD, double))(**(_QWORD **)(v4 + 1000) + 1072LL))(*(_QWORD *)(v4 + 1000), v13);
v15 = *(_DWORD *)(*(_QWORD *)(v4 + 1440) + 1972LL);
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( v15 == 1 )
v17 = "GJ_pauseEditorBtn_001.png";
else
v17 = "GJ_playEditorBtn_001.png";
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v17);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v14 + 1160LL))(v14, v18);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v4 + 1008) + 344LL))(
*(_QWORD *)(v4 + 1008),
(*(_BYTE *)(v4 + 1589) & 1) == 0);
result = EditorUI::updatePlaybackBtn(v4);
if ( GameVariable )
result = EditorUI::onPlaytest(v4, a2);
if ( v7 != 1 )
*(_BYTE *)(*(_QWORD *)(v4 + 1440) + 13806LL) = 1;
return result;
}