//
// EditorUI::updateDeleteButtons from 0x1400e7680 to 0x1400e7e83 (2051 bytes)
//
// 4 xrefs:
// > EditorUI::updateButtons @ 0x1400e1f68
// > EditorUI::resetUI @ 0x1400e4e47
// > EditorUI::onUpdateDeleteFilter @ 0x1400e7679
// > ??> @ 0x1406c8de4
//
// 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
//
// Hidden C++ exception states: #wind=3
void EditorUI::updateDeleteButtons(EditorUI *a1)
{
GameManager *v2; // rcx
int IntGameVariable; // r15d
const char *v4; // rdi
const char *v5; // rbx
ButtonSprite *v6; // rax
const char *v7; // rbx
ButtonSprite *v8; // rax
const char *v9; // rbx
ButtonSprite *v10; // rax
ButtonSprite *v11; // rax
size_t v12; // r14
GameManager *v13; // rcx
ObjectToolbox *v14; // rax
_QWORD *v15; // rax
size_t v16; // r8
__int64 v17; // rcx
void **v18; // rdi
cocos2d::CCSprite_vtbl *v19; // rbx
cocos2d::CCSpriteFrameCache *v20; // rax
struct cocos2d::CCSpriteFrame *v21; // rax
_BOOL8 v22; // rdx
void *v23; // rcx
__int64 v24; // r8
ObjectToolbox *v25; // rax
_QWORD *v26; // rax
size_t v27; // r8
__int64 v28; // rcx
void **v29; // rdi
cocos2d::CCSprite_vtbl *v30; // rbx
cocos2d::CCSpriteFrameCache *v31; // rax
struct cocos2d::CCSpriteFrame *v32; // rax
_BOOL8 v33; // rdx
__int64 v34; // r8
ObjectToolbox *v35; // rax
_QWORD *v36; // rax
__int64 v37; // rcx
void **v38; // rdi
cocos2d::CCSprite_vtbl *v39; // rbx
cocos2d::CCSpriteFrameCache *v40; // rax
struct cocos2d::CCSpriteFrame *v41; // rax
_BOOL8 v42; // rdx
void *v43; // rcx
bool v44; // dl
__int16 *v45; // r13
__int16 *v46; // rax
__int16 v47; // bx
char v48; // di
cocos2d::CCNode *v49; // r14
cocos2d::CCComponentContainer *m_pComponentContainer; // rcx
__int64 v51; // rcx
cocos2d::CCNode_vtbl *v52; // rcx
bool v53; // dl
__int16 *v54; // rax
__int16 v55; // bx
char v56; // di
cocos2d::CCNode *v57; // r14
cocos2d::CCComponentContainer *v58; // rcx
__int64 v59; // rcx
cocos2d::CCNode_vtbl *v60; // rcx
__int16 v62; // bx
char v63; // di
cocos2d::CCNode *v64; // rsi
cocos2d::CCComponentContainer *v65; // rcx
__int64 v66; // rcx
cocos2d::CCNode_vtbl *v67; // rcx
_QWORD v68[2]; // [rsp+20h] [rbp-50h] BYREF
void *v69; // [rsp+30h] [rbp-40h]
void *Block[2]; // [rsp+38h] [rbp-38h] BYREF
__int64 v71; // [rsp+48h] [rbp-28h]
unsigned __int64 v72; // [rsp+50h] [rbp-20h]
v2 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v69 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v69);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = (GameManager *)qword_1406C2ED8;
}
IntGameVariable = GameManager::getIntGameVariable(v2, "0005");
LODWORD(v69) = IntGameVariable;
v4 = "GJ_button_04.png";
v5 = "GJ_button_04.png";
if ( !IntGameVariable )
v5 = "GJ_button_02.png";
v6 = (ButtonSprite *)a1->m_deleteFilterNone->getNormalImage(a1->m_deleteFilterNone);
ButtonSprite::updateBGImage(v6, v5);
v7 = "GJ_button_04.png";
if ( IntGameVariable == 2 )
v7 = "GJ_button_02.png";
v8 = (ButtonSprite *)a1->m_deleteFilterStatic->getNormalImage(a1->m_deleteFilterStatic);
ButtonSprite::updateBGImage(v8, v7);
v9 = "GJ_button_04.png";
if ( IntGameVariable == 1 )
v9 = "GJ_button_02.png";
v10 = (ButtonSprite *)a1->m_deleteFilterDetails->getNormalImage(a1->m_deleteFilterDetails);
ButtonSprite::updateBGImage(v10, v9);
if ( IntGameVariable == 3 )
v4 = "GJ_button_02.png";
v11 = (ButtonSprite *)a1->m_deleteFilterCustom->getNormalImage(a1->m_deleteFilterCustom);
ButtonSprite::updateBGImage(v11, v4);
v12 = -1;
if ( IntGameVariable == 3 )
{
v13 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v68[0] = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v68[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v13 = (GameManager *)qword_1406C2ED8;
}
LODWORD(v68[0]) = GameManager::getIntGameVariable(v13, "0006");
v14 = ObjectToolbox::sharedState();
v15 = (_QWORD *)sub_1401D0660(&v14->m_allKeys, v68);
if ( v15[3] > 0xFu )
v15 = (_QWORD *)*v15;
*(_OWORD *)Block = 0;
v71 = 0;
v72 = 0;
v16 = -1;
do
++v16;
while ( *((_BYTE *)v15 + v16) );
sub_14003A930(Block, v15, v16);
v18 = Block;
if ( v72 > 0xF )
v18 = (void **)Block[0];
v19 = a1->m_customDeleteSprite->__vftable;
v20 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v17);
v21 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v20, (const char *)v18);
v19->setDisplayFrame(a1->m_customDeleteSprite, v21);
LOBYTE(v22) = 1;
a1->m_customDeleteSprite->setVisible(a1->m_customDeleteSprite, v22);
if ( v72 > 0xF )
{
v23 = Block[0];
if ( v72 + 1 >= 0x1000 )
{
v23 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v23 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
LABEL_24:
j_j_free(v23);
}
}
else if ( !a1->m_selectedObject || GameObject::isSpecialObject(a1->m_selectedObject) )
{
a1->m_customDeleteSprite->setVisible(a1->m_customDeleteSprite, 0);
}
else
{
LODWORD(v68[0]) = *(_DWORD *)(v24 + 1036);
v25 = ObjectToolbox::sharedState();
v26 = (_QWORD *)sub_1401D0660(&v25->m_allKeys, v68);
if ( v26[3] > 0xFu )
v26 = (_QWORD *)*v26;
*(_OWORD *)Block = 0;
v71 = 0;
v72 = 0;
v27 = -1;
do
++v27;
while ( *((_BYTE *)v26 + v27) );
sub_14003A930(Block, v26, v27);
v29 = Block;
if ( v72 > 0xF )
v29 = (void **)Block[0];
v30 = a1->m_customDeleteSprite->__vftable;
v31 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v28);
v32 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v31, (const char *)v29);
v30->setDisplayFrame(a1->m_customDeleteSprite, v32);
LOBYTE(v33) = 1;
a1->m_customDeleteSprite->setVisible(a1->m_customDeleteSprite, v33);
if ( v72 > 0xF )
{
v23 = Block[0];
if ( v72 + 1 >= 0x1000 )
{
v23 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v23 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
goto LABEL_24;
}
}
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_customDeleteSprite->setScale_0)(a1->m_customDeleteSprite);
if ( a1->m_customDeleteSprite->getScale(a1->m_customDeleteSprite) <= 1.0 )
a1->m_customDeleteSprite->getScale(a1->m_customDeleteSprite);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_customDeleteSprite->setScale_0)(a1->m_customDeleteSprite);
if ( !a1->m_selectedObject
|| cocos2d::CCArray::count(a1->m_selectedObjects)
|| GameObject::isSpecialObject(a1->m_selectedObject) )
{
a1->m_deleteAllSprite->setVisible(a1->m_deleteAllSprite, 0);
}
else
{
LODWORD(v68[0]) = *(_DWORD *)(v34 + 1036);
v35 = ObjectToolbox::sharedState();
v36 = (_QWORD *)sub_1401D0660(&v35->m_allKeys, v68);
if ( v36[3] > 0xFu )
v36 = (_QWORD *)*v36;
*(_OWORD *)Block = 0;
v71 = 0;
v72 = 0;
do
++v12;
while ( *((_BYTE *)v36 + v12) );
sub_14003A930(Block, v36, v12);
v38 = Block;
if ( v72 > 0xF )
v38 = (void **)Block[0];
v39 = a1->m_deleteAllSprite->__vftable;
v40 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v37);
v41 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v40, (const char *)v38);
v39->setDisplayFrame(a1->m_deleteAllSprite, v41);
LOBYTE(v42) = 1;
a1->m_deleteAllSprite->setVisible(a1->m_deleteAllSprite, v42);
if ( v72 > 0xF )
{
v43 = Block[0];
if ( v72 + 1 >= 0x1000 )
{
v43 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v43 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v43);
}
}
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_deleteAllSprite->setScale_0)(a1->m_deleteAllSprite);
if ( a1->m_deleteAllSprite->getScale(a1->m_deleteAllSprite) <= 1.0 )
a1->m_deleteAllSprite->getScale(a1->m_deleteAllSprite);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_deleteAllSprite->setScale_0)(a1->m_deleteAllSprite);
v44 = a1->m_selectedObject || cocos2d::CCArray::count(a1->m_selectedObjects);
v45 = &word_140529A40;
v46 = &word_140529A40;
if ( v44 )
v46 = &word_140529A48;
v47 = *v46;
v48 = *((_BYTE *)v46 + 2);
((void (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_deleteButton->setEnabled)(a1->m_deleteButton);
v49 = a1->m_deleteButton->getNormalImage(a1->m_deleteButton);
LOWORD(v68[0]) = v47;
BYTE2(v68[0]) = v48;
m_pComponentContainer = v49[1].m_pComponentContainer;
if ( m_pComponentContainer )
((void (__fastcall *)(cocos2d::CCDictionary **, _QWORD *))m_pComponentContainer[15].m_pComponents->__vftable)(
&m_pComponentContainer[15].m_pComponents,
v68);
v51 = *(_QWORD *)&v49[1].m_bUseChildIndex;
if ( v51 )
(**(void (__fastcall ***)(__int64, _QWORD *))(v51 + 320))(v51 + 320, v68);
v52 = *(cocos2d::CCNode_vtbl **)&v49[2].m_uID;
if ( v52 || (v52 = v49[2].__vftable) != nullptr )
(*(void (__fastcall **)(__int64, _QWORD *))v52->setVisible)((__int64)&v52->setVisible, v68);
v53 = a1->m_selectedObject && !cocos2d::CCArray::count(a1->m_selectedObjects);
v54 = &word_140529A40;
if ( v53 )
v54 = &word_140529A48;
v55 = *v54;
v56 = *((_BYTE *)v54 + 2);
((void (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_deleteAllButton->setEnabled)(a1->m_deleteAllButton);
v57 = a1->m_deleteAllButton->getNormalImage(a1->m_deleteAllButton);
LOWORD(v68[0]) = v55;
BYTE2(v68[0]) = v56;
v58 = v57[1].m_pComponentContainer;
if ( v58 )
((void (__fastcall *)(cocos2d::CCDictionary **, _QWORD *))v58[15].m_pComponents->__vftable)(
&v58[15].m_pComponents,
v68);
v59 = *(_QWORD *)&v57[1].m_bUseChildIndex;
if ( v59 )
(**(void (__fastcall ***)(__int64, _QWORD *))(v59 + 320))(v59 + 320, v68);
v60 = *(cocos2d::CCNode_vtbl **)&v57[2].m_uID;
if ( v60 || (v60 = v57[2].__vftable) != nullptr )
(*(void (__fastcall **)(__int64, _QWORD *))v60->setVisible)((__int64)&v60->setVisible, v68);
if ( (_DWORD)v69 == 3 || a1->m_selectedObject && !cocos2d::CCArray::count(a1->m_selectedObjects) )
v45 = &word_140529A48;
v62 = *v45;
v63 = *((_BYTE *)v45 + 2);
((void (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_deleteFilterCustom->setEnabled)(a1->m_deleteFilterCustom);
v64 = a1->m_deleteFilterCustom->getNormalImage(a1->m_deleteFilterCustom);
LOWORD(v68[0]) = v62;
BYTE2(v68[0]) = v63;
v65 = v64[1].m_pComponentContainer;
if ( v65 )
((void (__fastcall *)(cocos2d::CCDictionary **, _QWORD *))v65[15].m_pComponents->__vftable)(
&v65[15].m_pComponents,
v68);
v66 = *(_QWORD *)&v64[1].m_bUseChildIndex;
if ( v66 )
(**(void (__fastcall ***)(__int64, _QWORD *))(v66 + 320))(v66 + 320, v68);
v67 = *(cocos2d::CCNode_vtbl **)&v64[2].m_uID;
if ( v67 || (v67 = v64[2].__vftable) != nullptr )
(*(void (__fastcall **)(__int64, _QWORD *))v67->setVisible)((__int64)&v67->setVisible, v68);
}