//
// NCSInfoLayer::init from 0x140167300 to 0x140167b25 (2085 bytes)
//
// 2 xrefs:
// > CustomSongLayer::onNCSBrowser @ 0x1401650a5
// > ??> @ 0x140917f9c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:27:27 +0000
//
// Hidden C++ exception states: #wind=5
bool __fastcall NCSInfoLayer::init(__int64 a1, __int64 a2)
{
bool result; // al
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // rax
__int64 *v8; // rdi
__int64 v9; // rbx
__int64 v10; // rax
__int64 v11; // rbx
__int64 v12; // rax
struct cocos2d::CCSprite *v13; // rdi
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rax
int v17; // eax
cocos2d::CCObject *v18; // rsi
__int64 v19; // rdi
__int64 v20; // rbx
__int64 v21; // rax
__int64 v22; // rax
const struct cocos2d::CCPoint *v23; // rax
char *v24; // rdi
__int64 v25; // rbx
__int64 v26; // rax
cocos2d::CCObject *v27; // rbx
cocos2d::CCObject *v28; // rsi
__int64 v29; // rdi
__int64 v30; // rbx
__int64 v31; // rax
__int64 v32; // rax
cocos2d::CCObject *v33; // rbx
cocos2d::CCObject *v34; // r13
__int64 v35; // rax
cocos2d::CCObject *v36; // rbx
cocos2d::CCObject *v37; // r15
cocos2d::CCObject *v38; // rbx
cocos2d::CCObject *v39; // rsi
__int64 v40; // rdi
__int64 v41; // rbx
__int64 v42; // rax
__int64 v43; // rax
__int64 v44; // rcx
cocos2d::CCArray *v45; // rdi
__int64 v46; // rbx
__int64 v47; // rax
__int64 v48; // rax
_BYTE v49[16]; // [rsp+58h] [rbp-59h] BYREF
__int128 v50; // [rsp+68h] [rbp-49h] BYREF
__int64 v51; // [rsp+78h] [rbp-39h]
__int64 v52; // [rsp+80h] [rbp-31h]
float v53; // [rsp+128h] [rbp+77h] BYREF
float v54; // [rsp+12Ch] [rbp+7Bh]
__int128 *v55; // [rsp+130h] [rbp+7Fh] BYREF
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
*(_QWORD *)(a1 + 672) = a2;
*(_BYTE *)(a1 + 596) = 1;
v6 = cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6, &v53);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v49, 0.0, 0.0, 80.0, 80.0);
v8 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v7);
v9 = *v8;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v55, 440.0, 290.0);
(*(void (__fastcall **)(__int64 *, __int64))(v9 + 312))(v8, v10);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v8,
0xFFFFFFFFLL);
v11 = *v8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, v53 * 0.5, v54 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v11 + 184))(v8, v12);
v13 = cocos2d::CCSprite::createWithSpriteFrameName("ncs_large_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v13 + 160LL))(v13);
v14 = *(_QWORD *)v13;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, v53 * 0.5, (float)((float)(v54 * 0.5) + 145.0) - 38.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v14 + 184))(v13, v15);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v13);
v16 = cocos2d::CCMenu::create();
*(_QWORD *)(a1 + 552) = v16;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v16, 10);
v17 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v18 = CCMenuItemSpriteExtra::create(v17, 0, a1, (__int64)PagedListPopup::onClose);
*((_DWORD *)v18 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v18);
v19 = *(_QWORD *)v18;
v20 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v55,
(float)((float)(v53 * 0.5) - 220.0) + 10.0,
(float)((float)(v54 * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v20, v49, v21);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v19 + 184))(v18, v22);
v55 = &v50;
v50 = 0;
v51 = 0;
v52 = 0;
*(_QWORD *)&v50 = sub_14003D460(0xA0u);
v51 = 146;
v52 = 159;
strcpy(
(char *)v50,
"All NCS catalogue is copyright free, allowing all content creators to monetise their content on pl"
"atforms like YouTube and Twitch!");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 0.5, 1.0);
v24 = TextArea::create((__int64)&v50, "chatFont.fnt", 1.0, 396.0, v23, 1102053376, 0, 0);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v24);
(*(void (__fastcall **)(char *))(*(_QWORD *)v24 + 160LL))(v24);
v25 = *(_QWORD *)v24;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, v53 * 0.5, (float)(v54 * 0.5) + 35.0);
(*(void (__fastcall **)(char *, __int64))(v25 + 184))(v24, v26);
*((_DWORD *)v24 + 166) = 1102053376;
v55 = (__int128 *)operator new(0x2C8u);
v27 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v55);
if ( v27 )
{
if ( ButtonSprite::init_1(
(__int64)v27,
(__int64)"Open Library",
300,
0,
1061158912,
0,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1108082688) )
{
cocos2d::CCObject::autorelease(v27);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v27 + 8LL))(v27, 1);
LODWORD(v27) = 0;
}
}
v28 = CCMenuItemSpriteExtra::create((int)v27, 0, a1, (__int64)NCSInfoLayer::onLibrary);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v28);
*((_DWORD *)v28 + 93) = 1066192077;
v29 = *(_QWORD *)v28;
v30 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, v53 * 0.5, (float)(v54 * 0.5) - 50.0);
cocos2d::CCNode::convertToNodeSpace(v30, v49, v31);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v29 + 184))(v28, v32);
v55 = (__int128 *)operator new(0x2C8u);
v33 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v55);
if ( v33 )
{
if ( ButtonSprite::init_1(
(__int64)v33,
(__int64)"Connect with NCS",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_05.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v33);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v33 + 8LL))(v33, 1);
LODWORD(v33) = 0;
}
}
v34 = CCMenuItemSpriteExtra::create((int)v33, 0, a1, (__int64)NCSInfoLayer::onNCS);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v34);
*((_DWORD *)v34 + 93) = 1066192077;
v55 = (__int128 *)operator new(0x2C8u);
v35 = ButtonSprite::ButtonSprite((__int64)v55);
v36 = (cocos2d::CCObject *)v35;
if ( v35 )
{
if ( ButtonSprite::init_1(
v35,
(__int64)"NCS.IO",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v36);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v36 + 8LL))(v36, 1);
LODWORD(v36) = 0;
}
}
v37 = CCMenuItemSpriteExtra::create((int)v36, 0, a1, (__int64)NCSInfoLayer::onNCSIO);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v37);
*((_DWORD *)v37 + 93) = 1066192077;
v55 = (__int128 *)operator new(0x2C8u);
v38 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v55);
if ( v38 )
{
if ( ButtonSprite::init_1(
(__int64)v38,
(__int64)"Usage Policy",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v38);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v38 + 8LL))(v38, 1);
LODWORD(v38) = 0;
}
}
v39 = CCMenuItemSpriteExtra::create((int)v38, 0, a1, (__int64)NCSInfoLayer::onNCSUsage);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v39);
*((_DWORD *)v39 + 93) = 1066192077;
v40 = *(_QWORD *)v39;
v41 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v55,
(float)((float)((float)(v53 * 0.5) + 220.0) - 72.0) - 80.0,
(float)((float)(v54 * 0.5) - 145.0) + 22.0);
cocos2d::CCNode::convertToNodeSpace(v41, v49, v42);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v40 + 184))(v39, v43);
v45 = (cocos2d::CCArray *)cocos2d::CCArray::create(v44);
cocos2d::CCArray::addObject(v45, v39);
cocos2d::CCArray::addObject(v45, v37);
cocos2d::CCArray::addObject(v45, v34);
v46 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, v53 * 0.5, (float)((float)(v54 * 0.5) - 145.0) + 22.0);
cocos2d::CCNode::convertToNodeSpace(v46, v49, v47);
GameToolbox::alignItemsHorisontally((__int64)v45, 14.0, v48, 0);
return 1;
}
return result;
}