//
// EditorUI::onPlaytest from 0x7ce688 to 0x7ce880 (504 bytes)
//
// 5 xrefs:
// > EditorUI::onPlaytest @ 0x7ce7e4
// > EditorUI::handleAction @ 0xbd8ab8
// > ??> @ 0x7f0f0
// > EditorUI::init @ 0x7cfa2c
// > ??> @ 0x15434c8
//
// 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 12:54:13 +0000
//
EditorSFXManager *__fastcall EditorUI::onPlaytest(EditorSFXManager *this, cocos2d::CCObject *a2)
{
__int64 v3; // x19
EditorSFXManager *v4; // x0
int v5; // w22
GJBaseGameLayer *v6; // x0
int GameVariable; // w23
__int64 v8; // x0
int v9; // w2
__int64 v10; // x21
cocos2d::CCSpriteFrameCache *v11; // x0
void (__fastcall *v12)(__int64, __int64); // x24
cocos2d::CCSpriteFrameCache *v13; // x0
__int64 v14; // x0
cocos2d::CCSpriteFrameCache *v15; // x0
float v16; // s0
LevelEditorLayer *v17; // x0
__int64 v18; // x0
GameManager *v19; // x0
if ( !*((_BYTE *)this + 1588) )
{
v3 = (__int64)this;
v4 = (EditorSFXManager *)EditorSFXManager::sharedState(this);
v5 = 0;
EditorSFXManager::playAction(v4, 210);
v6 = *(GJBaseGameLayer **)(v3 + 1440);
if ( *((_DWORD *)v6 + 493) != 1 )
{
GJBaseGameLayer::pauseAudio(v6);
v5 = 1;
v6 = *(GJBaseGameLayer **)(v3 + 1440);
}
*(_BYTE *)(v3 + 616) = 0;
if ( *((_DWORD *)v6 + 493) != 1 )
EditorUI::toggleMode((EditorUI *)v3, *(cocos2d::CCObject **)(v3 + 936));
GameVariable = 0;
EditorUI::deselectAll((EditorUI *)v3);
v8 = *(_QWORD *)(v3 + 1440);
v9 = *(_DWORD *)(v8 + 1972);
switch ( v9 )
{
case 1:
LevelEditorLayer::onPausePlaytest((cocos2d::CCNode **)v8);
v9 = *(_DWORD *)(*(_QWORD *)(v3 + 1440) + 1972LL);
break;
case 2:
LevelEditorLayer::onResumePlaytest((cocos2d::CCNode **)v8);
v9 = *(_DWORD *)(*(_QWORD *)(v3 + 1440) + 1972LL);
break;
case 0:
v16 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v8 + 3920) + 168LL))(*(_QWORD *)(v8 + 3920));
v17 = *(LevelEditorLayer **)(v3 + 1440);
*(float *)(v3 + 1584) = v16;
LevelEditorLayer::onPlaytest(v17);
v18 = *(_QWORD *)(v3 + 1440);
if ( *(_QWORD *)(v18 + 12432) )
{
v19 = (GameManager *)GameManager::sharedState((GameManager *)v18);
GameVariable = (unsigned __int8)GameManager::getGameVariable(v19, "0150");
v9 = *(_DWORD *)(*(_QWORD *)(v3 + 1440) + 1972LL);
}
else
{
v9 = *(_DWORD *)(v18 + 1972);
}
break;
}
EditorUI::showUI((cocos2d::CCArray **)v3, v9 != 1);
v10 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 1000) + 1072LL))(*(_QWORD *)(v3 + 1000));
v11 = *(cocos2d::CCSpriteFrameCache **)v10;
v12 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 1160LL);
if ( *(_DWORD *)(*(_QWORD *)(v3 + 1440) + 1972LL) == 1 )
{
v15 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v11);
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v15, "GJ_pauseEditorBtn_001.png");
}
else
{
v13 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v11);
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, "GJ_playEditorBtn_001.png");
}
v12(v10, v14);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v3 + 1008) + 344LL))(
*(_QWORD *)(v3 + 1008),
*(unsigned __int8 *)(v3 + 1589) ^ 1u);
this = (EditorSFXManager *)EditorUI::updatePlaybackBtn((EditorUI *)v3);
if ( GameVariable )
this = (EditorSFXManager *)EditorUI::onPlaytest((EditorUI *)v3, a2);
if ( v5 )
{
this = (EditorSFXManager *)(*(_QWORD *)(v3 + 1440) + 12288LL);
*(_BYTE *)(*(_QWORD *)(v3 + 1440) + 13806LL) = 1;
}
}
return this;
}