//
// LevelListLayer::cellPerformedAction from 0x10035f600 to 0x10035f7b7 (439 bytes)
//
// 2 xrefs:
// > sub_10035F990 @ 0x10035f99c
// > ??> @ 0x1009186a8
//
// 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)
{
CellAction v5; // r15d
int v7; // r14d
GJListLayer *m_list; // rax
CCContentLayer *m_contentLayer; // rdi
float v10; // xmm0_4
int v11; // r15d
int v12; // eax
SetLevelOrderPopup *v13; // r14
GJListLayer *v15; // rax
GJListLayer *v16; // rax
CustomListView *m_listView; // rdi
v5 = a4;
LOBYTE(a4) = a3 != 31 || a4 == 0;
if ( (_BYTE)a4 )
return LevelBrowserLayer::cellPerformedAction(a1, a2, a3, v5, a5);
v7 = *(_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;
v10 = *(float *)(((__int64 (__fastcall *)(CCContentLayer *, TableViewCell *, int, CellAction, cocos2d::CCNode *))m_contentLayer->getPosition)(
m_contentLayer,
a2,
a3,
a4,
a5)
+ 4);
a1->m_initialListViewY = v10;
if ( (unsigned int)(v5 - 3) >= 2 )
goto LABEL_4;
LABEL_9:
GJLevelList::reorderLevelStep(a1->m_levelList, v7, v5 == 3);
LABEL_13:
LevelBrowserLayer::setupLevelBrowser(a1, nullptr);
v16 = a1->m_list;
if ( v16 )
{
m_listView = (CustomListView *)v16->m_listView;
m_listView->m_cellMode = a1->m_editMode;
CustomListView::reloadAll(m_listView);
}
return 1;
}
v10 = 0.0;
if ( (unsigned int)(v5 - 3) < 2 )
goto LABEL_9;
LABEL_4:
if ( v5 == 2 )
{
v15 = a1->m_list;
if ( v15 )
a1->m_initialListViewY = v10 + v15->m_listView->m_itemSeparation;
GJLevelList::removeLevelFromList(
a1->m_levelList,
*(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 328LL) - *(_DWORD *)(*(_QWORD *)&a2[1].m_uID + 332LL));
goto LABEL_13;
}
if ( v5 == Swap )
{
v11 = GJLevelList::orderForLevel(a1->m_levelList, v7) + 1;
v12 = GJLevelList::totalLevels(a1->m_levelList);
v13 = SetLevelOrderPopup::create(v7, v11, v12);
v13->m_delegate = &a1->SetIDPopupDelegate;
((void (__fastcall *)(SetLevelOrderPopup *, __int64))v13->setTag)(v13, 1003);
((void (__fastcall *)(SetLevelOrderPopup *))v13->show)(v13);
}
return 1;
}