//
// SetGroupIDLayer::onClose from 0x6396e2 to 0x639820 (318 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::onAnim @ 0x63983e
// > SetGroupIDLayer::keyBackClicked @ 0x639844
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:55:23 +0000
//
int __fastcall SetGroupIDLayer::onClose(cocos2d::CCArray **this, cocos2d::CCObject *a2)
{
int v3; // r0
GameManager *v4; // r0
unsigned int v5; // r5
int v6; // r0
int v7; // r0
GameManager *updated; // r0
int v9; // r0
int v10; // r0
*(_DWORD *)(GameManager::sharedState((GameManager *)this) + 764) = *(this + 144);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 138) + 580))(*(this + 138), 0);
*((_DWORD *)*(this + 138) + 105) = 0;
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 135) + 580))(*(this + 135), 0);
*((_DWORD *)*(this + 135) + 105) = 0;
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 136) + 580))(*(this + 136), 0);
*((_DWORD *)*(this + 136) + 105) = 0;
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 137) + 580))(*(this + 137), 0);
*((_DWORD *)*(this + 137) + 105) = 0;
v3 = (int)*(this + 139);
if ( v3 )
{
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v3 + 580))(v3, 0);
*((_DWORD *)*(this + 139) + 105) = 0;
}
v4 = *(this + 140);
if ( v4 )
{
v4 = (GameManager *)(*(int (__fastcall **)(GameManager *, _DWORD))(*(_DWORD *)v4 + 580))(v4, 0);
*((_DWORD *)*(this + 140) + 105) = 0;
}
v5 = (unsigned int)*(this + 131);
if ( v5 )
{
*(_BYTE *)(v5 + 1004) = 1;
}
else if ( *(this + 132) )
{
while ( 1 )
{
v4 = (GameManager *)cocos2d::CCArray::count(*(this + 132));
if ( v5 >= (unsigned int)v4 )
break;
v6 = cocos2d::CCArray::objectAtIndex(*(this + 132), v5++);
*(_BYTE *)(v6 + 1004) = 1;
}
}
v7 = GameManager::sharedState(v4);
updated = (GameManager *)EditorUI::updateObjectInfoLabel(*(cocos2d::CCArray ***)(*(_DWORD *)(v7 + 408) + 11856));
if ( *((_BYTE *)this + 616) )
{
v9 = GameManager::sharedState(updated);
updated = (GameManager *)LevelEditorLayer::resetToggledGroupsAndObjects(*(LevelEditorLayer **)(v9 + 408));
}
if ( *(this + 131) && (*((_BYTE *)this + 608) || *((_BYTE *)this + 572)) )
{
v10 = GameManager::sharedState(updated);
updated = (GameManager *)LevelEditorLayer::timeObjectChanged(*(_DWORD *)(v10 + 408));
}
*(_BYTE *)(*(_DWORD *)(GameManager::sharedState(updated) + 408) + 12278) = 1;
(*((void (__fastcall **)(cocos2d::CCArray **, _DWORD))*this + 134))(this, 0);
return (*((int (__fastcall **)(cocos2d::CCArray **, int))*this + 66))(this, 1);
}