//
// NCSInfoLayer::init from 0x460010 to 0x46051c (1292 bytes)
//
// 1 xrefs:
// > NCSInfoLayer::create @ 0x460592
//
// 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 NCSInfoLayer::init(NCSInfoLayer *a1, CustomSongLayer *a2)
{
cocos2d::CCDirector *v4; // r0
cocos2d::CCNode *v5; // r6
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCSprite *v8; // r6
void (__fastcall *v9)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCMenu *v10; // r0
cocos2d::CCSprite *v11; // r0
CCMenuItemSpriteExtra *v12; // r8
cocos2d::CCMenu *m_buttonMenu; // r11
void (__fastcall *v14)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
int v15; // r4
void (__fastcall *v16)(int, cocos2d::CCRect *); // r7
ButtonSprite *v17; // r0
CCMenuItemSpriteExtra *v18; // r10
cocos2d::CCMenu *v19; // r11
ButtonSprite *v20; // r0
CCMenuItemSpriteExtra *v21; // r10
ButtonSprite *v22; // r0
CCMenuItemSpriteExtra *v23; // r11
ButtonSprite *v24; // r0
CCMenuItemSpriteExtra *v25; // r7
void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCArray *v27; // r0
cocos2d::CCArray *v28; // r9
cocos2d::CCMenu *v29; // r5
float v31; // r2
float v32; // r3
float v33; // [sp+10h] [bp-64h]
float v34; // [sp+10h] [bp-64h]
float v35; // [sp+10h] [bp-64h]
float v36; // [sp+10h] [bp-64h]
int v37; // [sp+14h] [bp-60h]
cocos2d::CCPoint *v38; // [sp+1Ch] [bp-58h]
cocos2d::CCMenu *v39; // [sp+1Ch] [bp-58h]
cocos2d::CCSize v40; // [sp+24h] [bp-50h] BYREF
cocos2d::CCPoint v41; // [sp+2Ch] [bp-48h] BYREF
cocos2d::CCPoint v42; // [sp+34h] [bp-40h] BYREF
void (*v43)(NewgroundsInfoLayer *, cocos2d::CCObject *); // [sp+3Ch] [bp-38h]
int v44; // [sp+40h] [bp-34h]
void (*v45)(NCSInfoLayer *, cocos2d::CCObject *); // [sp+44h] [bp-30h]
int v46; // [sp+48h] [bp-2Ch]
void (*v47)(NCSInfoLayer *, cocos2d::CCObject *); // [sp+4Ch] [bp-28h]
int v48; // [sp+50h] [bp-24h]
cocos2d::CCPoint v49; // [sp+54h] [bp-20h] BYREF
cocos2d::CCRect v50; // [sp+5Ch] [bp-18h] BYREF
cocos2d::CCSize v51; // 0:^0.8
cocos2d::CCRect v52; // 0:kr00_16.16
v37 = FLAlertLayer::init(a1, (cocos2d::_ccColor4B)75);
if ( v37 )
{
a1->m_songLayer = a2;
a1->m_noElasticity = 1;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v40, v4);
cocos2d::CCRect::CCRect(&v50, 0.0, 0.0, 80.0, 80.0);
v52.origin.x = v31;
v52.origin.y = v32;
v52.size = v51;
v5 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square02.png",
(const char *)&v50,
v52);
setContentSize = v5->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v50, 440.0, 290.0);
setContentSize(v5, (const cocos2d::CCSize *)&v50);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v5, -1);
setPosition = v5->setPosition;
cocos2d::CCPoint::CCPoint(&v50.origin, v40.width * 0.5, v40.height * 0.5);
setPosition(v5, &v50.origin);
v8 = cocos2d::CCSprite::createWithSpriteFrameName("ncs_large_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v8->setScale)(v8, 1067030938);
v9 = v8->setPosition;
cocos2d::CCPoint::CCPoint(&v50.origin, v40.width * 0.5, (float)((float)(v40.height * 0.5) + 145.0) - 38.0);
v9(v8, &v50.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v8);
v10 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v10;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v10, 10);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v44 = 0;
v43 = NewgroundsInfoLayer::onClose;
v12 = CCMenuItemSpriteExtra::create(
v11,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(NewgroundsInfoLayer::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v12, 1.5);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v12);
m_buttonMenu = a1->m_buttonMenu;
v14 = v12->setPosition;
cocos2d::CCPoint::CCPoint(
&v49,
(float)((float)(v40.width * 0.5) - 220.0) + 10.0,
(float)((float)(v40.height * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(&v50.origin, m_buttonMenu, &v49);
v14(v12, &v50.origin);
sub_776584(
(int)&v49,
"All NCS catalogue is copyright free, allowing all content creators to monetise their content on pl"
"atforms like YouTube and Twitch!");
cocos2d::CCPoint::CCPoint(&v50.origin, 0.5, 1.0);
v15 = TextArea::create(
(TextArea *)&v49,
(std::string)"chatFont.fnt",
(const char *)0x3F800000,
1135869952,
&v50.origin,
(cocos2d::CCPoint)COERCE_UNSIGNED_INT(22.0));
sub_774008(&v49);
a1->m_mainLayer->addChild(a1->m_mainLayer, (cocos2d::CCNode *)v15);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v15 + 80))(v15, 1065353216);
v16 = *(void (__fastcall **)(int, cocos2d::CCRect *))(*(_DWORD *)v15 + 92);
cocos2d::CCPoint::CCPoint(&v50.origin, v40.width * 0.5, (float)(v40.height * 0.5) + 35.0);
v16(v15, &v50);
*(float *)(v15 + 528) = 22.0;
v17 = ButtonSprite::create(
(ButtonSprite *)"Open Library",
(const char *)&dword_12C,
0,
0.75,
0,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x420C0000,
v33);
v46 = 0;
v45 = NCSInfoLayer::onLibrary;
v18 = CCMenuItemSpriteExtra::create(
v17,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(NCSInfoLayer::onLibrary, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v18);
CCMenuItemSpriteExtra::setSizeMult(v18, 1.1);
v19 = a1->m_buttonMenu;
v38 = (cocos2d::CCPoint *)v18->setPosition;
cocos2d::CCPoint::CCPoint(&v49, v40.width * 0.5, (float)(v40.height * 0.5) - 50.0);
cocos2d::CCNode::convertToNodeSpace(&v50.origin, v19, &v49);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *))v38)(v18, &v50);
v20 = ButtonSprite::create(
(ButtonSprite *)"Connect with NCS",
(const char *)&dword_C8,
0,
0.4,
0,
"bigFont.fnt",
"GJ_button_05.png",
(const char *)0x41C80000,
v34);
v48 = 0;
v47 = NCSInfoLayer::onNCS;
v21 = CCMenuItemSpriteExtra::create(
v20,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(NCSInfoLayer::onNCS, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v21);
CCMenuItemSpriteExtra::setSizeMult(v21, 1.1);
v22 = ButtonSprite::create(
(ButtonSprite *)"NCS.IO",
(const char *)&dword_C8,
0,
0.4,
0,
"bigFont.fnt",
"GJ_button_04.png",
(const char *)0x41C80000,
v35);
v49.y = 0.0;
LODWORD(v49.x) = NCSInfoLayer::onNCSIO;
v23 = CCMenuItemSpriteExtra::create(
v22,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(NCSInfoLayer::onNCSIO, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v23);
CCMenuItemSpriteExtra::setSizeMult(v23, 1.1);
v24 = ButtonSprite::create(
(ButtonSprite *)"Usage Policy",
(const char *)&dword_C8,
0,
0.4,
0,
"bigFont.fnt",
"GJ_button_04.png",
(const char *)0x41C80000,
v36);
v50.origin.y = 0.0;
LODWORD(v50.origin.x) = NCSInfoLayer::onNCSUsage;
v25 = CCMenuItemSpriteExtra::create(
v24,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(NCSInfoLayer::onNCSUsage, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v25);
CCMenuItemSpriteExtra::setSizeMult(v25, 1.1);
v26 = v25->setPosition;
v39 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v41,
(float)((float)((float)(v40.width * 0.5) + 220.0) - 72.0) - 80.0,
(float)((float)(v40.height * 0.5) - 145.0) + 22.0);
cocos2d::CCNode::convertToNodeSpace(&v42, v39, &v41);
v27 = (cocos2d::CCArray *)((int (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *))v26)(v25, &v42);
v28 = (cocos2d::CCArray *)cocos2d::CCArray::create(v27);
cocos2d::CCArray::addObject(v28, v25);
cocos2d::CCArray::addObject(v28, v23);
cocos2d::CCArray::addObject(v28, v21);
v29 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v41, v40.width * 0.5, (float)((float)(v40.height * 0.5) - 145.0) + 22.0);
cocos2d::CCNode::convertToNodeSpace(&v42, v29, &v41);
GameToolbox::alignItemsHorisontally(v28, 14.0, (cocos2d::CCPoint)(unsigned int)&v42, 0);
}
return v37;
}