//
// EditorWindowPopup::onClose from 0xcda2b0 to 0xcda4d4 (548 bytes)
//
// 7 xrefs:
// > EmotePickerPopup::onClose @ 0xcb8e04
// > ??> @ 0x9e9b0
// > ??> @ 0x14eb538
// > ??> @ 0x14fb378
// > ??> @ 0x14fbbd8
// > ??> @ 0x1501888
// > ??> @ 0x1502488
//
// 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 13:06:32 +0000
//
__int64 __fastcall EditorWindowPopup::onClose(EditorWindowPopup *this, cocos2d::CCObject *a2)
{
EditorUI *v4; // x0
GameManager *v6; // x0
int v7; // w28
int v8; // s8
int v9; // s9
int v10; // s10
int v11; // s11
int v12; // s12
int v13; // w24
char v14; // w25
__int64 v15; // x0
__int64 v16; // x19
__int64 v17; // x26
int v18; // w21
__int64 **v19; // x27
int v20; // w0
bool v21; // cc
__int64 v22; // x0
int v23; // w0
__int64 *v24; // x1
__int64 v25; // x0
_BYTE v26[8]; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v27; // [xsp+B0h] [xbp+B0h] BYREF
v4 = *((EditorUI **)this + 127);
if ( v4 )
EditorUI::windowClosed(v4, this);
EditorWindowPopup::dismissDropdowns(this);
if ( *((_DWORD *)this + 288) )
{
EditorWindowPopup::syncWindowCenter(this);
if ( *((_BYTE *)this + 598) )
{
EditorWindowPopup::contentCenter((cocos2d::CCPoint *)v26);
cocos2d::CCPoint::operator+(&v27, (char *)this + 600);
cocos2d::CCPoint::operator=((char *)this + 1068, &v27);
}
v6 = *((GameManager **)this + 130);
v7 = *((_DWORD *)this + 267);
v8 = *((_DWORD *)this + 268);
v9 = *((_DWORD *)this + 264);
v10 = *((_DWORD *)this + 265);
v11 = *((_DWORD *)this + 266);
if ( v6 )
v12 = *((_DWORD *)v6 + 109);
else
v12 = 0;
v13 = *((_DWORD *)this + 289);
v14 = *((_BYTE *)this + 1160);
v15 = GameManager::sharedState(v6);
v16 = *(_QWORD *)(v15 + 1120);
v17 = v15;
v18 = *((_DWORD *)this + 288);
v19 = (__int64 **)(v15 + 1120);
if ( v16 )
{
v20 = *(_DWORD *)(v16 + 28);
v21 = v18 <= v20;
if ( v18 >= v20 )
goto LABEL_13;
while ( 1 )
{
v22 = *(_QWORD *)v16;
if ( !*(_QWORD *)v16 )
break;
while ( 1 )
{
v16 = v22;
v23 = *(_DWORD *)(v22 + 28);
v21 = v18 <= v23;
if ( v18 < v23 )
break;
LABEL_13:
if ( v21 )
goto LABEL_20;
v22 = *(_QWORD *)(v16 + 8);
if ( !v22 )
{
v27 = v16;
v19 = (__int64 **)(v16 + 8);
goto LABEL_17;
}
}
}
v27 = v16;
v19 = (__int64 **)v16;
}
else
{
v27 = v15 + 1120;
}
LABEL_17:
v16 = operator new(0x40u);
*(_DWORD *)(v16 + 28) = v18;
*(_DWORD *)(v16 + 56) = 0;
v24 = (__int64 *)v16;
*(_BYTE *)(v16 + 60) = 0;
*(_DWORD *)(v16 + 32) = 0;
*(_DWORD *)(v16 + 36) = 0;
*(_DWORD *)(v16 + 40) = 0;
*(_DWORD *)(v16 + 44) = 0;
*(_DWORD *)(v16 + 52) = 0;
*(float *)(v16 + 48) = 1.0;
*(_QWORD *)(v16 + 16) = v27;
*(_QWORD *)v16 = 0;
*(_QWORD *)(v16 + 8) = 0;
*v19 = (__int64 *)v16;
v25 = **(_QWORD **)(v17 + 1112);
if ( v25 )
{
*(_QWORD *)(v17 + 1112) = v25;
v24 = *v19;
}
std::__tree_balance_after_insert *>(*(__int64 **)(v17 + 1120), v24);
++*(_QWORD *)(v17 + 1128);
LABEL_20:
*(_DWORD *)(v16 + 56) = v13;
*(_BYTE *)(v16 + 60) = v14;
*(_DWORD *)(v16 + 32) = v7;
*(_DWORD *)(v16 + 36) = v8;
*(_DWORD *)(v16 + 40) = v9;
*(_DWORD *)(v16 + 44) = v10;
*(_DWORD *)(v16 + 48) = v11;
*(_DWORD *)(v16 + 52) = v12;
}
SetupTriggerPopup::onClose((GameObject **)this, a2);
return _stack_chk_guard;
}