//
// GJSongBrowser::customSetup from 0x307ca0 to 0x307f2e (654 bytes)
//
// 0 xrefs:
//
// 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 GJSongBrowser::customSetup(GJSongBrowser *a1)
{
cocos2d::CCDirector *v2; // r0
cocos2d::CCMenu *v3; // r0
float v4; // s16
cocos2d::CCNode *v5; // r6
cocos2d::CCSprite *v6; // r0
CCMenuItemSpriteExtra *v7; // r0
cocos2d::CCNode_vtbl *v8; // r3
CCMenuItemSpriteExtra *m_leftArrow; // r11
cocos2d::CCDirector *v10; // r0
float v11; // r0
cocos2d::CCSprite *v12; // r5
CCMenuItemSpriteExtra *v13; // r0
cocos2d::CCNode_vtbl *v14; // r3
CCMenuItemSpriteExtra *m_rightArrow; // r10
void (__fastcall *v16)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v17; // r0
float v18; // r0
cocos2d::CCSprite *v19; // r0
cocos2d::CCSprite *v20; // r10
CCMenuItemSpriteExtra *v21; // r9
float v22; // s17
void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCDirector *v24; // r0
float v25; // s18
cocos2d::CCDirector *v26; // r0
float v27; // r0
cocos2d::CCLabelBMFont *v28; // r0
cocos2d::CCLabelBMFont *m_countText; // r6
void (__fastcall *v30)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCDirector *v31; // r0
float v32; // s17
cocos2d::CCDirector *v33; // r0
float v34; // r0
cocos2d::CCLabelBMFont *v35; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
MusicDownloadManager *v37; // r0
cocos2d::CCArray *DownloadedSongs; // r0
GJListLayer *m_listLayer; // r0
void (__fastcall *setColor)(cocos2d::CCLayerColor *__hidden, const cocos2d::ccColor3B *); // r2
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-40h]
cocos2d::CCSize v42; // [sp+14h] [bp-38h] BYREF
cocos2d::CCPoint v43; // [sp+1Ch] [bp-30h] BYREF
cocos2d::CCPoint v44; // [sp+24h] [bp-28h] BYREF
void (*v45)(GJSongBrowser *, cocos2d::CCObject *); // [sp+2Ch] [bp-20h]
int v46; // [sp+30h] [bp-1Ch]
cocos2d::CCPoint v47; // [sp+34h] [bp-18h] BYREF
cocos2d::CCPoint v48; // [sp+3Ch] [bp-10h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v42, v2);
v3 = cocos2d::CCMenu::create();
v4 = v42.height * 0.5;
v5 = v3;
v6 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v45 = GJSongBrowser::onPrevPage;
v46 = 0;
v7 = CCMenuItemSpriteExtra::create(
v6,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJSongBrowser::onPrevPage, (unsigned int)a1));
v8 = v5->__vftable;
a1->m_leftArrow = v7;
v8->addChild(v5, v7);
m_leftArrow = a1->m_leftArrow;
setPosition = m_leftArrow->setPosition;
v10 = cocos2d::CCDirector::sharedDirector();
v11 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v10));
cocos2d::CCPoint::CCPoint(&v47, v11 + 24.0, v4);
cocos2d::CCNode::convertToNodeSpace(&v48, v5, &v47);
setPosition(m_leftArrow, &v48);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v12, 1);
LODWORD(v47.x) = GJSongBrowser::onNextPage;
v47.y = 0.0;
v13 = CCMenuItemSpriteExtra::create(
v12,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJSongBrowser::onNextPage, (unsigned int)a1));
v14 = v5->__vftable;
a1->m_rightArrow = v13;
v14->addChild(v5, v13);
m_rightArrow = a1->m_rightArrow;
v16 = m_rightArrow->setPosition;
v17 = cocos2d::CCDirector::sharedDirector();
v18 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v17));
cocos2d::CCPoint::CCPoint(&v44, v18 - 24.0, v4);
cocos2d::CCNode::convertToNodeSpace(&v48, v5, &v44);
v16(m_rightArrow, &v48);
v19 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
LODWORD(v48.x) = GJSongBrowser::onDeleteAll;
v48.y = 0.0;
v20 = v19;
v21 = CCMenuItemSpriteExtra::create(
v19,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJSongBrowser::onDeleteAll, (unsigned int)a1));
v5->addChild(v5, v21);
v22 = (float)(v20->m_obRect.size.width * 0.5) + 4.0;
v23 = v21->setPosition;
v24 = cocos2d::CCDirector::sharedDirector();
v25 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v24)) - v22;
v26 = cocos2d::CCDirector::sharedDirector();
v27 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v26));
cocos2d::CCPoint::CCPoint(&v43, v25, v27 + v22);
cocos2d::CCNode::convertToNodeSpace(&v44, v5, &v43);
v23(v21, &v44);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v5, 10);
v28 = cocos2d::CCLabelBMFont::create();
a1->m_countText = v28;
a1->m_mainLayer->addChild(a1->m_mainLayer, v28);
m_countText = a1->m_countText;
v30 = m_countText->setPosition;
v31 = cocos2d::CCDirector::sharedDirector();
v32 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v31));
v33 = cocos2d::CCDirector::sharedDirector();
v34 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v33));
cocos2d::CCPoint::CCPoint(&v44, v32 - 7.0, v34 - 4.0);
v30(m_countText, &v44);
v35 = a1->m_countText;
setAnchorPoint = v35->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v44, 1.0, 1.0);
setAnchorPoint(v35, &v44);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_countText->setScale)(a1->m_countText, 1058642330);
v37 = MusicDownloadManager::sharedState();
DownloadedSongs = MusicDownloadManager::getDownloadedSongs(v37);
a1->m_downloadedSongs = DownloadedSongs;
cocos2d::CCObject::retain(DownloadedSongs);
a1->m_listLayer->setOpacity(a1->m_listLayer, 255);
m_listLayer = a1->m_listLayer;
setColor = m_listLayer->setColor;
memset(&v44, 50, 3);
setColor(m_listLayer, (const cocos2d::ccColor3B *)&v44);
}