//
// EditorUI::setIDPopupClosed from 0x6be664 to 0x6be8e0 (636 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'EditorUI::setIDPopupClosed @ 0x6be8e4
// > ??> @ 0x79080
// > ??> @ 0x1156b28
//
// 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 EditorUI::setIDPopupClosed(EditorUI *a1, SetIDPopup *a2, int a3)
{
GameManager *v6; // x0
void *v7; // x0
char *v8; // x0
unsigned int *v9; // x22
int v10; // w1
size_t v11; // x0
GameManager *v12; // x0
ButtonSprite *m_deleteGroupSprite; // x19
cocos2d::CCString *v14; // x0
const char *CString; // x0
unsigned int *v16; // x1
int v17; // w2
__int64 v18; // [xsp+0h] [xbp+0h] BYREF
const char *v19; // [xsp+48h] [xbp+48h]
char *v20; // [xsp+58h] [xbp+58h] BYREF
__int64 v21; // [xsp+60h] [xbp+60h] BYREF
if ( a2->getTag(a2) == 1 )
{
v12 = GameManager::sharedState();
GameManager::setIntGameVariable(v12, "0133", a3);
m_deleteGroupSprite = a1->m_deleteGroupSprite;
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a3);
CString = cocos2d::CCString::getCString(v14);
ButtonSprite::setString(m_deleteGroupSprite, CString);
}
else if ( a2->getTag(a2) == 2 )
{
v6 = GameManager::sharedState();
GameManager::setIntGameVariable(v6, "0139", a3);
sub_D153B8((unsigned int)&v18 + 88, &byte_F288A0);
if ( a3 > 999 )
{
v19 = GJSpecialColorSelect::textForColorIdx(a3);
v11 = strlen(v19);
sub_D1798C(&v20, v19, v11);
}
else
{
GameToolbox::intToString(&v21, (GameToolbox *)(unsigned int)a3);
sub_D163D4(&v20, &v21);
v7 = (void *)(v21 - 24);
if ( (__int64 *)(v21 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v16 = (unsigned int *)(v21 - 8);
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = *(_DWORD *)(v21 - 8);
*(_DWORD *)(v21 - 8) = v17 - 1;
}
if ( v17 <= 0 )
operator delete(v7);
}
}
ButtonSprite::setString(a1->m_deleteColorSprite, v20);
v8 = v20 - 24;
if ( v20 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v20 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v20 - 2);
*((_DWORD *)v20 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v8);
}
}
else if ( a2->getTag(a2) == 3 )
{
EditorUI::findAndSelectObject(
a1,
a3,
(bool)a2[1].FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
}
}