//
// OptionsScrollLayer::setupList from 0x100610670 to 0x10061080a (410 bytes)
//
// 3 xrefs:
// > OptionsScrollLayer::init @ 0x1006105c7
// > OptionsScrollLayer::cellPerformedAction @ 0x100610a1d
// > sub_100610A50 @ 0x100610a6e
//
// 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 OptionsScrollLayer::setupList(OptionsScrollLayer *a1, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // rax
cocos2d::CCTouchDispatcher *v5; // rax
cocos2d::CCDirector *v6; // rsi
cocos2d::CCArray *v7; // r14
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r15
unsigned __int64 v10; // r12
cocos2d::CCObject *v11; // rsi
CustomListView *v12; // rdi
GJCommentListLayer *v13; // rax
GJCommentListLayer *m_listLayer; // rbx
float v15; // [rsp+0h] [rbp-30h] BYREF
float v16[10]; // [rsp+8h] [rbp-28h] BYREF
if ( a1->m_listLayer )
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v4->getTouchDispatcher)(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1->m_listLayer);
((void (__fastcall *)(GJCommentListLayer *))a1->m_listLayer->removeMeAndCleanup)(a1->m_listLayer);
a1->m_listLayer = nullptr;
}
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v16);
if ( a2 )
{
v7 = (cocos2d::CCArray *)sub_10071F9E0(v16, v6);
data = a2->data;
if ( data->num )
{
arr = data->arr;
v10 = (unsigned __int64)&arr[data->num - 1];
do
{
v11 = *arr;
if ( !*arr )
break;
if ( v11[1].m_unknown2 > a1->m_minCount || BYTE4(v11[1].__vftable) == 1 )
sub_10071FCD0(v7, v11);
++arr;
}
while ( (unsigned __int64)arr <= v10 );
}
v12 = CustomListView::create(v7, &a1->TableViewCellDelegate, 220.0, 340.0, 0, Options, 0.0);
}
else
{
v12 = nullptr;
}
v13 = GJCommentListLayer::create(v12, "", (cocos2d::ccColor4B)-12684609, 340.0, 220.0, 0);
a1->m_listLayer = v13;
((void (__fastcall *)(cocos2d::CCLayer *, GJCommentListLayer *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v13);
m_listLayer = a1->m_listLayer;
sub_10028CBE0(&v15, (float)(v16[0] + -340.0) * 0.5, (float)((float)(v16[1] + -220.0) * 0.5) + -10.0);
((void (__fastcall *)(GJCommentListLayer *, float *))m_listLayer->setPosition)(m_listLayer, &v15);
}