//
// LevelListLayer::cellPerformedAction from 0x1002464b0 to 0x10024662c (380 bytes)
//
// 2 xrefs:
// > sub_1002466B8 @ 0x1002466bc
// > ??> @ 0x1007cb320
//
// 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
//
bool __fastcall LevelListLayer::cellPerformedAction(
LevelListLayer *a1,
TableViewCell *a2,
int a3,
CellAction a4,
cocos2d::CCNode *a5)
{
int v8; // w20
GJListLayer *m_list; // x8
CCContentLayer *m_contentLayer; // x0
float v11; // s0
int v13; // w21
int v14; // w0
SetLevelOrderPopup *v15; // x20
GJListLayer *v16; // x8
GJListLayer *v17; // x8
CustomListView *m_listView; // x0
if ( a3 != 31 || !a4 )
return LevelBrowserLayer::cellPerformedAction(a1, a2, a3, a4, a5);
v8 = *(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 328LL) - *(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 332LL);
a1->m_initialListViewY = 0.0;
m_list = a1->m_list;
if ( m_list )
{
m_contentLayer = m_list->m_listView->m_tableView->m_contentLayer;
v11 = *(float *)(((__int64 (__fastcall *)(CCContentLayer *))m_contentLayer->getPosition)(m_contentLayer) + 4);
a1->m_initialListViewY = v11;
}
else
{
v11 = 0.0;
}
if ( (unsigned int)(a4 - 3) < 2 )
{
GJLevelList::reorderLevelStep(a1->m_levelList, v8, a4 == 3);
LABEL_15:
LevelBrowserLayer::setupLevelBrowser(a1, nullptr);
v17 = a1->m_list;
if ( v17 )
{
m_listView = (CustomListView *)v17->m_listView;
m_listView->m_cellMode = a1->m_editMode;
CustomListView::reloadAll(m_listView);
}
return 1;
}
if ( a4 == 2 )
{
v16 = a1->m_list;
if ( v16 )
a1->m_initialListViewY = v16->m_listView->m_itemSeparation + v11;
GJLevelList::removeLevelFromList(
a1->m_levelList,
*(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 328LL) - *(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 332LL));
goto LABEL_15;
}
if ( a4 == Swap )
{
v13 = GJLevelList::orderForLevel(a1->m_levelList, v8);
v14 = GJLevelList::totalLevels(a1->m_levelList);
v15 = SetLevelOrderPopup::create(v8, v13 + 1, v14);
v15->m_delegate = &a1->SetIDPopupDelegate;
((void (__fastcall *)(SetLevelOrderPopup *, __int64))v15->setTag)(v15, 1003);
((void (__fastcall *)(SetLevelOrderPopup *))v15->show)(v15);
}
return 1;
}