// // CustomSFXWidget::init from 0x1400c0780 to 0x1400c166e (3822 bytes) // // 2 xrefs: // > CustomSFXWidget::create @ 0x1400c0731 // > @ 0x1406c7f14 // // 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 // // Hidden C++ exception states: #wind=1 bool CustomSFXWidget::init( CustomSFXWidget *a1, SFXInfoObject *a2, CustomSFXDelegate *a3, bool a4, bool a5, bool a6, bool a7, bool a8) { bool result; // al SFXInfoObject *m_sfxObject; // rcx cocos2d::CCDirector *v14; // rax SFXInfoObject *v15; // rax char v16; // r15 int m_sfxID; // ebx CustomSFXDelegate *m_delegate; // rcx char v19; // cl int v20; // r13d struct cocos2d::extension::CCScale9Sprite *v21; // r12 struct cocos2d::CCRect *v22; // rax __int64 v23; // rdx cocos2d::extension::CCScale9Sprite_vtbl *v24; // rbx const cocos2d::CCSize *v25; // rax void *v26; // rcx float v27; // xmm6_4 cocos2d::CCMenu *v28; // rax __int64 v29; // rcx __int64 v30; // rax cocos2d::CCTouchDispatcher *v31; // rax __int64 v32; // rcx __int64 v33; // rax __int64 v34; // rax struct cocos2d::CCLabelBMFont *v35; // rax cocos2d::CCRGBAProtocol *v36; // rcx cocos2d::CCRGBAProtocol_vtbl *v37; // rax cocos2d::ccColor3B *v38; // rdx __int64 v39; // rdx struct cocos2d::CCLabelBMFont *v40; // rax cocos2d::CCLabelBMFont_vtbl *v41; // rbx const cocos2d::CCPoint *v42; // rax cocos2d::CCLabelBMFont_vtbl *v43; // rbx const cocos2d::CCPoint *v44; // rax cocos2d::CCLabelBMFont_vtbl *v45; // rbx const cocos2d::CCPoint *v46; // rax cocos2d::CCLabelBMFont_vtbl *v47; // rbx const cocos2d::CCPoint *v48; // rax const cocos2d::CCPoint *v49; // rax cocos2d::CCLabelBMFont_vtbl *v50; // rbx const cocos2d::CCPoint *v51; // rax const cocos2d::CCPoint *v52; // rax int v53; // eax float v54; // xmm9_4 struct cocos2d::CCSprite *v55; // rbx CCMenuItemSpriteExtra *v56; // rax struct cocos2d::CCSprite *v57; // rbx CCMenuItemSpriteExtra *v58; // rax struct cocos2d::CCSprite *v59; // rbx CCMenuItemSpriteExtra *v60; // rax struct cocos2d::CCSprite *v61; // rbx CCMenuItemSpriteExtra *v62; // rax struct cocos2d::CCSprite *v63; // rbx CCMenuItemSpriteExtra *v64; // rax CCMenuItemSpriteExtra_vtbl *v65; // rbx struct cocos2d::CCPoint v66; // rax CCMenuItemSpriteExtra_vtbl *v67; // rbx const cocos2d::CCPoint *v68; // rax struct cocos2d::CCPoint v69; // rax CCMenuItemSpriteExtra_vtbl *v70; // rbx const cocos2d::CCPoint *v71; // rax float v72; // xmm9_4 const cocos2d::CCPoint *v73; // rax const cocos2d::CCPoint *v74; // rax struct cocos2d::CCSprite *v75; // rax cocos2d::CCNode *v76; // rbx CCMenuItemSpriteExtra *v77; // rbx CCMenuItemSpriteExtra_vtbl *v78; // rdi float v79; // xmm1_4 struct cocos2d::CCPoint v80; // rax cocos2d::CCSprite *v81; // rbx cocos2d::CCNode *v82; // rdi const cocos2d::CCPoint *v83; // rax const cocos2d::CCPoint *v84; // rax cocos2d::CCSprite *v85; // rax __int64 v86; // rdx struct cocos2d::CCRect *v87; // rax struct cocos2d::extension::CCScale9Sprite *v88; // rdi cocos2d::extension::CCScale9Sprite_vtbl *v89; // rbx const cocos2d::CCSize *v90; // rax void (__fastcall *setColor)(cocos2d::CCRGBAProtocol *__hidden, const cocos2d::ccColor3B *); // r8 cocos2d::CCSprite *v92; // rax struct cocos2d::CCSprite *v93; // rax cocos2d::CCTexture2D *v94; // rax cocos2d::CCSprite_vtbl *v95; // rbx const cocos2d::CCPoint *v96; // rax cocos2d::CCSprite_vtbl *v97; // rbx const cocos2d::CCPoint *v98; // rax cocos2d::CCSprite_vtbl *v99; // rbx const cocos2d::CCPoint *v100; // rax const cocos2d::CCPoint *v101; // rax cocos2d::CCSprite *m_progressBarSprite; // rbx cocos2d::CCSprite_vtbl *v103; // rdi const cocos2d::CCRect *v104; // rax SFXInfoObject *v105; // rcx SFXInfoObject *v106; // rcx int *p_m_sfxID; // rdi MusicDownloadManager *v108; // rax int v109; // ebx MusicDownloadManager *v110; // rax __int16 v111; // [rsp+38h] [rbp-C9h] BYREF char v112; // [rsp+3Ah] [rbp-C7h] char v113; // [rsp+3Bh] [rbp-C6h] cocos2d::CCSize v114; // [rsp+3Ch] [rbp-C5h] BYREF cocos2d::CCRect v115; // [rsp+48h] [rbp-B9h] BYREF char v116; // [rsp+60h] [rbp-A1h] BYREF void *Block_8[2]; // [rsp+70h] [rbp-91h] BYREF __int64 v118; // [rsp+80h] [rbp-81h] unsigned __int64 v119; // [rsp+88h] [rbp-79h] struct cocos2d::_ccTexParams v120; // [rsp+90h] [rbp-71h] BYREF result = cocos2d::CCNode::init(a1); if ( !result ) return result; if ( a1->m_sfxObject != a2 ) { if ( a2 ) cocos2d::CCObject::retain(a2); m_sfxObject = a1->m_sfxObject; if ( m_sfxObject ) cocos2d::CCObject::release(m_sfxObject); a1->m_sfxObject = a2; } a1->m_delegate = a3; a1->m_showDelete = a4; *(_WORD *)&a1->m_showPlay = 257; a1->m_compactMode = a8; v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(m_sfxObject); cocos2d::CCDirector::getWinSize(v14); v15 = a1->m_sfxObject; if ( v15 && v15->m_folder ) { v16 = 1; } else { v16 = 0; if ( !v15 ) { LABEL_16: v19 = 0; goto LABEL_17; } } m_sfxID = v15->m_sfxID; if ( m_sfxID <= 0 ) goto LABEL_16; m_delegate = a1->m_delegate; if ( !m_delegate || m_delegate->getActiveSFXID(m_delegate) != m_sfxID ) goto LABEL_16; v19 = 1; LABEL_17: v113 = v19; v20 = 0; v21 = nullptr; if ( !a8 ) { v118 = 15; v119 = 15; qmemcpy(Block_8, "GJ_square01.pn", 14); HIWORD(Block_8[1]) = (unsigned __int8)aGjSquare01Png[14]; if ( v16 || v19 ) { v118 = 15; strcpy((char *)Block_8, "GJ_square06.png"); } cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v116, 0.0, 0.0, 80.0, 80.0); v21 = cocos2d::extension::CCScale9Sprite::create((const char *)Block_8, v22); LOBYTE(v23) = -1; v21->setOpacity(&v21->cocos2d::CCRGBAProtocol, v23); v24 = v21->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v115, 320.0, 50.0); v24->setContentSize(v21, v25); a1->addChild_0(a1, v21, -2); if ( v119 > 0xF ) { v26 = Block_8[0]; if ( v119 + 1 >= 0x1000 ) { v26 = *((void **)Block_8[0] - 1); if ( (unsigned __int64)((char *)Block_8[0] - (char *)v26 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free(v26); } v118 = 0; v119 = 15; LOBYTE(Block_8[0]) = 0; } v27 = (float)(v16 != 0 ? 0x32 : 0); v28 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v16 != 0 ? 0x32 : 0); a1->m_buttonMenu = v28; a1->addChild_1(a1, v28); v30 = cocos2d::CCDirector::sharedDirector(v29); v31 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v30 + 144LL))(v30); if ( cocos2d::CCTouchDispatcher::isUsingForcePrio(v31) ) { v33 = cocos2d::CCDirector::sharedDirector(v32); v34 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v33 + 144LL))(v33); a1->m_buttonMenu->setTouchPriority(a1->m_buttonMenu, *(_DWORD *)(v34 + 124) - 1); } a1->m_titleLabel = cocos2d::CCLabelBMFont::create("SFX Title", (const char *)&qword_14052A4D8); v35 = cocos2d::CCLabelBMFont::create("SFX ID", "chatFont.fnt"); a1->m_idLabel = v35; v36 = &v35->cocos2d::CCRGBAProtocol; v37 = v35->cocos2d::CCRGBAProtocol::__vftable; v38 = (cocos2d::ccColor3B *)&unk_140529A20; if ( v16 ) v38 = (cocos2d::ccColor3B *)&unk_140529A24; v37->setColor(v36, v38); LOBYTE(v39) = -56; a1->m_idLabel->setOpacity(&a1->m_idLabel->cocos2d::CCRGBAProtocol, v39); v40 = cocos2d::CCLabelBMFont::create("Error", (const char *)&qword_14052A4D8); a1->m_errorLabel = v40; v111 = 13055; v112 = 25; v40->setColor(&v40->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v111); a1->m_errorLabel->setVisible(a1->m_errorLabel, 0); a1->addChild_1(a1, a1->m_titleLabel); a1->addChild_1(a1, a1->m_idLabel); a1->addChild_1(a1, a1->m_errorLabel); v41 = a1->m_titleLabel->__vftable; cocos2d::CCPoint::CCPoint(&v115.origin, 0.0, 0.5); v41->setAnchorPoint(a1->m_titleLabel, v42); v43 = a1->m_errorLabel->__vftable; cocos2d::CCPoint::CCPoint(&v115.origin, 0.0, 0.5); v43->setAnchorPoint(a1->m_errorLabel, v44); v45 = a1->m_idLabel->__vftable; cocos2d::CCPoint::CCPoint(&v115.origin, 0.0, 0.5); v45->setAnchorPoint(a1->m_idLabel, v46); v47 = a1->m_titleLabel->__vftable; if ( a8 ) { cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, -160.0, 0.0); v47->setPosition_0(a1->m_titleLabel, v52); } else { cocos2d::CCPoint::CCPoint(&v115.origin, v27 - 150.0, 9.0); v47->setPosition_0(a1->m_titleLabel, v48); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 1.0, -18.0); v49 = a1->m_titleLabel->getPosition_0(a1->m_titleLabel); cocos2d::CCPoint::operator+(v49, &v115); a1->m_errorLabel->setPosition_0(a1->m_errorLabel, (const cocos2d::CCPoint *)&v115); v50 = a1->m_idLabel->__vftable; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v27 - 149.0, -9.0); v50->setPosition_0(a1->m_idLabel, v51); } ((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_idLabel->setScale_0)(a1->m_idLabel); v53 = 40; if ( a8 ) v53 = 20; v54 = (float)v53; v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_downloadBtn_001.png"); ((void (__fastcall *)(struct cocos2d::CCSprite *))v55->setScale_0)(v55); v56 = CCMenuItemSpriteExtra::create(v55, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onDownload); a1->m_downloadButton = v56; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v56); HIDWORD(a1->m_downloadButton->m_pfnSelector.adj) = 1066192077; v57 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_cancelDownloadBtn_001.png"); ((void (__fastcall *)(struct cocos2d::CCSprite *))v57->setScale_0)(v57); v58 = CCMenuItemSpriteExtra::create(v57, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onCancelDownload); a1->m_cancelButton = v58; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v58); HIDWORD(a1->m_cancelButton->m_pfnSelector.adj) = 1066192077; v59 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_trashBtn_001.png"); ((void (__fastcall *)(struct cocos2d::CCSprite *))v59->setScale_0)(v59); v60 = CCMenuItemSpriteExtra::create(v59, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onDelete); a1->m_deleteButton = v60; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v60); HIDWORD(a1->m_deleteButton->m_pfnSelector.adj) = 1066192077; v61 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_selectSongBtn_001.png"); ((void (__fastcall *)(struct cocos2d::CCSprite *))v61->setScale_0)(v61); v62 = CCMenuItemSpriteExtra::create(v61, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onSelect); a1->m_selectButton = v62; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v62); HIDWORD(a1->m_selectButton->m_pfnSelector.adj) = 1066192077; v63 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playMusicBtn_001.png"); ((void (__fastcall *)(struct cocos2d::CCSprite *))v63->setScale_0)(v63); v64 = CCMenuItemSpriteExtra::create(v63, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onPlayback); a1->m_playButton = v64; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v64); v65 = a1->m_downloadButton->__vftable; if ( a8 ) { cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 155.0, 0.0); v69 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v115.origin); ((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v65->setPosition_0)( a1->m_downloadButton, v69); v67 = a1->m_playButton->__vftable; v68 = a1->m_downloadButton->getPosition_0(a1->m_downloadButton); } else { cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 137.0, 0.0); v66 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v115.origin); ((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v65->setPosition_0)( a1->m_downloadButton, v66); v67 = a1->m_playButton->__vftable; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 137.0, 1.0); v68 = (const cocos2d::CCPoint *)cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v115.origin); } v67->setPosition_0(a1->m_playButton, v68); v70 = a1->m_cancelButton->__vftable; v71 = a1->m_downloadButton->getPosition_0(a1->m_downloadButton); v70->setPosition_0(a1->m_cancelButton, v71); v72 = -v54; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v72 + v72, 0.0); v73 = a1->m_downloadButton->getPosition_0(a1->m_downloadButton); cocos2d::CCPoint::operator+(v73, &v115); a1->m_deleteButton->setPosition_0(a1->m_deleteButton, (const cocos2d::CCPoint *)&v115); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v72, 0.0); v74 = a1->m_downloadButton->getPosition_0(a1->m_downloadButton); cocos2d::CCPoint::operator+(v74, &v115); a1->m_selectButton->setPosition_0(a1->m_selectButton, (const cocos2d::CCPoint *)&v115); if ( v16 ) { v75 = cocos2d::CCSprite::createWithSpriteFrameName("folderIcon_001.png"); v76 = v75; if ( a1->m_compactMode ) ((void (__fastcall *)(struct cocos2d::CCSprite *))v75->setScale_0)(v75); v77 = CCMenuItemSpriteExtra::create(v76, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onSelect); a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v77); v78 = v77->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; if ( a1->m_compactMode ) v79 = -150.0; else v79 = -130.0; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v79, 2.0); v80 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v115.origin); ((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v78->setPosition_0)(v77, v80); v81 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png"); cocos2d::CCSprite::setFlipX(v81, 1); ((void (__fastcall *)(cocos2d::CCSprite *))v81->setScale_0)(v81); v82 = CCMenuItemSpriteExtra::create(v81, nullptr, a1, (cocos2d::SEL_MenuHandler *)CustomSFXWidget::onSelect); v82[1].m_unknown5 = 1067030938; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v82); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 0.0, 1.0); v83 = a1->m_downloadButton->getPosition_0(a1->m_downloadButton); cocos2d::CCPoint::operator+(v83, &v115); v82->setPosition_0(v82, &v115.origin); if ( a1->m_compactMode ) { cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 28.0, 0.0); v84 = a1->m_titleLabel->getPosition_0(a1->m_titleLabel); cocos2d::CCPoint::operator+(v84, &v115); a1->m_titleLabel->setPosition_0(a1->m_titleLabel, (const cocos2d::CCPoint *)&v115); } } v85 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png"); a1->m_clockSprite = v85; ((void (__fastcall *)(cocos2d::CCSprite *))v85->setScale_0)(v85); LOBYTE(v86) = -106; a1->m_clockSprite->setOpacity(&a1->m_clockSprite->cocos2d::CCRGBAProtocol, v86); a1->m_clockSprite->setVisible(a1->m_clockSprite, 0); a1->addChild_1(a1, a1->m_clockSprite); if ( v21 && (v16 || v113) ) { cocos2d::CCRect::CCRect(&v115, 0.0, 0.0, 80.0, 80.0); v88 = cocos2d::extension::CCScale9Sprite::create("GJ_square07.png", v87); v89 = v88->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; cocos2d::CCSize::CCSize(&v114, 320.0, 50.0); v89->setContentSize(v88, v90); a1->addChild_0(a1, v88, -1); setColor = v21->setColor; if ( v16 ) { v111 = -28202; v112 = 96; } else { v111 = -19713; v112 = 61; } setColor(&v21->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v111); } v92 = cocos2d::CCSprite::create("slidergroove.png"); a1->m_progressOutlineSprite = v92; a1->addChild_0(a1, v92, 3); v93 = cocos2d::CCSprite::create("sliderBar.png"); a1->m_progressBarSprite = v93; v120.minFilter = 9729; v120.magFilter = 9729; v120.wrapS = 10497; v120.wrapT = 10497; v94 = v93->getTexture(&v93->cocos2d::CCTextureProtocol); cocos2d::CCTexture2D::setTexParameters(v94, &v120); a1->m_progressOutlineSprite->addChild_0(a1->m_progressOutlineSprite, a1->m_progressBarSprite, -1); v95 = a1->m_progressBarSprite->__vftable; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 0.0, 0.0); v95->setAnchorPoint(a1->m_progressBarSprite, v96); v97 = a1->m_progressBarSprite->__vftable; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 2.0, 4.0); v97->setPosition_0(a1->m_progressBarSprite, v98); v99 = a1->m_progressOutlineSprite->__vftable; v100 = a1->m_errorLabel->getPosition_0(a1->m_errorLabel); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, 0.0, v100->y); v99->setPosition_0(a1->m_progressOutlineSprite, v101); ((void (__fastcall *)(cocos2d::CCSprite *))a1->m_progressOutlineSprite->setScaleY)(a1->m_progressOutlineSprite); ((void (__fastcall *)(cocos2d::CCSprite *))a1->m_progressOutlineSprite->setScaleX)(a1->m_progressOutlineSprite); m_progressBarSprite = a1->m_progressBarSprite; v103 = m_progressBarSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; cocos2d::CCRect::CCRect( (cocos2d::CCRect *)&v116, 0.0, 0.0, fminf( a1->m_progressOutlineSprite->m_obRect.size.width - 4.0, (float)(a1->m_progressOutlineSprite->m_obRect.size.width - 4.0) * 0.0), 8.0); v103->setTextureRect_0(m_progressBarSprite, v104); CustomSFXWidget::hideLoadingArt(a1); if ( a2 ) { a1->m_errorLabel->setVisible(a1->m_errorLabel, 0); v105 = a1->m_sfxObject; if ( v105 == a2 ) { p_m_sfxID = &a1->m_sfxID; if ( v105 ) v20 = v105->m_sfxID; a1->m_sfxID = v20; } else { cocos2d::CCObject::retain(a2); v106 = a1->m_sfxObject; if ( v106 ) cocos2d::CCObject::release(v106); a1->m_sfxObject = a2; p_m_sfxID = &a1->m_sfxID; a1->m_sfxID = a2->m_sfxID; } } else { p_m_sfxID = &a1->m_sfxID; } CustomSFXWidget::updateSFXInfo(a1); v108 = MusicDownloadManager::sharedState(); MusicDownloadManager::addMusicDownloadDelegate(v108, &a1->MusicDownloadDelegate); v109 = *p_m_sfxID; if ( *p_m_sfxID ) { v110 = MusicDownloadManager::sharedState(); if ( MusicDownloadManager::isRunningActionForSongID(v110, v109) ) CustomSFXWidget::startMonitorDownload(a1); } return 1; }