// // SongInfoLayer::init from 0x42db04 to 0x42e650 (2892 bytes) // // 1 xrefs: // > SongInfoLayer::create @ 0x42e828 // // 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 // int __fastcall SongInfoLayer::init( FLAlertLayer *a1, int a2, const char **a3, int a4, _DWORD *a5, int a6, int a7, unsigned int a8, _DWORD *a9, int a10) { cocos2d::CCDirector *v12; // r0 cocos2d::CCNode *v13; // r4 void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r7 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7 cocos2d::CCLabelBMFont *v16; // r4 void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7 void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r5 float *v19; // r0 cocos2d::CCString *v20; // r0 cocos2d::CCLabelBMFont *v21; // r7 void (__fastcall *v22)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r5 float v23; // s18 float v24; // r0 void (__fastcall *v25)(cocos2d::CCLabelBMFont *__hidden, float); // r4 float *v26; // r0 void (__fastcall *v27)(cocos2d::CCLabelBMFont *__hidden, float); // r4 int v28; // r1 cocos2d::CCSprite *v29; // r0 CCMenuItemSpriteExtra *v30; // r4 cocos2d::CCMenu *v31; // r0 float height; // s14 float v33; // s13 cocos2d::CCMenu_vtbl *v34; // r3 cocos2d::CCMenu *v35; // r9 void (__fastcall *v36)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r6 cocos2d::CCSprite *v37; // r6 CCMenuItemSpriteExtra *v38; // r9 void (__fastcall *v39)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r5 _BOOL4 v40; // r5 ButtonSprite *v41; // r0 CCMenuItemSpriteExtra *v42; // r8 cocos2d::CCLabelBMFont *v43; // r6 void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8 void (__fastcall *v45)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r4 float v46; // s19 cocos2d::CCSprite *v47; // r6 void (__fastcall *v48)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8 ButtonSprite *v49; // r0 CCMenuItemSpriteExtra *v50; // r6 int v51; // r9 cocos2d::CCArray *v52; // r0 cocos2d::CCArray *v53; // r5 bool v54; // r7 cocos2d::CCObject *m_mainLayer; // r9 CCMenuItemToggler *ToggleButton; // r9 bool v57; // r7 cocos2d::CCObject *v58; // r10 CCMenuItemToggler *v59; // r4 GameStatsManager *v60; // r0 int v61; // r6 int v62; // r0 int v63; // r5 CCMenuItemSpriteExtra *v64; // r0 int v65; // r0 CCMenuItemSpriteExtra *v66; // r0 int v67; // r0 const char *m_uReference; // r1 cocos2d::CCString *v69; // r0 cocos2d::CCLabelBMFont *v70; // r5 void (__fastcall *v71)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r6 cocos2d::CCString *v73; // r0 cocos2d::CCLabelBMFont *v74; // r8 void (__fastcall *v75)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r6 int v76; // r9 cocos2d::CCArray *v77; // r0 cocos2d::CCArray *v78; // r6 char *v79; // r0 ButtonSprite *v80; // r0 CCMenuItemSpriteExtra *v81; // r5 ButtonSprite *v82; // r0 CCMenuItemSpriteExtra *v83; // r5 ButtonSprite *v84; // r0 CCMenuItemSpriteExtra *v85; // r5 cocos2d::CCNode *v86; // r5 float v87; // r2 float v88; // r3 float v89; // [sp+10h] [bp-D4h] cocos2d::CCPoint *v91; // [sp+34h] [bp-B0h] int v92; // [sp+38h] [bp-ACh] cocos2d::CCNode *v93; // [sp+3Ch] [bp-A8h] cocos2d::CCNode *v94; // [sp+3Ch] [bp-A8h] cocos2d::CCNode *v95; // [sp+3Ch] [bp-A8h] cocos2d::CCNode *m_buttonMenu; // [sp+44h] [bp-A0h] cocos2d::CCPoint *v97; // [sp+44h] [bp-A0h] cocos2d::CCNode *v98; // [sp+48h] [bp-9Ch] int v99; // [sp+50h] [bp-94h] void (__fastcall *v100)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+54h] [bp-90h] char v101[4]; // [sp+60h] [bp-84h] BYREF cocos2d::CCSize v102; // [sp+64h] [bp-80h] BYREF cocos2d::CCPoint v103; // [sp+6Ch] [bp-78h] BYREF cocos2d::CCPoint v104; // [sp+74h] [bp-70h] BYREF cocos2d::CCPoint v105; // [sp+7Ch] [bp-68h] BYREF cocos2d::CCPoint v106; // [sp+84h] [bp-60h] BYREF void (*v107)(SongInfoLayer *, cocos2d::CCObject *); // [sp+8Ch] [bp-58h] int v108; // [sp+90h] [bp-54h] void (*v109)(SongInfoLayer *, cocos2d::CCObject *); // [sp+94h] [bp-50h] int v110; // [sp+98h] [bp-4Ch] void (*v111)(SongInfoLayer *, cocos2d::CCObject *); // [sp+9Ch] [bp-48h] int v112; // [sp+A0h] [bp-44h] void (*v113)(SongInfoLayer *, cocos2d::CCObject *); // [sp+A4h] [bp-40h] int v114; // [sp+A8h] [bp-3Ch] cocos2d::CCSprite *v115[2]; // [sp+ACh] [bp-38h] BYREF cocos2d::CCPoint v116; // [sp+B4h] [bp-30h] BYREF cocos2d::CCPoint v117; // [sp+BCh] [bp-28h] BYREF cocos2d::CCPoint v118; // [sp+C4h] [bp-20h] BYREF cocos2d::CCRect v119; // [sp+CCh] [bp-18h] BYREF cocos2d::CCSize v120; // 0:^0.8 cocos2d::CCRect v121; // 0:kr00_16.16 v92 = FLAlertLayer::init(a1, (cocos2d::_ccColor4B)150); if ( !v92 ) return v92; sub_775D40(&a1[1], a4); sub_775D40(&a1[1].m_uID, a5); sub_775D40(&a1[1].m_nLuaID, a6); sub_775D40(&a1[1].m_nTag, a7); a1[1].m_uReference = a8; v12 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v102, v12); cocos2d::CCRect::CCRect(&v119, 0.0, 0.0, 80.0, 80.0); v121.origin.x = v87; v121.origin.y = v88; v121.size = v120; v13 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"GJ_square01.png", (const char *)&v119, v121); ((void (__fastcall *)(cocos2d::CCNode *, int))v13->__vftable[1].~CCNode_0)(v13, 255); setContentSize = v13->setContentSize; cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v119, 420.0, 280.0); setContentSize(v13, (const cocos2d::CCSize *)&v119); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v13, -1); setPosition = v13->setPosition; cocos2d::CCPoint::CCPoint(&v119.origin, v102.width * 0.5, v102.height * 0.5); setPosition(v13, &v119.origin); v16 = cocos2d::CCLabelBMFont::create(); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v16, 20); v17 = v16->setPosition; cocos2d::CCPoint::CCPoint(&v119.origin, v102.width * 0.5, (float)((float)(v102.height * 0.5) + 140.0) - 40.0); v17(v16, &v119.origin); if ( v16->getContentSize(v16)->width > 300.0 ) { setScale = v16->setScale; v19 = (float *)v16->getContentSize(v16); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(v16, 300.0 / *v19); } v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s", *a3); cocos2d::CCString::getCString(v20); v21 = cocos2d::CCLabelBMFont::create(); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v21, 20); v22 = v21->setPosition; v23 = v102.width * 0.5; v24 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v16->getPosition)(v16); cocos2d::CCPoint::CCPoint(&v119.origin, v23, *(float *)(LODWORD(v24) + 4) - 35.0); v22(v21, &v119.origin); if ( v21->getContentSize(v21)->width > 340.0 ) { v25 = v21->setScale; v26 = (float *)v21->getContentSize(v21); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))v25)(v21, 340.0 / *v26); } v27 = v21->setScale; if ( v21->getScale(v21) > 0.8 ) v28 = 1061997773; else v28 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))v21->getScale)(v21); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v27)(v21, v28); a1->m_joystickConnected = -1; v29 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png"); v108 = 0; v107 = SongInfoLayer::onClose; v30 = CCMenuItemSpriteExtra::create( v29, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onClose, (unsigned int)a1)); CCMenuItemSpriteExtra::setSizeMult(v30, 1.6); v31 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v30, nullptr); height = v102.height; v33 = (float)(v102.width * 0.5) - 210.0; v34 = v31->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; v35 = v31; a1->m_buttonMenu = v31; v36 = v34->setPosition; cocos2d::CCPoint::CCPoint(&v119.origin, v33 + 10.0, (float)((float)(height * 0.5) + 140.0) - 10.0); v36(v35, &v119.origin); a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10); v37 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_BPMOnBtn_001.png"); ((void (__fastcall *)(cocos2d::CCSprite *, int))v37->setScale)(v37, 1061997773); v110 = 0; v109 = SongInfoLayer::onBPM; v38 = CCMenuItemSpriteExtra::create( v37, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onBPM, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v38); v39 = v38->setPosition; m_buttonMenu = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint( &v118, (float)((float)(v102.width * 0.5) + 210.0) - 23.0, (float)((float)(v102.height * 0.5) - 140.0) + 23.0); cocos2d::CCNode::convertToNodeSpace(&v119.origin, m_buttonMenu, &v118); v39(v38, &v119.origin); v40 = (signed int)a1[1].m_uReference > (int)" of X position. These triggers need to use Group ID and have Spawn Trigger enabled.\nPreview Disable disables activation while not playtesting in editor.\nSpawn Ordered spawns the triggers in order from left to right.\nUse remapping (page 2) to copy a Spawn setup to another group."; if ( (signed int)a1[1].m_uReference > (int)" of X position. These triggers need to use Group ID and have Spawn Trigger enabled.\nPreview Disable disables activation while not playtesting in editor.\nSpawn Ordered spawns the triggers in order from left to right.\nUse remapping (page 2) to copy a Spawn setup to another group." ) { if ( *(_DWORD *)(*a9 - 12) ) { formatTags(&v117); v43 = cocos2d::CCLabelBMFont::create(); setAnchorPoint = v43->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v119.origin, 0.5, 1.0); setAnchorPoint(v43, &v119.origin); cocos2d::CCLabelBMFont::limitLabelWidth(v43, 320.0, 0.5, 0.0); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v43, 10); v45 = v43->setPosition; v97 = (cocos2d::CCPoint *)v21->getPosition(v21); cocos2d::CCPoint::CCPoint(&v118, 0.0, -30.0); cocos2d::CCPoint::operator+(&v119, v97, &v118); v45(v43, &v119.origin); sub_774008(&v117); } if ( a10 <= 0 ) goto LABEL_11; } else { v41 = ButtonSprite::create( (ButtonSprite *)"Download Soundtrack", (const char *)off_DC, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", (const char *)0x41F00000, v89); v112 = 0; v111 = SongInfoLayer::onDownload; v42 = CCMenuItemSpriteExtra::create( v41, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onDownload, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v42); v100 = v42->setPosition; v98 = a1->m_buttonMenu; v99 = (int)v21->getPosition(v21); cocos2d::CCPoint::CCPoint(&v117, 0.0, -50.0); cocos2d::CCPoint::operator+(&v118, v99, &v117); cocos2d::CCNode::convertToNodeSpace(&v119.origin, v98, &v118); v100(v42, &v119.origin); if ( a10 <= 0 ) { LABEL_11: v73 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"More By %s", *a3); cocos2d::CCString::getCString(v73); v74 = cocos2d::CCLabelBMFont::create(); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v74, 20); v75 = v74->setPosition; v76 = (int)v21->getPosition(v21); cocos2d::CCPoint::CCPoint(&v118, 0.0, -110.0); cocos2d::CCPoint::operator+(&v119, v76, &v118); v75(v74, &v119.origin); v77 = (cocos2d::CCArray *)((int (__fastcall *)(cocos2d::CCLabelBMFont *, int))v74->setScale)(v74, 1056964608); v78 = (cocos2d::CCArray *)cocos2d::CCArray::create(v77); if ( *(_DWORD *)(*a5 - 12) ) { if ( v40 ) v79 = "Website"; else v79 = "Newgrounds"; v80 = ButtonSprite::create( (ButtonSprite *)v79, (const char *)&dword_50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", (const char *)0x41F00000, v89); v114 = 0; v113 = SongInfoLayer::onNG; v81 = CCMenuItemSpriteExtra::create( v80, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onNG, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v81); cocos2d::CCArray::addObject(v78, v81); } if ( *(_DWORD *)(a1[1].m_nLuaID - 12) ) { v82 = ButtonSprite::create( (ButtonSprite *)"YouTube", (const char *)&dword_50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", (const char *)0x41F00000, v89); v115[1] = nullptr; v115[0] = (cocos2d::CCSprite *)SongInfoLayer::onYT; v83 = CCMenuItemSpriteExtra::create( v82, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onYT, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v83); cocos2d::CCArray::addObject(v78, v83); } if ( *(_DWORD *)(a1[1].m_nTag - 12) ) { sub_776584((int)&v119, "Facebook"); if ( sub_7748A0((int)&a1[1].m_nTag, "instagram") != -1 ) sub_7753D4((int)&v119, "Instagram"); v84 = ButtonSprite::create( (ButtonSprite *)LODWORD(v119.origin.x), (const char *)&dword_50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", (const char *)0x41F00000, v89); v116.y = 0.0; LODWORD(v116.x) = SongInfoLayer::onFB; v85 = CCMenuItemSpriteExtra::create( v84, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onFB, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v85); cocos2d::CCArray::addObject(v78, v85); sub_774008(&v119); } v52 = (cocos2d::CCArray *)cocos2d::CCArray::count(v78); if ( v52 ) { v86 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v118, v102.width * 0.5, (float)((float)(v102.height * 0.5) - 140.0) + 65.0); cocos2d::CCNode::convertToNodeSpace(&v119.origin, v86, &v118); GameToolbox::alignItemsHorisontally(v78, 20.0, (cocos2d::CCPoint)(unsigned int)&v119, 0); } goto LABEL_18; } } sub_776584((int)v115, "ncs_med_001.png"); if ( a10 == 2 ) { sub_7753D4((int)v115, "chompo_med_001.png"); v46 = -36.0; } else { v46 = -32.0; } v47 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v115[0]); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v47, 11); v48 = v47->setPosition; cocos2d::CCPoint::CCPoint( &v119.origin, (float)((float)(v102.width * 0.5) + 210.0) + v46, (float)((float)(v102.height * 0.5) + 140.0) - 18.0); v48(v47, &v119.origin); v49 = ButtonSprite::create( (ButtonSprite *)"Download Soundtrack", (const char *)off_DC, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", (const char *)0x41F00000, v89); v117.y = 0.0; LODWORD(v117.x) = SongInfoLayer::onDownload; v50 = CCMenuItemSpriteExtra::create( v49, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SongInfoLayer::onDownload, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v50); v91 = (cocos2d::CCPoint *)v50->setPosition; v93 = a1->m_buttonMenu; v51 = (int)v21->getPosition(v21); cocos2d::CCPoint::CCPoint(&v116, 0.0, -100.0); cocos2d::CCPoint::operator+(&v118, v51, &v116); cocos2d::CCNode::convertToNodeSpace(&v119.origin, v93, &v118); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *))v91)(v50, &v119); v52 = (cocos2d::CCArray *)sub_774008(v115); LABEL_18: if ( (int)a1[1].m_uReference > 0 ) { v53 = (cocos2d::CCArray *)cocos2d::CCArray::create(v52); cocos2d::CCPoint::CCPoint( &v103, (float)((float)(v102.width * 0.5) - 210.0) + 20.0, (float)((float)(v102.height * 0.5) - 140.0) + 20.0); sub_776584((int)&v105, "Menu"); LODWORD(v118.x) = SongInfoLayer::onMenuMusic; v118.y = 0.0; v54 = GameManager::sharedState()->m_customMenuSongID == a1[1].m_uReference; v94 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v119.origin, &v103); m_mainLayer = a1->m_mainLayer; cocos2d::CCPoint::CCPoint(&v106, 5.0, 1.0); ToggleButton = GameToolbox::createToggleButton( (int)&v105, LODWORD(v118.x), LODWORD(v118.y), v54, v94, &v119.origin, a1, m_mainLayer, 0.7, 0.3, 80.0, (int)&v106, (int)"bigFont.fnt", 0, 0, v53); sub_774008(&v105); sub_776584((int)v101, "Practice"); LODWORD(v119.origin.x) = SongInfoLayer::onPracticeMusic; v119.origin.y = 0.0; v57 = GameManager::sharedState()->m_customPracticeSongID == a1[1].m_uReference; v95 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v104, 0.0, 30.0); cocos2d::CCPoint::operator+(&v105, &v103, &v104); v58 = a1->m_mainLayer; cocos2d::CCPoint::CCPoint(&v106, 5.0, 1.0); v59 = GameToolbox::createToggleButton( (int)v101, LODWORD(v119.origin.x), LODWORD(v119.origin.y), v57, v95, &v105, a1, v58, 0.7, 0.3, 80.0, (int)&v106, (int)"bigFont.fnt", 0, 0, v53); sub_774008(v101); v60 = GameStatsManager::sharedState(); if ( !GameStatsManager::isItemUnlocked(v60, GJItem, 16) ) { v61 = cocos2d::CCArray::objectAtIndex(v53, 1u); v62 = cocos2d::CCArray::objectAtIndex(v53, 3u); ToggleButton->m_notClickable = 1; v59->m_notClickable = 1; LOWORD(v106.x) = -26986; BYTE2(v106.x) = -106; v63 = v62; v64 = CCMenuItemToggler::activeItem(ToggleButton); v65 = (int)v64->getNormalImage(v64); (*(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v65 + 472))(v65, &v106); v66 = CCMenuItemToggler::activeItem(v59); v67 = (int)v66->getNormalImage(v66); (*(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v67 + 472))(v67, &v106); (*(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v61 + 528))(v61, &v106); (*(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v63 + 528))(v63, &v106); } } m_uReference = (const char *)a1[1].m_uReference; if ( (int)m_uReference > 0 ) { v69 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"SongID: %i", m_uReference); cocos2d::CCString::getCString(v69); v70 = cocos2d::CCLabelBMFont::create(); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v70->setScale)(v70, 1053609165); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v70, 20); v71 = v70->setPosition; cocos2d::CCPoint::CCPoint(&v106, v102.width * 0.5, (float)((float)(v102.height * 0.5) - 140.0) + 16.0); v71(v70, &v106); } return v92; }
GD Web Decomp Icon

GD Web Decomp

Raw Source