//
// EditorUI::onPause from 0x1401accb0 to 0x1401ad151 (1185 bytes)
//
// 4 xrefs:
// > EditorUI::keyBackClicked @ 0x1401c1a89
// > EditorUI::handleAction @ 0x1401c1df4
// > EditorUI::init @ 0x1401ab166
// > ??> @ 0x140919d24
//
// 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 11:27:54 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall EditorUI::onPause(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdx
__int64 v4; // rcx
__int64 v5; // rax
__int64 v6; // rdx
const struct cocos2d::CCPoint *v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rbx
__int64 v11; // rcx
int v12; // ebx
cocos2d::CCArray *v13; // rcx
signed int v14; // ecx
unsigned int i; // ebp
__int64 v16; // rcx
__int64 v17; // rcx
int v18; // edi
cocos2d::CCArray *v19; // rcx
signed int v20; // ecx
__int64 v21; // rbx
cocos2d::CCString *v22; // rax
const char *CString; // rax
size_t v24; // r8
__int64 v25; // rbx
struct cocos2d::CCString *v26; // rax
void *v27; // rcx
__int64 v28; // r14
__int64 v29; // rbx
_QWORD *v30; // rdi
_QWORD *v31; // [rsp+30h] [rbp-48h] BYREF
__int128 v32; // [rsp+38h] [rbp-40h] BYREF
__int64 v33; // [rsp+48h] [rbp-30h]
unsigned __int64 v34; // [rsp+50h] [rbp-28h]
if ( !*(_BYTE *)(a1 + 1660) && !*(_BYTE *)(cocos2d::CCDirector::sharedDirector(a1) + 176) )
{
v2 = EditorSFXManager::sharedState();
EditorSFXManager::playAction(v2, 221);
if ( *(_BYTE *)(a1 + 1661) )
{
*(_WORD *)(a1 + 1661) = 0;
LOBYTE(v3) = 1;
EditorUI::showUI(a1, v3);
}
*(_BYTE *)(a1 + 736) = 0;
v4 = *(_QWORD *)(a1 + 1512);
if ( !*(_DWORD *)(v4 + 2204) )
*(float *)(a1 + 1656) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + 4296) + 168LL))(*(_QWORD *)(v4 + 4296));
LevelEditorLayer::updateKeyframeObjects(*(_QWORD *)(a1 + 1512));
v5 = EditorSFXManager::sharedState();
EditorSFXManager::playAction(v5, 211);
LOBYTE(v6) = 1;
EditorUI::showUI(a1, v6);
if ( *(_BYTE *)(a1 + 664) )
EditorUI::onPlayback(a1, 0);
LevelEditorLayer::onStopPlaytest(*(_QWORD *)(a1 + 1512));
EditorUI::playtestStopped(a1);
EditorUI::updatePlaybackBtn(a1);
v7 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1512)
+ 4296LL)
+ 200LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1512)
+ 4296LL));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, v7);
cocos2d::CCPoint::operator=(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1196LL, v8);
v9 = *(_QWORD *)(a1 + 1512);
v10 = *(_QWORD *)(v9 + 2168);
*(float *)(v10 + 1204) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v9 + 4296) + 168LL))(*(_QWORD *)(v9 + 4296));
v11 = *(_QWORD *)(*(_QWORD *)(a1 + 872) + 344LL);
v12 = *(_DWORD *)(v11 + 588);
if ( *(_BYTE *)(v11 + 456) )
v13 = *(cocos2d::CCArray **)(v11 + 448);
else
v13 = *(cocos2d::CCArray **)(v11 + 480);
v14 = cocos2d::CCArray::count(v13);
if ( v12 <= 0 )
{
for ( ; v12 < 0; v12 += v14 )
;
}
else
{
v12 %= v14;
}
*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1212LL) = v12;
*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1208LL) = *(_DWORD *)(a1 + 1608);
*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1216LL) = *(__int16 *)(*(_QWORD *)(a1 + 1512) + 14866LL);
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 1240)); ++i )
{
v17 = *((_QWORD *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 1240), i) + 43);
v18 = *(_DWORD *)(v17 + 588);
if ( *(_BYTE *)(v17 + 456) )
v19 = *(cocos2d::CCArray **)(v17 + 448);
else
v19 = *(cocos2d::CCArray **)(v17 + 480);
v20 = cocos2d::CCArray::count(v19);
if ( v18 <= 0 )
{
for ( ; v18 < 0; v18 += v20 )
;
}
else
{
v18 %= v20;
}
v21 = *(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL);
v22 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, i);
CString = cocos2d::CCString::getCString(v22);
v32 = 0;
v33 = 0;
v34 = 0;
v24 = -1;
do
++v24;
while ( CString[v24] );
sub_14003D230(&v32, CString, v24);
v25 = *(_QWORD *)(v21 + 320);
v26 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v18);
cocos2d::CCDictionary::setObject(v25, v26, &v32);
if ( v34 > 0xF )
{
v27 = (void *)v32;
if ( v34 + 1 >= 0x1000 )
{
v27 = *(void **)(v32 - 8);
if ( (unsigned __int64)(v32 - (_QWORD)v27 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v27);
}
}
v28 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(v16) + 272);
v29 = *(_QWORD *)(a1 + 1512);
v30 = operator new(0x280u);
v31 = v30;
CCBlockLayer::CCBlockLayer((__int64)v30);
*v30 = &EditorPauseLayer::`vftable';
v30[40] = &EditorPauseLayer::`vftable';
v30[41] = &EditorPauseLayer::`vftable';
v30[42] = &EditorPauseLayer::`vftable';
v30[43] = &EditorPauseLayer::`vftable';
v30[44] = &EditorPauseLayer::`vftable';
v30[51] = &EditorPauseLayer::`vftable';
v30[54] = &EditorPauseLayer::`vftable';
v30[69] = &EditorPauseLayer::`vftable';
v30[70] = &EditorPauseLayer::`vftable';
*((_BYTE *)v30 + 568) = 0;
v30[72] = 0;
v30[77] = 0;
v30[78] = 0;
v30[79] = 0;
if ( EditorPauseLayer::init((cocos2d::CCLayerColor *)v30, v29) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v30);
}
else
{
(*(void (__fastcall **)(_QWORD *, __int64))(*v30 + 8LL))(v30, 1);
v30 = nullptr;
}
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)v28 + 456LL))(v28, v30, 100);
*(_BYTE *)(a1 + 1660) = 1;
}
}