//
// EditorUI::onPause from 0x1003e41f0 to 0x1003e435c (364 bytes)
//
// 4 xrefs:
// > EditorUI::keyBackClicked @ 0x1003ef050
// > sub_1003EF054 @ 0x1003ef058
// > EditorUI::keyDown @ 0x1003f99bc
// > EditorUI::init @ 0x1003c5f7c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall EditorUI::onPause(EditorUI *a1, cocos2d::CCObject *a2)
{
LevelEditorLayer *m_editorLayer; // x0
cocos2d::CCObject *v4; // x1
LevelEditorLayer *v5; // x8
GJGameLevel *m_level; // x20
__int64 *v7; // x0
double v8; // d0
LevelEditorLayer *v9; // x8
GJGameLevel *v10; // x20
GJGameLevel *v11; // x20
LevelEditorLayer *v12; // x8
GJGameLevel *v13; // x9
unsigned int v14; // w20
EditButtonBar *v15; // x0
GJGameLevel *v16; // x21
int Page; // w0
EditorPauseLayer *v18; // x20
__int64 v19; // x0
__int64 v20; // [xsp+8h] [xbp-28h] BYREF
if ( !a1->m_isPaused )
{
m_editorLayer = a1->m_editorLayer;
if ( m_editorLayer->m_playbackMode == Not )
{
a1->m_editorZoom = ((float (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCObject *))m_editorLayer->m_objectLayer->getScale)(
m_editorLayer->m_objectLayer,
a2);
m_editorLayer = a1->m_editorLayer;
}
LevelEditorLayer::updateKeyframeObjects(m_editorLayer);
EditorUI::onStopPlaytest(a1, v4);
EditorUI::updatePlaybackBtn(a1);
v5 = a1->m_editorLayer;
m_level = v5->m_level;
v7 = (__int64 *)((__int64 (__fastcall *)(cocos2d::CCLayer *))v5->m_objectLayer->getPosition)(v5->m_objectLayer);
sub_1000229B8(&v20, v7);
v8 = sub_1000229D0(&m_level->m_lastCameraPos, (double *)&v20);
v9 = a1->m_editorLayer;
v10 = v9->m_level;
v10->m_lastEditorZoom = ((float (__fastcall *)(cocos2d::CCLayer *, double))v9->m_objectLayer->getScale)(
v9->m_objectLayer,
v8);
v11 = a1->m_editorLayer->m_level;
v11->m_lastBuildPage = EditButtonBar::getPage(a1->m_createButtonBar);
v12 = a1->m_editorLayer;
v13 = v12->m_level;
v13->m_lastBuildTab = a1->m_selectedTab;
v13->m_lastBuildGroupID = v12->m_currentLayer;
if ( (unsigned int)sub_10024A36C((__int64)a1->m_createButtonBars) )
{
v14 = 0;
do
{
v15 = (EditButtonBar *)sub_10024A388((__int64)a1->m_createButtonBars, v14);
v16 = a1->m_editorLayer->m_level;
Page = EditButtonBar::getPage(v15);
GJGameLevel::setLastBuildPageForTab(v16, Page, v14++);
}
while ( v14 < (unsigned int)sub_10024A36C((__int64)a1->m_createButtonBars) );
}
v18 = EditorPauseLayer::create(a1->m_editorLayer);
v19 = ((__int64 (__fastcall *)(EditorUI *))a1->getParent)(a1);
(*(void (__fastcall **)(__int64, EditorPauseLayer *, __int64))(*(_QWORD *)v19 + 448LL))(v19, v18, 100);
a1->m_isPaused = 1;
}
}