//
// EditorUI::onPlaytest from 0x489e30 to 0x489f66 (310 bytes)
//
// 2 xrefs:
// > EditorUI::onPlaytest @ 0x489f4c
// > EditorUI::handleAction @ 0x6f286a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:49:28 +0000
//
unsigned __int8 *__fastcall EditorUI::onPlaytest(unsigned __int8 *this, cocos2d::CCObject *a2)
{
unsigned __int8 *v2; // r4
int v3; // r5
EditorSFXManager *v5; // r0
GJBaseGameLayer *v6; // r0
int v7; // r8
int v8; // r3
int v9; // r0
int v10; // r3
int GameVariable; // r5
GameManager *v12; // r0
GameManager *v13; // r0
cocos2d::CCSpriteFrameCache *v14; // r0
cocos2d::CCSpriteFrameCache *v15; // r6
void (__fastcall *v16)(cocos2d::CCSpriteFrameCache *, int); // r9
cocos2d::CCSpriteFrameCache *v17; // r0
const char *v18; // r1
int v19; // r0
v2 = this;
v3 = *(this + 1052);
if ( *(this + 1052) )
return this;
v5 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)this);
EditorSFXManager::playAction(v5, 210);
v6 = *((GJBaseGameLayer **)v2 + 236);
if ( *((_DWORD *)v6 + 357) == 1 )
{
v7 = v3;
}
else
{
GJBaseGameLayer::pauseAudio(v6);
v7 = 1;
}
v8 = *((_DWORD *)v2 + 236);
v2[456] = v3;
if ( *(_DWORD *)(v8 + 1428) != 1 )
EditorUI::toggleMode((EditorUI *)v2, *((cocos2d::CCObject **)v2 + 172));
EditorUI::deselectAll((EditorUI *)v2);
v9 = *((_DWORD *)v2 + 236);
v10 = *(_DWORD *)(v9 + 1428);
switch ( v10 )
{
case 1:
LevelEditorLayer::onPausePlaytest((cocos2d::CCNode **)v9);
break;
case 2:
LevelEditorLayer::onResumePlaytest((cocos2d::CCNode **)v9);
break;
case 0:
*((_DWORD *)v2 + 262) = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v9 + 2436) + 84))(*(_DWORD *)(v9 + 2436));
v12 = (GameManager *)LevelEditorLayer::onPlaytest(*((LevelEditorLayer **)v2 + 236));
if ( *(_DWORD *)(*((_DWORD *)v2 + 236) + 10720) )
{
v13 = (GameManager *)GameManager::sharedState(v12);
GameVariable = GameManager::getGameVariable(v13, "0150");
goto LABEL_15;
}
break;
}
GameVariable = 0;
LABEL_15:
EditorUI::showUI((cocos2d::CCArray **)v2, *(_DWORD *)(*((_DWORD *)v2 + 236) + 1428) != 1);
v14 = (cocos2d::CCSpriteFrameCache *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 180) + 536))(*((_DWORD *)v2 + 180));
v15 = v14;
v16 = *(void (__fastcall **)(cocos2d::CCSpriteFrameCache *, int))(*(_DWORD *)v14 + 580);
if ( *(_DWORD *)(*((_DWORD *)v2 + 236) + 1428) == 1 )
{
v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v14);
v18 = "GJ_pauseEditorBtn_001.png";
}
else
{
v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v14);
v18 = "GJ_playEditorBtn_001.png";
}
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v18);
v16(v15, v19);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)v2 + 181) + 172))(*((_DWORD *)v2 + 181), v2[1053] ^ 1);
this = (unsigned __int8 *)EditorUI::updatePlaybackBtn((EditorUI *)v2);
if ( GameVariable )
this = (unsigned __int8 *)EditorUI::onPlaytest((EditorUI *)v2, a2);
if ( v7 )
*(_BYTE *)(*((_DWORD *)v2 + 236) + 11570) = 1;
return this;
}