//
// ListButtonBar::init from 0x14006aeb0 to 0x14006b3a7 (1271 bytes)
//
// 2 xrefs:
// > ListButtonBar::create @ 0x14006ae6e
// > ??> @ 0x1406c5fb8
//
// 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
//
// Hidden C++ exception states: #wind=2
bool ListButtonBar::init(
ListButtonBar *a1,
cocos2d::CCArray *a2,
cocos2d::CCPoint a3,
int a4,
int a5,
float a6,
float a7,
float a8,
float a9,
int a10)
{
int v10; // ebp
ListButtonBar *v12; // r12
cocos2d::CCDirector *v13; // rax
__int64 v14; // rcx
cocos2d::CCObject *v15; // rax
__int64 v16; // rcx
cocos2d::CCArray *v17; // rsi
__int64 v18; // rcx
struct cocos2d::CCObject *v19; // rax
unsigned int v20; // r15d
int v21; // r14d
unsigned int v22; // edi
unsigned int v23; // r12d
struct cocos2d::CCObject *v24; // rbx
cocos2d::CCArray *v25; // rbp
int v26; // r14d
__int64 v27; // rcx
struct cocos2d::CCObject *v28; // rdx
cocos2d::CCArray *v29; // rcx
cocos2d::CCArray *v30; // rax
cocos2d::CCArray *v31; // rbp
unsigned int v32; // edi
unsigned int v33; // eax
const struct cocos2d::CCPoint *v34; // r15
float v35; // xmm6_4
float v36; // xmm7_4
float v37; // xmm8_4
cocos2d::CCArray *v38; // rbx
cocos2d::CCPoint v39; // rax
ListButtonPage *v40; // rax
unsigned int v41; // eax
int v42; // edx
BoomScrollLayer *v43; // rax
__int64 v44; // rcx
cocos2d::CCDirector *v45; // rax
float v46; // xmm0_4
BoomScrollLayer *m_scrollLayer; // rbx
__int64 v48; // rax
cocos2d::CCNode *v49; // rsi
cocos2d::CCString *v50; // rax
const char *CString; // rbp
struct cocos2d::CCSprite *v52; // rbx
CCMenuItemSpriteExtra *v53; // rdi
float v54; // xmm7_4
CCMenuItemSpriteExtra_vtbl *v55; // rbx
struct cocos2d::CCPoint v56; // rax
cocos2d::CCSprite *v57; // rbx
CCMenuItemSpriteExtra *v58; // rdi
CCMenuItemSpriteExtra_vtbl *v59; // rbx
struct cocos2d::CCPoint v60; // rax
float v62; // [rsp+40h] [rbp-88h]
cocos2d::CCPoint v63; // [rsp+48h] [rbp-80h] BYREF
cocos2d::CCPoint v64[4]; // [rsp+50h] [rbp-78h] BYREF
CCMenuItemSpriteExtra *v65; // [rsp+D0h] [rbp+8h] BYREF
cocos2d::CCPoint v66; // [rsp+E0h] [rbp+18h]
int v67; // [rsp+E8h] [rbp+20h]
v67 = a4;
v66 = a3;
v65 = (CCMenuItemSpriteExtra *)a1;
v10 = a4;
v12 = a1;
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v13);
v15 = (cocos2d::CCObject *)cocos2d::CCArray::create(v14);
v12->m_pages = (cocos2d::CCArray *)v15;
cocos2d::CCObject::retain(v15);
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
v19 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v18);
cocos2d::CCArray::addObject(v17, v19);
v20 = 0;
v21 = a5;
a10 = a5 * v10;
v22 = 0;
if ( cocos2d::CCArray::count(a2) )
{
v23 = a10;
do
{
v24 = cocos2d::CCArray::objectAtIndex(a2, v22);
v25 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v17, v20);
v26 = v24->getTag(v24);
if ( cocos2d::CCArray::count(v25) >= v23 || v26 == -1 )
{
v30 = (cocos2d::CCArray *)cocos2d::CCArray::create(v27);
v31 = v30;
if ( v26 != -1 )
cocos2d::CCArray::addObject(v30, v24);
++v20;
v28 = v31;
v29 = v17;
}
else
{
v28 = v24;
v29 = v25;
}
cocos2d::CCArray::addObject(v29, v28);
++v22;
}
while ( v22 < cocos2d::CCArray::count(a2) );
v12 = (ListButtonBar *)v65;
v10 = v67;
v21 = a5;
}
v32 = 0;
v33 = cocos2d::CCArray::count(v17);
v34 = (const struct cocos2d::CCPoint *)v66;
if ( v33 )
{
v35 = a8;
v36 = a7;
v37 = a6;
do
{
v38 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v17, v32);
v39 = (cocos2d::CCPoint)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, v34);
v40 = ListButtonPage::create(v38, v39, v10, v21, v37, v36, v35);
cocos2d::CCArray::addObject(v12->m_pages, v40);
++v32;
}
while ( v32 < cocos2d::CCArray::count(v17) );
}
v41 = cocos2d::CCArray::count(v12->m_pages);
v43 = BoomScrollLayer::create(v12->m_pages, v42, v41 >= 2, nullptr, nullptr);
v12->m_scrollLayer = v43;
v12->addChild_1(v12, v43);
v45 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v44);
v46 = cocos2d::CCDirector::getScreenBottom(v45) + 6.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v65, v62 * 0.5, v46);
m_scrollLayer = v12->m_scrollLayer;
cocos2d::CCPoint::operator=(&m_scrollLayer->m_dotPosition, v48);
BoomScrollLayer::updateDots(m_scrollLayer, 0.0);
v12->m_scrollLayer->setTouchEnabled(v12->m_scrollLayer, 0);
if ( cocos2d::CCArray::count(v12->m_pages) <= 1 )
{
v12->m_scrollLayer->m_dotsVisible = 0;
return 1;
}
v49 = (cocos2d::CCNode *)cocos2d::CCMenu::create();
v12->addChild_1(v12, v49);
v50 = cocos2d::CCString::createWithFormat("GJ_arrow_%02d_001.png", 1);
CString = cocos2d::CCString::getCString(v50);
v52 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
((void (__fastcall *)(struct cocos2d::CCSprite *))v52->setScale_0)(v52);
v65 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v53 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v65);
if ( v53 )
{
if ( CCMenuItemSpriteExtra::init(v53, v52, nullptr, v12, (cocos2d::SEL_MenuHandler *)ListButtonBar::onLeft) )
{
cocos2d::CCObject::autorelease(v53);
goto LABEL_20;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v53->~CCMenuItemSpriteExtra)(v53, 1);
}
v53 = nullptr;
LABEL_20:
v49->addChild_1(v49, v53);
HIDWORD(v53->m_pfnSelector.adj) = 1069547520;
v54 = a9;
cocos2d::CCPoint::CCPoint(&v63, -a9, 0.0);
cocos2d::CCPoint::operator+(v34, &v65);
v55 = v53->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v56 = cocos2d::CCNode::convertToNodeSpace(v49, v64);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v55->setPosition_0)(v53, v56);
v57 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
((void (__fastcall *)(cocos2d::CCSprite *))v57->setScale_0)(v57);
cocos2d::CCSprite::setFlipX(v57, 1);
v65 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v58 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v65);
if ( !v58 )
{
LABEL_24:
v58 = nullptr;
goto LABEL_25;
}
if ( !CCMenuItemSpriteExtra::init(v58, v57, nullptr, v12, (cocos2d::SEL_MenuHandler *)ListButtonBar::onRight) )
{
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v58->~CCMenuItemSpriteExtra)(v58, 1);
goto LABEL_24;
}
cocos2d::CCObject::autorelease(v58);
LABEL_25:
v49->addChild_1(v49, v58);
cocos2d::CCPoint::CCPoint(v64, v54, 0.0);
cocos2d::CCPoint::operator+(v34, &v65);
v59 = v58->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v60 = cocos2d::CCNode::convertToNodeSpace(v49, &v63);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v59->setPosition_0)(v58, v60);
HIDWORD(v58->m_pfnSelector.adj) = 1069547520;
return 1;
}