//
// LevelBrowserLayer::deleteSelected from 0x100491630 to 0x100491726 (246 bytes)
//
// 1 xrefs:
// > LevelBrowserLayer::FLAlert_Clicked @ 0x1004917ca
//
// 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 __fastcall LevelBrowserLayer::deleteSelected(LevelBrowserLayer *a1)
{
__int64 v1; // rsi
__int64 v2; // r14
cocos2d::CCArray *m_levels; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r15
unsigned __int64 v6; // r12
cocos2d::CCObject *v7; // rsi
unsigned int *v8; // rax
GJGameLevel **v9; // r15
unsigned __int64 v10; // r12
GJGameLevel *v11; // r14
GameLevelManager *v12; // rax
if ( a1->m_levels )
{
v2 = sub_10071F9E0(a1, v1);
m_levels = a1->m_levels;
if ( m_levels )
{
data = m_levels->data;
if ( data->num )
{
arr = data->arr;
v6 = (unsigned __int64)&arr[data->num - 1];
do
{
v7 = *arr;
if ( !*arr )
break;
if ( HIBYTE(v7[11].m_uUnknown) == 1 )
sub_10071FCD0(v2, v7);
++arr;
}
while ( (unsigned __int64)arr <= v6 );
}
}
if ( (unsigned int)sub_100720070(v2) )
{
if ( v2 )
{
v8 = *(unsigned int **)(v2 + 56);
if ( *v8 )
{
v9 = *((GJGameLevel ***)v8 + 2);
v10 = (unsigned __int64)&v9[*v8 - 1];
do
{
v11 = *v9;
if ( !*v9 )
break;
v12 = GameLevelManager::sharedState();
GameLevelManager::deleteLevel(v12, v11);
++v9;
}
while ( (unsigned __int64)v9 <= v10 );
}
}
a1->m_allSelected = 0;
CCMenuItemToggler::toggle(a1->m_allObjectsToggler, 0);
LevelBrowserLayer::loadPage(a1, a1->m_searchObject);
}
}
}