//
// ListButtonBar::init from 0x5a8cb0 to 0x5a90e0 (1072 bytes)
//
// 2 xrefs:
// > ListButtonBar::create @ 0x5a91a8
// > ??> @ 0x9ee98
//
// 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
//
// local variable allocation has failed, the output may be wrong!
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)
{
unsigned int v10; // w5
float x; // s8
float y; // s9
unsigned int v16; // w26
cocos2d::CCDirector *v20; // x0
unsigned int v21; // w19
cocos2d::CCArray *v22; // x0
cocos2d::CCArray *v23; // x0
cocos2d::CCArray *v24; // x0
cocos2d::CCArray *v25; // x20
cocos2d::CCObject *v26; // x0
cocos2d::CCObject *v27; // x21
cocos2d::CCArray *v28; // x22
_BOOL4 v29; // w23
cocos2d::CCArray *v30; // x0
unsigned int v31; // w19
unsigned int v32; // w1
cocos2d::CCArray *v33; // x22
float v34; // s3
float v35; // s4
ListButtonPage *v36; // x0
cocos2d::CCArray *m_pages; // x19
bool v38; // w2
BoomScrollLayer *v39; // x0
BoomScrollLayer *m_scrollLayer; // x19
float v41; // s8
cocos2d::CCDirector *v42; // x0
float v43; // s0
cocos2d::CCArray *v45; // x0
cocos2d::CCObject *v46; // x22
cocos2d::CCMenu *v47; // x19
cocos2d::CCString *v48; // x0
const char *CString; // x24
cocos2d::CCSprite *v50; // x20
CCMenuItemSpriteExtra *v51; // x23
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCPoint *v53; // x27
cocos2d::CCSprite *v54; // x23
CCMenuItemSpriteExtra *v55; // x23
void (__fastcall *v56)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
__int64 v57; // [xsp+0h] [xbp+0h] BYREF
unsigned int v58; // [xsp+80h] [xbp+80h]
unsigned int v59; // [xsp+84h] [xbp+84h]
cocos2d::CCPoint *v60; // [xsp+88h] [xbp+88h]
float v61; // [xsp+98h] [xbp+98h]
cocos2d::CCPoint v62; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCPoint v63; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v64; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCPoint v65; // 0:kr08_8.8
cocos2d::CCPoint v66; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v67; // 0:x2.16
cocos2d::SEL_MenuHandler v68; // 0:x2.16
cocos2d::CCPoint v69; // 0:s0.4,4:s1.4
cocos2d::CCPoint v70; // 0:s0.4,4:s1.4
x = a3.x;
y = a3.y;
v60 = *(cocos2d::CCPoint **)&a4;
v58 = v10;
v16 = 0;
v20 = cocos2d::CCDirector::sharedDirector();
v21 = 0;
v59 = a5 * a10;
cocos2d::CCDirector::getWinSize(v20);
v23 = (cocos2d::CCArray *)cocos2d::CCArray::create(v22);
a1->m_pages = v23;
cocos2d::CCObject::retain(v23);
v25 = (cocos2d::CCArray *)cocos2d::CCArray::create(v24);
v26 = (cocos2d::CCObject *)cocos2d::CCArray::create(v25);
cocos2d::CCArray::addObject(v25, v26);
if ( (unsigned int)cocos2d::CCArray::count(a2) )
{
do
{
v27 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a2, v21);
v28 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v25, v16);
v29 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v27->getTag)(v27) == -1;
v30 = (cocos2d::CCArray *)cocos2d::CCArray::count(v28);
if ( (unsigned int)v30 >= v59 || v29 )
{
v45 = (cocos2d::CCArray *)cocos2d::CCArray::create(v30);
v46 = v45;
if ( !v29 )
cocos2d::CCArray::addObject(v45, v27);
++v16;
++v21;
cocos2d::CCArray::addObject(v25, v46);
}
else
{
++v21;
cocos2d::CCArray::addObject(v28, v27);
}
}
while ( v21 < (unsigned int)cocos2d::CCArray::count(a2) );
}
v31 = 0;
while ( v31 < (unsigned int)cocos2d::CCArray::count(v25) )
{
v32 = v31++;
v33 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v25, v32);
cocos2d::CCPoint::CCPoint(&v64, v60);
v69.x = x;
v69.y = y;
v36 = ListButtonPage::create(v33, v69, (unsigned int)&v57 + 176, a5, a6, v34, v35);
cocos2d::CCArray::addObject(a1->m_pages, v36);
}
m_pages = a1->m_pages;
v38 = (unsigned int)cocos2d::CCArray::count(m_pages) > 1;
v39 = BoomScrollLayer::create(m_pages, 0, v38);
a1->m_scrollLayer = v39;
a1->addChild(a1, v39);
m_scrollLayer = a1->m_scrollLayer;
v41 = v61 * 0.5;
v42 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenBottom(v42);
cocos2d::CCPoint::CCPoint(&v64, v41, v43 + 6.0);
BoomScrollLayer::setPagesIndicatorPosition(m_scrollLayer, v70);
a1->m_scrollLayer->setTouchEnabled(a1->m_scrollLayer, 0);
if ( (unsigned int)cocos2d::CCArray::count(a1->m_pages) > 1 )
{
v47 = cocos2d::CCMenu::create();
a1->addChild(a1, v47);
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"GJ_arrow_%02d_001.png",
(const char *)v58);
CString = cocos2d::CCString::getCString(v48);
v50 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
v50->setScale(v50, 0.8);
v67.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v67.adj = (size_t)ListButtonBar::onLeft;
v51 = CCMenuItemSpriteExtra::create(v50, nullptr, v67);
v47->addChild(v47, v51);
CCMenuItemSpriteExtra::setSizeMult(v51, 2.2);
setPosition = v51->setPosition;
cocos2d::CCPoint::CCPoint(&v62, -a7, 0.0);
v53 = v60;
cocos2d::CCPoint::operator+(&v63, v60, &v62);
v65 = cocos2d::CCNode::convertToNodeSpace(v47, &v63);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))setPosition)(
v51,
&v64,
v65.x,
v65.y);
v54 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
v54->setScale(v54, 0.8);
cocos2d::CCSprite::setFlipX(v54, 1);
v68.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v68.adj = (size_t)ListButtonBar::onRight;
v55 = CCMenuItemSpriteExtra::create(v54, nullptr, v68);
v47->addChild(v47, v55);
v56 = v55->setPosition;
cocos2d::CCPoint::CCPoint(&v62, a7, 0.0);
cocos2d::CCPoint::operator+(&v63, v53, &v62);
v66 = cocos2d::CCNode::convertToNodeSpace(v47, &v63);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))v56)(v55, &v64, v66.x, v66.y);
CCMenuItemSpriteExtra::setSizeMult(v55, 2.2);
}
else
{
a1->m_scrollLayer->m_dotsVisible = 0;
}
return 1;
}