// // CreateGuidelinesLayer::init from 0x5c0918 to 0x5c1894 (3964 bytes) // // 3 xrefs: // > CreateGuidelinesLayer::create @ 0x5c19cc // > FindBPMLayer::init @ 0x5c1a64 // > @ 0x6d398 // // 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 CreateGuidelinesLayer::init(CreateGuidelinesLayer *a1, CustomSongDelegate *a2, AudioGuidelinesType a3) { char v5; // w26 cocos2d::CCDirector *v7; // x0 cocos2d::CCArray *v8; // x0 cocos2d::CCArray *v9; // x0 cocos2d::CCArray *v10; // x0 cocos2d::CCArray *v11; // x0 cocos2d::CCMenu *v12; // x0 cocos2d::CCLayer *m_mainLayer; // x3 cocos2d::CCNode *v14; // x21 void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x22 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22 cocos2d::CCLabelBMFont *v17; // x21 void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22 cocos2d::CCLabelBMFont *v19; // x22 void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x2 cocos2d::CCSequence *v22; // x23 cocos2d::CCTintTo *v23; // x0 cocos2d::CCActionInterval *v24; // x0 cocos2d::CCRepeatForever *v25; // x0 cocos2d::CCNode *v26; // x22 void *v27; // x0 void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 cocos2d::CCNode *v29; // x24 void *v30; // x0 void (__fastcall *v31)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28 void (__fastcall *v32)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28 __int64 v33; // x21 bool v34; // w4 __int64 v35; // x5 const char *v36; // x6 cocos2d::CCNode *v37; // x0 CCMenuItemSpriteExtra *v38; // x21 cocos2d::CCMenu *m_buttonMenu; // x28 void (__fastcall *v40)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24 cocos2d::CCLabelBMFont *v41; // x21 void (__fastcall *v42)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28 cocos2d::CCNode *v43; // x21 CCTextInputNode *v44; // x0 cocos2d::CCLayer *v45; // x3 CCTextInputNode *m_offsetInput; // x21 void *v47; // x0 ButtonSprite *v48; // x0 CCMenuItemSpriteExtra *v49; // x21 cocos2d::CCMenu *v50; // x24 void (__fastcall *v51)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 ButtonSprite *v52; // x0 CCMenuItemSpriteExtra *v53; // x21 cocos2d::CCMenu *v54; // x24 void (__fastcall *v55)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 cocos2d::CCLabelBMFont *v56; // x21 void (__fastcall *v57)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 cocos2d::CCSprite *v58; // x23 void (__fastcall *v59)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x21 cocos2d::CCSprite *v60; // x0 CCMenuItemSpriteExtra *v61; // x21 cocos2d::CCMenu *v62; // x24 void (__fastcall *v63)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 cocos2d::CCSprite *v64; // x0 CCMenuItemSpriteExtra *v65; // x21 cocos2d::CCMenu *v66; // x23 void (__fastcall *v67)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24 char *v68; // x0 char *v69; // x0 cocos2d::CCArray **p_m_pTargetArray; // x24 unsigned int *p_m_nExtraKerning; // x21 int m_nExtraKerning; // w0 unsigned int *v73; // x1 int v74; // w2 unsigned int *v75; // x1 int v76; // w2 unsigned int *v77; // x1 int v78; // w2 unsigned int *v79; // x1 int v80; // w2 unsigned int *v81; // x1 int v82; // w2 __int64 v83; // [xsp+98h] [xbp+98h] void (__fastcall *v84)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+A0h] [xbp+A0h] cocos2d::ccColor3B v86; // [xsp+C0h] [xbp+C0h] float v87; // [xsp+C8h] [xbp+C8h] float v88; // [xsp+CCh] [xbp+CCh] cocos2d::CCLabelBMFont *v89; // [xsp+D0h] [xbp+D0h] BYREF char *v90; // [xsp+D8h] [xbp+D8h] BYREF char *v91; // [xsp+E0h] [xbp+E0h] BYREF __int64 v92; // [xsp+E8h] [xbp+E8h] BYREF cocos2d::CCPoint v93; // [xsp+F0h] [xbp+F0h] BYREF cocos2d::CCSize v94; // [xsp+F8h] [xbp+F8h] BYREF cocos2d::CCPoint v95; // [xsp+100h] [xbp+100h] BYREF cocos2d::CCRect v96; // [xsp+108h] [xbp+108h] BYREF cocos2d::CCRect v97; // [xsp+118h] [xbp+118h] BYREF cocos2d::CCPoint v98; // 0:kr08_8.8 cocos2d::CCPoint v99; // 0:kr10_8.8 cocos2d::CCPoint v100; // 0:kr18_8.8 cocos2d::CCPoint v101; // 0:kr20_8.8 cocos2d::CCPoint v102; // 0:kr28_8.8 cocos2d::SEL_MenuHandler v103; // 0:x2.16 cocos2d::SEL_MenuHandler v104; // 0:x2.16 cocos2d::SEL_MenuHandler v105; // 0:x2.16 cocos2d::SEL_MenuHandler v106; // 0:x2.16 cocos2d::SEL_MenuHandler v107; // 0:x2.16 cocos2d::CCRect v108; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v109; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 v5 = FLAlertLayer::init(a1, 0x4Bu); if ( v5 ) { a1->m_delegate = a2; v7 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(v7); v9 = (cocos2d::CCArray *)cocos2d::CCArray::create(v8); a1->m_nonRecordingObjects = v9; cocos2d::CCObject::retain(v9); v11 = (cocos2d::CCArray *)cocos2d::CCArray::create(v10); a1->m_recordingObjects = v11; cocos2d::CCObject::retain(v11); v12 = cocos2d::CCMenu::create(); m_mainLayer = a1->m_mainLayer; a1->m_buttonMenu = v12; m_mainLayer->addChild_0(m_mainLayer, v12, 10); cocos2d::CCRect::CCRect(&v97, 0.0, 0.0, 80.0, 80.0); v14 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"GJ_square01.png", (const char *)&v97, v108); setContentSize = v14->setContentSize; cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v97, 440.0, 290.0); setContentSize(v14, (const cocos2d::CCSize *)&v97); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, -1); setPosition = v14->setPosition; cocos2d::CCPoint::CCPoint(&v97.origin, v87 * 0.5, v88 * 0.5); setPosition(v14, &v97.origin); v89 = (cocos2d::CCLabelBMFont *)&byte_124B6C8; v90 = &byte_124B6C8; v91 = &byte_124B6C8; if ( a3 == BPMFinder ) { sub_D1798C(&v89, "BPM Finder", 10); sub_D1798C(&v90, "- Find the BPM of a song.\n- Tap to the beat.\n- Recording starts on first tap.", 77); sub_D1798C(&v91, "- Tap on the screen to the beat.\n- Tap on the stop button to finish.", 68); } else { sub_D1798C(&v89, "Guideline Creator", 17); sub_D1798C( &v90, "- Create guidelines for custom songs.\n" "- Each tap will be shown as a line in the editor.\n" "- Multiple recordings will be merged into one.\n" "- Use the clear button to reset the guidelines.", 182); sub_D1798C(&v91, "- Tap on the screen to create markers.\n- Tap on the stop button to finish.", 74); } v17 = cocos2d::CCLabelBMFont::create(); v18 = v17->setPosition; cocos2d::CCPoint::CCPoint(&v97.origin, v87 * 0.5, (float)((float)(v88 * 0.5) + 145.0) - 20.0); v18(v17, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v17); v17->setScale(v17, 0.8); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v17); v19 = cocos2d::CCLabelBMFont::create(); v20 = v19->setPosition; cocos2d::CCPoint::CCPoint(&v97.origin, v87 * 0.5, (float)((float)(v88 * 0.5) + 145.0) - 20.0); v20(v19, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v19); v19->setScale(v19, 0.8); cocos2d::CCArray::addObject(a1->m_recordingObjects, v19); setColor = v19->setColor; LOBYTE(v97.origin.x) = -1; *(_WORD *)((char *)&v97.origin.x + 1) = 150; setColor(v19, (const cocos2d::ccColor3B *)&v97); v22 = (cocos2d::CCSequence *)cocos2d::CCTintTo::create(1.0, 0xFFu, 0x64u, 0); v23 = cocos2d::CCTintTo::create(1.0, 0xFFu, 0x96u, 0); v24 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create(v22, v23, 0); v25 = cocos2d::CCRepeatForever::create(v24); cocos2d::CCNode::runAction(v19, v25); sub_D18D28(&v92, &v90); cocos2d::CCPoint::CCPoint(&v97.origin, 0.0, 1.0); v26 = (cocos2d::CCNode *)TextArea::create((__int64)&v92, "goldFont.fnt", &v97.origin, 0, 1.0, 9999.0, 28.0); v27 = (void *)(v92 - 24); if ( (__int64 *)(v92 - 24) != &qword_124B6B0 ) { if ( &pthread_create ) { v73 = (unsigned int *)(v92 - 8); do v74 = __ldaxr(v73); while ( __stlxr(v74 - 1, v73) ); } else { v74 = *(_DWORD *)(v92 - 8); *(_DWORD *)(v92 - 8) = v74 - 1; } if ( v74 <= 0 ) operator delete(v27); } v26->setScale(v26, 0.5); setAnchorPoint = v26->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v97.origin, 0.0, 1.0); setAnchorPoint(v26, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v26); v84 = v26->setPosition; v83 = (__int64)v17->getPosition(v17); cocos2d::CCPoint::CCPoint(&v96.origin, -155.0, -20.0); cocos2d::CCPoint::operator+(&v97, v83, &v96); v84(v26, &v97.origin); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v26); sub_D18D28(&v95, &v91); cocos2d::CCPoint::CCPoint(&v97.origin, 0.0, 1.0); v29 = (cocos2d::CCNode *)TextArea::create((__int64)&v95, "goldFont.fnt", &v97.origin, 0, 1.0, 9999.0, 28.0); v30 = (void *)(*(_QWORD *)&v95 - 24LL); if ( (__int64 *)(*(_QWORD *)&v95 - 24LL) != &qword_124B6B0 ) { if ( &pthread_create ) { v75 = (unsigned int *)(*(_QWORD *)&v95 - 8LL); do v76 = __ldaxr(v75); while ( __stlxr(v76 - 1, v75) ); } else { v76 = *(_DWORD *)(*(_QWORD *)&v95 - 8LL); *(_DWORD *)(*(_QWORD *)&v95 - 8LL) = v76 - 1; } if ( v76 <= 0 ) operator delete(v30); } v29->setScale(v29, 0.5); v31 = v29->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v97.origin, 0.0, 1.0); v31(v29, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v29); v32 = v29->setPosition; v33 = (__int64)v17->getPosition(v17); cocos2d::CCPoint::CCPoint(&v96.origin, -155.0, -20.0); cocos2d::CCPoint::operator+(&v97, v33, &v96); v32(v29, &v97.origin); cocos2d::CCArray::addObject(a1->m_recordingObjects, v29); if ( a3 != BPMFinder ) { v37 = (cocos2d::CCNode *)ButtonSprite::create( (ButtonSprite *)"Clear", (const char *)&qword_60 + 4, 0, 0, 0.6, v34, v35, v36); v103.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v103.adj = (size_t)CreateGuidelinesLayer::onClearGuidelines; v38 = CCMenuItemSpriteExtra::create(v37, nullptr, v103); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v38); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v38); m_buttonMenu = a1->m_buttonMenu; v40 = v38->setPosition; cocos2d::CCPoint::CCPoint(&v96.origin, (float)(v87 * 0.5) + -75.0, v88 * 0.5); v98 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v96.origin); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v40)(v38, &v97, v98.x, v98.y); } cocos2d::CCPoint::CCPoint(&v93, (float)(v87 * 0.5) + 75.0, v88 * 0.5); v41 = cocos2d::CCLabelBMFont::create(); v41->setScale(v41, 0.4); v42 = v41->setPosition; cocos2d::CCPoint::CCPoint(&v96.origin, 0.0, 25.0); cocos2d::CCPoint::operator+(&v97, &v93, &v96); v42(v41, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v41); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v41); cocos2d::CCRect::CCRect(&v96, 0.0, 0.0, 40.0, 40.0); cocos2d::CCRect::CCRect(&v97, &v96); v43 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02_small.png", (const char *)&v97, v109); ((void (__fastcall *)(cocos2d::CCNode *, __int64))v43->__vftable[1].~CCNode_0)(v43, 100); cocos2d::CCSize::CCSize(&v94, 100.0, 30.0); v43->setContentSize(v43, &v94); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v43, -1); v43->setPosition(v43, &v93); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v43); v44 = CCTextInputNode::create(100.0, 50.0, "Seconds", "Thonburi"); v45 = a1->m_mainLayer; a1->m_offsetInput = v44; v45->addChild_0(v45, v44, 20); a1->m_offsetInput->setPosition(a1->m_offsetInput, &v93); CCTextInputNode::setMaxLabelScale(a1->m_offsetInput, 0.7); CCTextInputNode::setMaxLabelWidth(a1->m_offsetInput, 200.0); a1->m_offsetInput->m_textField->setVisible(a1->m_offsetInput->m_textField, 0); m_offsetInput = a1->m_offsetInput; m_offsetInput->m_maxLabelLength = 3; sub_D153B8((int)&v97, "0123456789."); CCTextInputNode::setAllowedChars((__int64)m_offsetInput, (__int64)&v97); v47 = (void *)(*(_QWORD *)&v97.origin - 24LL); if ( (__int64 *)(*(_QWORD *)&v97.origin - 24LL) != &qword_124B6B0 ) { if ( &pthread_create ) { v77 = (unsigned int *)(*(_QWORD *)&v97.origin - 8LL); do v78 = __ldaxr(v77); while ( __stlxr(v78 - 1, v77) ); } else { v78 = *(_DWORD *)(*(_QWORD *)&v97.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v97.origin - 8LL) = v78 - 1; } if ( v78 <= 0 ) operator delete(v47); } *(_WORD *)&v86.r = -21896; v86.b = -16; CCTextInputNode::setLabelPlaceholderColor(a1->m_offsetInput, v86); CCTextInputNode::setLabelPlaceholderScale(a1->m_offsetInput, 0.5); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, a1->m_offsetInput); v48 = ButtonSprite::create("Record"); v104.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v104.adj = 1344; v49 = CCMenuItemSpriteExtra::create(v48, nullptr, v104); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v49); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v49); v50 = a1->m_buttonMenu; v51 = v49->setPosition; cocos2d::CCPoint::CCPoint(&v95, v87 * 0.5, (float)((float)(v88 * 0.5) + -145.0) + 50.0); v99 = cocos2d::CCNode::convertToNodeSpace(v50, &v95); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v51)(v49, &v97, v99.x, v99.y); v52 = ButtonSprite::create("Stop"); v105.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v105.adj = (size_t)CreateGuidelinesLayer::onStop; v53 = CCMenuItemSpriteExtra::create(v52, nullptr, v105); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v53); cocos2d::CCArray::addObject(a1->m_recordingObjects, v53); v54 = a1->m_buttonMenu; v55 = v53->setPosition; cocos2d::CCPoint::CCPoint( &v95, (float)((float)(v87 * 0.5) + 220.0) - 40.0, (float)((float)(v88 * 0.5) + 145.0) - 25.0); v100 = cocos2d::CCNode::convertToNodeSpace(v54, &v95); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v55)(v53, &v97, v100.x, v100.y); v56 = cocos2d::CCLabelBMFont::create(); a1->m_infoLabel = v56; v57 = v56->setPosition; cocos2d::CCPoint::CCPoint(&v97.origin, v87 * 0.5, (float)((float)(v88 * 0.5) + -145.0) + 90.0); v57(v56, &v97.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_infoLabel); a1->m_infoLabel->setScale(a1->m_infoLabel, 0.5); a1->m_infoLabel->setColor(a1->m_infoLabel, (const cocos2d::ccColor3B *)&unk_EA1810); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, a1->m_infoLabel); v58 = cocos2d::CCSprite::createWithSpriteFrameName("d_ball_01_001.png"); a1->m_circleSprite = v58; v59 = v58->setPosition; cocos2d::CCPoint::CCPoint( &v97.origin, (float)((float)(v87 * 0.5) + -220.0) + 30.0, (float)((float)(v88 * 0.5) + 145.0) - 30.0); v59(v58, &v97.origin); a1->m_circleSprite->setScale(a1->m_circleSprite, 0.8); a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_circleSprite); cocos2d::CCArray::addObject(a1->m_recordingObjects, a1->m_circleSprite); v60 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png"); v106.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v106.adj = 1304; v61 = CCMenuItemSpriteExtra::create(v60, nullptr, v106); CCMenuItemSpriteExtra::setSizeMult(v61, 1.5); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v61); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v61); v62 = a1->m_buttonMenu; v63 = v61->setPosition; cocos2d::CCPoint::CCPoint( &v95, (float)((float)(v87 * 0.5) + -220.0) + 10.0, (float)((float)(v88 * 0.5) + 145.0) - 10.0); v101 = cocos2d::CCNode::convertToNodeSpace(v62, &v95); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v63)(v61, &v97, v101.x, v101.y); if ( a3 != BPMFinder ) { v64 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png"); v107.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v107.adj = 1336; v65 = CCMenuItemSpriteExtra::create(v64, nullptr, v107); CCMenuItemSpriteExtra::setSizeMult(v65, 2.0); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v65); v66 = a1->m_buttonMenu; v67 = v65->setPosition; cocos2d::CCPoint::CCPoint( &v95, (float)((float)(v87 * 0.5) + 220.0) - 17.0, (float)((float)(v88 * 0.5) + 145.0) - 17.0); v102 = cocos2d::CCNode::convertToNodeSpace(v66, &v95); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v67)(v65, &v97, v102.x, v102.y); cocos2d::CCArray::addObject(a1->m_nonRecordingObjects, v65); } CreateGuidelinesLayer::toggleItems(a1, 0); v68 = v91 - 24; if ( v91 - 24 != (char *)&qword_124B6B0 ) { if ( &pthread_create ) { v81 = (unsigned int *)(v91 - 8); do v82 = __ldaxr(v81); while ( __stlxr(v82 - 1, v81) ); } else { v82 = *((_DWORD *)v91 - 2); *((_DWORD *)v91 - 2) = v82 - 1; } if ( v82 <= 0 ) operator delete(v68); } v69 = v90 - 24; if ( v90 - 24 != (char *)&qword_124B6B0 ) { if ( &pthread_create ) { v79 = (unsigned int *)(v90 - 8); do v80 = __ldaxr(v79); while ( __stlxr(v80 - 1, v79) ); } else { v80 = *((_DWORD *)v90 - 2); *((_DWORD *)v90 - 2) = v80 - 1; } if ( v80 <= 0 ) operator delete(v69); } p_m_pTargetArray = &v89[-1].m_pTargetArray; if ( &v89[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 ) { if ( &pthread_create ) { p_m_nExtraKerning = (unsigned int *)&v89[-1].m_nExtraKerning; do m_nExtraKerning = __ldaxr(p_m_nExtraKerning); while ( __stlxr(m_nExtraKerning - 1, p_m_nExtraKerning) ); } else { m_nExtraKerning = v89[-1].m_nExtraKerning; v89[-1].m_nExtraKerning = m_nExtraKerning - 1; } if ( m_nExtraKerning <= 0 ) operator delete(p_m_pTargetArray); } } return v5; }