//
// MoreSearchLayer::init from 0x140312bd0 to 0x1403149e0 (7696 bytes)
//
// 5 xrefs:
// > LevelSearchLayer::onMoreOptions @ 0x14030e620
// > LevelSearchLayer::onMoreOptions @ 0x14030e627
// > LevelSearchLayer::onMoreOptions @ 0x14030e611
// > ??> @ 0x14058ae80
// > ??> @ 0x1406d48bc
//
// 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=26
bool MoreSearchLayer::init(MoreSearchLayer *a1)
{
__int64 v2; // rax
cocos2d::CCTouchDispatcher *v3; // rax
bool result; // al
_BOOL8 v5; // rdx
_BOOL8 v6; // rdx
_BOOL8 v7; // rdx
__int64 v8; // rcx
cocos2d::CCDirector *v9; // rax
cocos2d::CCLayer *v10; // rax
__int64 v11; // rcx
cocos2d::CCArray *v12; // rax
__int64 v13; // rcx
cocos2d::CCArray *v14; // rax
__int64 v15; // rcx
cocos2d::CCArray *v16; // rax
struct cocos2d::CCRect *v17; // rax
struct cocos2d::extension::CCScale9Sprite *v18; // rdi
__int64 v19; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v20; // rbx
const cocos2d::CCSize *v21; // rax
size_t v22; // r14
float v23; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v24; // rbx
double v25; // xmm0_8
const cocos2d::CCPoint *v26; // rax
struct cocos2d::CCSprite *v27; // rax
CCMenuItemSpriteExtra *v28; // rax
cocos2d::CCMenu *v29; // rax
cocos2d::CCMenu_vtbl *v30; // rbx
const cocos2d::CCPoint *v31; // rax
struct cocos2d::CCLabelBMFont *v32; // rdi
float v33; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v34; // rbx
const cocos2d::CCPoint *v35; // rax
float v36; // xmm10_4
float v37; // xmm11_4
float v38; // xmm9_4
__int64 v39; // rbx
cocos2d::CCString *v40; // rax
bool v41; // bl
void *v42; // rcx
__int64 v43; // rax
__int64 v44; // rbx
cocos2d::CCString *v45; // rax
bool v46; // bl
void *v47; // rcx
__int64 v48; // rax
__int64 v49; // rcx
cocos2d::CCString *v50; // rax
bool v51; // bl
void *v52; // rcx
__int64 v53; // rax
__int64 v54; // rcx
cocos2d::CCString *v55; // rax
bool v56; // bl
void *v57; // rcx
__int64 v58; // rax
__int64 v59; // rcx
cocos2d::CCString *v60; // rax
bool v61; // bl
void *v62; // rcx
__int64 v63; // rax
__int64 v64; // rbx
cocos2d::CCString *v65; // rax
bool v66; // bl
void *v67; // rcx
__int64 v68; // rax
__int64 v69; // rcx
cocos2d::CCString *v70; // rax
bool v71; // bl
void *v72; // rcx
__int64 v73; // rax
__int64 v74; // rcx
cocos2d::CCString *v75; // rax
bool v76; // bl
void *v77; // rcx
__int64 v78; // rax
__int64 v79; // rcx
cocos2d::CCString *v80; // rax
bool v81; // bl
void *v82; // rcx
__int64 v83; // rax
__int64 v84; // rbx
cocos2d::CCString *v85; // rax
bool v86; // bl
void *v87; // rcx
__int64 v88; // rax
__int64 v89; // rcx
cocos2d::CCString *v90; // rax
bool v91; // bl
void *v92; // rcx
__int64 v93; // rax
struct cocos2d::CCLabelBMFont *v94; // rdi
float v95; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v96; // rbx
const cocos2d::CCPoint *v97; // rax
ButtonSprite *v98; // rbx
CCMenuItemSpriteExtra *v99; // rax
float v100; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v101; // rbx
struct cocos2d::CCPoint v102; // rax
ButtonSprite *v103; // rax
cocos2d::CCNode *v104; // rbx
CCMenuItemSpriteExtra *v105; // rax
float v106; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v107; // rbx
struct cocos2d::CCPoint v108; // rax
cocos2d::CCLabelBMFont *v109; // rax
float v110; // xmm0_4
__int64 v111; // rax
double v112; // xmm0_8
struct cocos2d::CCSprite *v113; // rbx
CCMenuItemSpriteExtra *v114; // rax
CCMenuItemSpriteExtra_vtbl *v115; // rbx
struct cocos2d::CCPoint v116; // rax
struct cocos2d::CCSprite *v117; // rbx
CCMenuItemSpriteExtra *v118; // rax
float v119; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v120; // rbx
struct cocos2d::CCPoint v121; // rax
struct cocos2d::CCRect *v122; // rax
struct cocos2d::extension::CCScale9Sprite *v123; // rbx
__int64 v124; // rdx
const char *v125; // r9
CCTextInputNode *v126; // rax
CCTextInputNode *m_enterSongID; // rcx
CCTextInputNode *v128; // rcx
std::string *p_m_allowedChars; // rcx
CCTextInputNode *v130; // rcx
CCTextInputNode *v131; // rcx
__int64 v132; // rbx
cocos2d::CCString *v133; // rax
bool v134; // di
void *v135; // rcx
__int64 v136; // rbx
cocos2d::CCString *v137; // rax
bool v138; // r15
void *v139; // rcx
__int64 v140; // rcx
cocos2d::CCString *v141; // rax
int v142; // ebx
void *v143; // rcx
CCMenuItemSpriteExtra *m_customBtn; // rdx
cocos2d::CCString *v145; // rax
const char *CString; // rax
struct cocos2d::CCSprite *v147; // rax
CCMenuItemSpriteExtra *v148; // rdi
float v149; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v150; // rbx
struct cocos2d::CCPoint v151; // rax
int v152; // [rsp+28h] [rbp-E0h]
cocos2d::CCSize v153; // [rsp+58h] [rbp-B0h] BYREF
__int64 v154; // [rsp+60h] [rbp-A8h]
__int128 *v155; // [rsp+68h] [rbp-A0h] BYREF
cocos2d::CCRect v156; // [rsp+70h] [rbp-98h] BYREF
__int128 v157; // [rsp+80h] [rbp-88h] BYREF
__int64 v158; // [rsp+90h] [rbp-78h]
__int64 v159; // [rsp+98h] [rbp-70h]
__int128 v160; // [rsp+A0h] [rbp-68h] BYREF
__int64 v161; // [rsp+B0h] [rbp-58h]
__int64 v162; // [rsp+B8h] [rbp-50h]
__int128 v163; // [rsp+C0h] [rbp-48h] BYREF
__int64 v164; // [rsp+D0h] [rbp-38h]
__int64 v165; // [rsp+D8h] [rbp-30h]
cocos2d::CCRect v166; // [rsp+E0h] [rbp-28h] BYREF
cocos2d::CCPoint v167; // [rsp+F0h] [rbp-18h] BYREF
_QWORD Src[4]; // [rsp+F8h] [rbp-10h] BYREF
cocos2d::CCSize v169; // [rsp+118h] [rbp+10h] BYREF
cocos2d::CCRect v170; // [rsp+120h] [rbp+18h] BYREF
void *Block[2]; // [rsp+130h] [rbp+28h] BYREF
__int64 v172; // [rsp+140h] [rbp+38h]
unsigned __int64 v173; // [rsp+148h] [rbp+40h]
void *v174[2]; // [rsp+150h] [rbp+48h] BYREF
__int64 v175; // [rsp+160h] [rbp+58h]
unsigned __int64 v176; // [rsp+168h] [rbp+60h]
void *v177[2]; // [rsp+170h] [rbp+68h] BYREF
__int64 v178; // [rsp+180h] [rbp+78h]
unsigned __int64 v179; // [rsp+188h] [rbp+80h]
if ( !a1->m_forcePrioRegistered )
{
a1->m_forcePrioRegistered = 1;
v2 = cocos2d::CCDirector::sharedDirector(a1);
v3 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 144LL))(v2);
cocos2d::CCTouchDispatcher::registerForcePrio(v3, a1, 2);
}
v153.width = -1.0339758e-25;
result = cocos2d::CCLayerColor::initWithColor(a1, (const struct cocos2d::_ccColor4B *)&v153);
if ( result )
{
LOBYTE(v5) = 1;
a1->setTouchEnabled(a1, v5);
LOBYTE(v6) = 1;
a1->setKeypadEnabled(a1, v6);
LOBYTE(v7) = 1;
a1->setKeyboardEnabled(a1, v7);
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
cocos2d::CCDirector::getWinSize(v9);
v10 = (cocos2d::CCLayer *)cocos2d::CCLayer::create();
a1->m_mainLayer = v10;
a1->addChild_1(a1, v10);
v12 = (cocos2d::CCArray *)cocos2d::CCArray::create(v11);
a1->m_normalSongNodes = v12;
cocos2d::CCObject::retain(v12);
v14 = (cocos2d::CCArray *)cocos2d::CCArray::create(v13);
a1->m_customSongNodes = v14;
cocos2d::CCObject::retain(v14);
v16 = (cocos2d::CCArray *)cocos2d::CCArray::create(v15);
a1->m_commonSongNodes = v16;
cocos2d::CCObject::retain(v16);
cocos2d::CCRect::CCRect(&v156, 0.0, 0.0, 80.0, 80.0);
v18 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v17);
LOBYTE(v19) = -1;
v18->setOpacity(&v18->cocos2d::CCRGBAProtocol, v19);
v20 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize(&v153, 440.0, 290.0);
v20->setContentSize(v18, v21);
v22 = -1;
v23 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v18,
0xFFFFFFFFLL);
v24 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v25 = cocos2d::CCPoint::CCPoint(v23, *(float *)&v154 * 0.5);
v24->setPosition_0(v18, v26);
v27 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v28 = CCMenuItemSpriteExtra::create(v27, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::onClose);
HIDWORD(v28->m_pfnSelector.adj) = 1070386381;
v29 = cocos2d::CCMenu::create(v28, 0);
a1->m_buttonMenu = v29;
v30 = v29->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v25, (float)((float)(*(float *)&v154 * 0.5) - 220.0) + 10.0);
v30->setPosition_0(a1->m_buttonMenu, v31);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
a1->m_joystickConnected = -1;
v32 = cocos2d::CCLabelBMFont::create("Advanced Options", "goldFont.fnt");
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v32->setScale_0)(v32);
v33 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v32,
20);
v34 = v32->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v33, *(float *)&v154 * 0.5);
v34->setPosition_0(v32, v35);
v36 = (float)(*(float *)&v154 * 0.5) - 170.0;
v37 = (float)(*(float *)&v154 * 0.5) - 40.0;
v38 = (float)(*(float *)&v154 * 0.5) + 90.0;
v166.origin = (cocos2d::CCPoint)v174;
v175 = 11;
v176 = 15;
v174[0] = (void *)0x656C706D6F636E55LL;
v174[1] = (void *)6579572;
v39 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v39 = qword_1406C2EC0;
}
*(_OWORD *)Block = 0;
v172 = 0;
v173 = 15;
Block[0] = sub_14003AA10(0x20u);
v172 = 18;
v173 = 31;
strcpy((char *)Block[0], "uncompleted_filter");
v40 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v39 + 344), Block);
v41 = cocos2d::CCString::boolValue(v40);
if ( v173 > 0xF )
{
v42 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v42 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v42 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v42);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
cocos2d::CCPoint::CCPoint(7.0386632e28, v36);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)v174,
(unsigned int)MoreSearchLayer::onUncompleted,
!v41,
(__int64)a1->m_buttonMenu,
v43);
v155 = &v157;
*((_QWORD *)&v157 + 1) = 100;
v158 = 9;
v159 = 15;
*(_QWORD *)&v157 = 0x6574656C706D6F43LL;
v44 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v166.origin = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(*(_QWORD *)&v166.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v44 = qword_1406C2EC0;
}
*(_OWORD *)v177 = 0;
v178 = 0;
v179 = 15;
v177[0] = sub_14003AA10(0x20u);
v178 = 16;
v179 = 31;
strcpy((char *)v177[0], "completed_filter");
v45 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v44 + 344), v177);
v46 = cocos2d::CCString::boolValue(v45);
if ( v179 > 0xF )
{
v47 = v177[0];
if ( v179 + 1 >= 0x1000 )
{
v47 = *((void **)v177[0] - 1);
if ( (unsigned __int64)((char *)v177[0] - (char *)v47 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v47);
}
v178 = 0;
v179 = 15;
LOBYTE(v177[0]) = 0;
cocos2d::CCPoint::CCPoint(2.9393042e29, v37);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v157,
(unsigned int)MoreSearchLayer::onCompleted,
!v46,
(__int64)a1->m_buttonMenu,
v48);
v156.origin = (cocos2d::CCPoint)&v160;
v161 = 8;
v162 = 15;
v160 = *(unsigned __int64 *)"Original";
v49 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v49 = qword_1406C2EC0;
}
v175 = 15;
v176 = 15;
strcpy((char *)v174, "original_filter");
v50 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v49 + 344), v174);
v51 = cocos2d::CCString::boolValue(v50);
if ( v176 > 0xF )
{
v52 = v174[0];
if ( v176 + 1 >= 0x1000 )
{
v52 = *((void **)v174[0] - 1);
if ( (unsigned __int64)((char *)v174[0] - (char *)v52 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v52);
}
v175 = 0;
v176 = 15;
LOBYTE(v174[0]) = 0;
cocos2d::CCPoint::CCPoint(1.1024223e24, v38);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v160,
(unsigned int)MoreSearchLayer::onOriginal,
!v51,
(__int64)a1->m_buttonMenu,
v53);
v156.origin = (cocos2d::CCPoint)&v157;
v157 = 0;
v158 = 5;
v159 = 15;
strcpy((char *)&v157, "Coins");
v54 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v54 = qword_1406C2EC0;
}
v172 = 11;
v173 = 15;
Block[0] = (void *)0x6C69665F6E696F63LL;
Block[1] = (void *)7497076;
v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v54 + 344), Block);
v56 = cocos2d::CCString::boolValue(v55);
if ( v173 > 0xF )
{
v57 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v57 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v57 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v57);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
cocos2d::CCPoint::CCPoint(1.8061166e28, v36);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v157,
(unsigned int)MoreSearchLayer::onCoins,
!v56,
(__int64)a1->m_buttonMenu,
v58);
v156.origin = (cocos2d::CCPoint)&v160;
v161 = 8;
v162 = 15;
v160 = 0x726579616C502D32uLL;
v59 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v59 = qword_1406C2EC0;
}
v175 = 11;
v176 = 15;
v174[0] = (void *)0x6C69665F506F7774LL;
v174[1] = (void *)7497076;
v60 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v59 + 344), v174);
v61 = cocos2d::CCString::boolValue(v60);
if ( v176 > 0xF )
{
v62 = v174[0];
if ( v176 + 1 >= 0x1000 )
{
v62 = *((void **)v174[0] - 1);
if ( (unsigned __int64)((char *)v174[0] - (char *)v62 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v62);
}
v175 = 0;
v176 = 15;
LOBYTE(v174[0]) = 0;
cocos2d::CCPoint::CCPoint(1.6070332e10, v37);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v160,
(unsigned int)MoreSearchLayer::onTwoPlayer,
!v61,
(__int64)a1->m_buttonMenu,
v63);
v156.origin = (cocos2d::CCPoint)&v163;
v163 = 0;
v164 = 4;
v165 = 15;
strcpy((char *)&v163, "Song");
v64 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v64 = qword_1406C2EC0;
}
*(_OWORD *)v177 = 0;
v178 = 0;
v179 = 15;
v177[0] = sub_14003AA10(0x20u);
v178 = 17;
v179 = 31;
strcpy((char *)v177[0], "enable_songFilter");
v65 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v64 + 344), v177);
v66 = cocos2d::CCString::boolValue(v65);
if ( v179 > 0xF )
{
v67 = v177[0];
if ( v179 + 1 >= 0x1000 )
{
v67 = *((void **)v177[0] - 1);
if ( (unsigned __int64)((char *)v177[0] - (char *)v67 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v67);
}
v178 = 0;
v179 = 15;
LOBYTE(v177[0]) = 0;
cocos2d::CCPoint::CCPoint(1.039618e21, v38);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v163,
(unsigned int)MoreSearchLayer::onSongFilter,
!v66,
(__int64)a1->m_buttonMenu,
v68);
v156.origin = (cocos2d::CCPoint)&v157;
v158 = 7;
v159 = 15;
v157 = 0x72617453206F4EuLL;
v69 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v69 = qword_1406C2EC0;
}
v172 = 13;
v173 = 15;
strcpy((char *)Block, "nostar_filter");
HIWORD(Block[1]) = 0;
v70 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v69 + 344), Block);
v71 = cocos2d::CCString::boolValue(v70);
if ( v173 > 0xF )
{
v72 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v72 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v72 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v72);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
cocos2d::CCPoint::CCPoint(7.7147717e31, v36);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v157,
(unsigned int)MoreSearchLayer::onNoStar,
!v71,
(__int64)a1->m_buttonMenu,
v73);
v156.origin = (cocos2d::CCPoint)&v163;
v164 = 8;
v165 = 15;
v163 = 0x6465727574616546uLL;
v74 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v74 = qword_1406C2EC0;
}
v175 = 15;
v176 = 15;
strcpy((char *)v174, "featured_filter");
v75 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v74 + 344), v174);
v76 = cocos2d::CCString::boolValue(v75);
if ( v176 > 0xF )
{
v77 = v174[0];
if ( v176 + 1 >= 0x1000 )
{
v77 = *((void **)v174[0] - 1);
if ( (unsigned __int64)((char *)v174[0] - (char *)v77 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v77);
}
v175 = 0;
v176 = 15;
LOBYTE(v174[0]) = 0;
cocos2d::CCPoint::CCPoint(7.1430871e31, v37);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v163,
(unsigned int)MoreSearchLayer::onFeatured,
!v76,
(__int64)a1->m_buttonMenu,
v78);
v156.origin = (cocos2d::CCPoint)&v160;
v160 = 0;
v161 = 4;
v162 = 15;
strcpy((char *)&v160, "Epic");
v79 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v79 = qword_1406C2EC0;
}
v172 = 11;
v173 = 15;
Block[0] = (void *)0x6C69665F63697065LL;
Block[1] = (void *)7497076;
v80 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v79 + 344), Block);
v81 = cocos2d::CCString::boolValue(v80);
if ( v173 > 0xF )
{
v82 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v82 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v82 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v82);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
cocos2d::CCPoint::CCPoint(4.3061902e21, v38);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v160,
(unsigned int)MoreSearchLayer::onEpic,
!v81,
(__int64)a1->m_buttonMenu,
v83);
v156.origin = (cocos2d::CCPoint)&v157;
*((_QWORD *)&v157 + 1) = 121;
v158 = 9;
v159 = 15;
*(_QWORD *)&v157 = 0x7261646E6567654CLL;
v84 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v84 = qword_1406C2EC0;
}
*(_OWORD *)v177 = 0;
v178 = 0;
v179 = 15;
v177[0] = sub_14003AA10(0x20u);
v178 = 16;
v179 = 31;
strcpy((char *)v177[0], "legendary_filter");
v85 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v84 + 344), v177);
v86 = cocos2d::CCString::boolValue(v85);
if ( v179 > 0xF )
{
v87 = v177[0];
if ( v179 + 1 >= 0x1000 )
{
v87 = *((void **)v177[0] - 1);
if ( (unsigned __int64)((char *)v177[0] - (char *)v87 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v87);
}
v178 = 0;
v179 = 15;
LOBYTE(v177[0]) = 0;
cocos2d::CCPoint::CCPoint(6.8296098e22, v36);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v157,
(unsigned int)MoreSearchLayer::onLegendary,
!v86,
(__int64)a1->m_buttonMenu,
v88);
v156.origin = (cocos2d::CCPoint)v174;
*(_OWORD *)v174 = 0;
v175 = 6;
v176 = 15;
strcpy((char *)v174, "Mythic");
v89 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v155 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v89 = qword_1406C2EC0;
}
v172 = 13;
v173 = 15;
strcpy((char *)Block, "mythic_filter");
HIWORD(Block[1]) = 0;
v90 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v89 + 344), Block);
v91 = cocos2d::CCString::boolValue(v90);
if ( v173 > 0xF )
{
v92 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v92 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v92 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v92);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
cocos2d::CCPoint::CCPoint(4.6179893e24, v37);
MoreSearchLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)v174,
(unsigned int)MoreSearchLayer::onMythic,
!v91,
(__int64)a1->m_buttonMenu,
v93);
v94 = cocos2d::CCLabelBMFont::create("Select Song:", "goldFont.fnt");
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v94);
v95 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *))v94->setScale_0)(v94);
v96 = v94->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v95, *(float *)&v154 * 0.5);
v96->setPosition_0(v94, v97);
cocos2d::CCArray::addObject(a1->m_commonSongNodes, v94);
v94->getPosition_0(v94);
v156.origin = (cocos2d::CCPoint)operator new(0x2C0u);
v98 = ButtonSprite::ButtonSprite(*(ButtonSprite **)&v156.origin);
if ( v98 )
{
if ( ButtonSprite::init_1(
v98,
"Normal",
40,
0,
0.40000001,
0,
(const char *)&qword_14052A4D8,
"GJ_button_01.png",
20.0) )
{
cocos2d::CCObject::autorelease(v98);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v98->~ButtonSprite)(v98, 1);
v98 = nullptr;
}
}
v99 = CCMenuItemSpriteExtra::create(v98, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::onSongMode);
a1->m_normalBtn = v99;
HIDWORD(v99->m_pfnSelector.adj) = 1066192077;
v100 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
a1->m_normalBtn);
v101 = a1->m_normalBtn->__vftable;
cocos2d::CCPoint::CCPoint(v100, (float)(*(float *)&v154 * 0.5) - 30.0);
v102 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v155);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v101->setPosition_0)(a1->m_normalBtn, v102);
a1->m_normalBtn->setTag(a1->m_normalBtn, 1);
cocos2d::CCArray::addObject(a1->m_commonSongNodes, a1->m_normalBtn);
v156.origin = (cocos2d::CCPoint)operator new(0x2C0u);
v103 = ButtonSprite::ButtonSprite(*(ButtonSprite **)&v156.origin);
v104 = v103;
if ( v103 )
{
if ( ButtonSprite::init_1(
v103,
"Custom",
40,
0,
0.40000001,
0,
(const char *)&qword_14052A4D8,
"GJ_button_01.png",
20.0) )
{
cocos2d::CCObject::autorelease(v104);
}
else
{
((void (__fastcall *)(cocos2d::CCNode *, __int64))v104->~CCNode)(v104, 1);
v104 = nullptr;
}
}
v105 = CCMenuItemSpriteExtra::create(v104, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::onSongMode);
a1->m_customBtn = v105;
HIDWORD(v105->m_pfnSelector.adj) = 1066192077;
v106 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
a1->m_customBtn);
v107 = a1->m_customBtn->__vftable;
cocos2d::CCPoint::CCPoint(v106, (float)(*(float *)&v154 * 0.5) + 30.0);
v108 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v155);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v107->setPosition_0)(a1->m_customBtn, v108);
a1->m_customBtn->setTag(a1->m_customBtn, 2);
cocos2d::CCArray::addObject(a1->m_commonSongNodes, a1->m_customBtn);
v109 = cocos2d::CCLabelBMFont::create(" ", (const char *)&qword_14052A4D8);
a1->m_audioTrackName = v109;
v110 = ((float (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild_1)(
a1->m_mainLayer,
v109);
cocos2d::CCPoint::CCPoint(v110, 0.0);
v111 = (__int64)v94->getPosition_0(v94);
cocos2d::CCPoint::operator+(v111, &v153);
v112 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCSize *))a1->m_audioTrackName->setPosition_0)(
a1->m_audioTrackName,
&v153);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_audioTrackName->setScale_0)(a1->m_audioTrackName);
cocos2d::CCArray::addObject(a1->m_normalSongNodes, a1->m_audioTrackName);
a1->m_audioTrackName->getPosition_0(a1->m_audioTrackName);
v113 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v113->setScale_0)(v113);
v114 = CCMenuItemSpriteExtra::create(v113, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::audioPrevious);
a1->m_songLeftBtn = v114;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v114);
cocos2d::CCArray::addObject(a1->m_normalSongNodes, a1->m_songLeftBtn);
v115 = a1->m_songLeftBtn->__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v112, (float)(*(float *)&v154 * 0.5) - 120.0);
v116 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v155);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v115->setPosition_0)(
a1->m_songLeftBtn,
v116);
HIDWORD(a1->m_songLeftBtn->m_pfnSelector.adj) = 0x40000000;
v117 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v117->setScale_0)(v117);
v118 = CCMenuItemSpriteExtra::create(v117, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::audioNext);
a1->m_songRightBtn = v118;
v119 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v118);
v120 = a1->m_songRightBtn->__vftable;
cocos2d::CCPoint::CCPoint(v119, (float)(*(float *)&v154 * 0.5) + 120.0);
v121 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v155);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v120->setPosition_0)(
a1->m_songRightBtn,
v121);
HIDWORD(a1->m_songRightBtn->m_pfnSelector.adj) = 0x40000000;
cocos2d::CCArray::addObject(a1->m_normalSongNodes, a1->m_songRightBtn);
a1->m_audioTrackName->getPosition_0(a1->m_audioTrackName);
cocos2d::CCPoint::CCPoint(&v167);
cocos2d::CCRect::CCRect(&v170, 0.0, 0.0, 40.0, 40.0);
cocos2d::CCRect::CCRect(&v166, &v170);
v123 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v122);
LOBYTE(v124) = 100;
v123->setOpacity(&v123->cocos2d::CCRGBAProtocol, v124);
cocos2d::CCSize::CCSize(&v169, 180.0, 30.0);
v123->setContentSize(v123, &v169);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v123, -1);
v123->setPosition_0(v123, &v167);
cocos2d::CCArray::addObject(a1->m_customSongNodes, v123);
v126 = CCTextInputNode::create(100.0, 50.0, "Enter song ID", v125, v152, (const char *)&qword_14052A4D8);
a1->m_enterSongID = v126;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v126, 20);
a1->m_enterSongID->m_delegate = &a1->TextInputDelegate;
a1->m_enterSongID->setPosition_0(a1->m_enterSongID, &v167);
m_enterSongID = a1->m_enterSongID;
m_enterSongID->m_maxLabelScale = 0.69999999;
CCTextInputNode::refreshLabel(m_enterSongID);
v128 = a1->m_enterSongID;
v128->m_maxLabelWidth = 160.0;
CCTextInputNode::refreshLabel(v128);
a1->m_enterSongID->m_textField->setVisible(a1->m_enterSongID->m_textField, 0);
a1->m_enterSongID->m_maxLabelLength = 15;
Src[1] = 14648;
Src[2] = 10;
Src[3] = 15;
Src[0] = 0x3736353433323130LL;
v156.origin = (cocos2d::CCPoint)Src;
p_m_allowedChars = &a1->m_enterSongID->m_allowedChars;
if ( p_m_allowedChars != (std::string *)Src )
sub_14003CCE0((void **)p_m_allowedChars, Src, 0xAu);
sub_14003A830((__int64)Src);
LOWORD(v153.width) = -21896;
v130 = a1->m_enterSongID;
*(_WORD *)&v130->m_placeholderColor.r = -21896;
v130->m_placeholderColor.b = -16;
CCTextInputNode::refreshLabel(v130);
v131 = a1->m_enterSongID;
v131->m_placeholderScale = 0.5;
CCTextInputNode::refreshLabel(v131);
cocos2d::CCArray::addObject(a1->m_customSongNodes, a1->m_enterSongID);
MoreSearchLayer::onSongFilter(a1, nullptr);
v132 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v156.origin = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(*(_QWORD *)&v156.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v132 = qword_1406C2EC0;
}
*(_OWORD *)v177 = 0;
v178 = 0;
v179 = 15;
v177[0] = sub_14003AA10(0x20u);
v178 = 17;
v179 = 31;
strcpy((char *)v177[0], "customsong_filter");
v133 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v132 + 344), v177);
v134 = cocos2d::CCString::boolValue(v133);
if ( v179 > 0xF )
{
v135 = v177[0];
if ( v179 + 1 >= 0x1000 )
{
v135 = *((void **)v177[0] - 1);
if ( (unsigned __int64)((char *)v177[0] - (char *)v135 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v135);
}
v178 = 0;
v179 = 15;
LOBYTE(v177[0]) = 0;
v136 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v156.origin = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(*(_QWORD *)&v156.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v136 = qword_1406C2EC0;
}
*(_OWORD *)Block = 0;
v172 = 0;
v173 = 15;
Block[0] = sub_14003AA10(0x20u);
v172 = 17;
v173 = 31;
strcpy((char *)Block[0], "enable_songFilter");
v137 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v136 + 344), Block);
v138 = cocos2d::CCString::boolValue(v137);
if ( v173 > 0xF )
{
v139 = Block[0];
if ( v173 + 1 >= 0x1000 )
{
v139 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v139 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v139);
}
v172 = 0;
v173 = 15;
LOBYTE(Block[0]) = 0;
v140 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v156.origin = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(*(_QWORD *)&v156.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v140 = qword_1406C2EC0;
}
v178 = 11;
v179 = 15;
v177[0] = (void *)0x6C69665F676E6F73LL;
v177[1] = (void *)7497076;
v141 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v140 + 344), v177);
v142 = cocos2d::CCString::intValue(v141);
if ( v179 > 0xF )
{
v143 = v177[0];
if ( v179 + 1 >= 0x1000 )
{
v143 = *((void **)v177[0] - 1);
if ( (unsigned __int64)((char *)v177[0] - (char *)v143 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v143);
}
if ( v134 )
m_customBtn = a1->m_customBtn;
else
m_customBtn = a1->m_normalBtn;
MoreSearchLayer::onSongMode(a1, m_customBtn);
if ( v138 && v134 && v142 )
{
v145 = cocos2d::CCString::createWithFormat("%i", v142);
CString = cocos2d::CCString::getCString(v145);
v163 = 0;
v164 = 0;
v165 = 0;
do
++v22;
while ( CString[v22] );
sub_14003A930(&v163, CString, v22);
CCTextInputNode::setString((__int64)a1->m_enterSongID, &v163);
}
v147 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v148 = CCMenuItemSpriteExtra::create(v147, nullptr, a1, (cocos2d::SEL_MenuHandler *)MoreSearchLayer::onInfo);
HIDWORD(v148->m_pfnSelector.adj) = 0x40000000;
v149 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v148);
v150 = v148->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v149, (float)((float)(*(float *)&v154 * 0.5) + 220.0) - 17.0);
v151 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v155);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v150->setPosition_0)(v148, v151);
return 1;
}
return result;
}