//
// EditLevelLayer::init from 0x1400d5440 to 0x1400d6807 (5063 bytes)
//
// 2 xrefs:
// > EditLevelLayer::scene @ 0x1400d53e9
// > ??> @ 0x1406c876c
//
// 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=4
bool EditLevelLayer::init(EditLevelLayer *a1, GJGameLevel *a2)
{
bool result; // al
bool v5; // bl
std::string *p_m_tempName; // rcx
void **v7; // rdx
__int64 v8; // rdx
_BOOL8 v9; // rdx
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
struct cocos2d::CCSprite *v12; // rdi
cocos2d::CCSprite_vtbl *v13; // rbx
const cocos2d::CCPoint *v14; // rax
cocos2d::CCSprite_vtbl *v15; // rbx
const cocos2d::CCPoint *v16; // rax
struct cocos2d::CCSprite *v17; // rdi
cocos2d::CCSprite_vtbl *v18; // rbx
const cocos2d::CCPoint *v19; // rax
cocos2d::CCSprite_vtbl *v20; // rbx
__int64 v21; // rcx
cocos2d::CCDirector *v22; // rax
float v23; // xmm6_4
__int64 v24; // rcx
cocos2d::CCDirector *v25; // rax
float v26; // xmm0_4
const cocos2d::CCPoint *v27; // rax
struct cocos2d::CCSprite *v28; // rdi
cocos2d::CCSprite_vtbl *v29; // rbx
const cocos2d::CCPoint *v30; // rax
cocos2d::CCSprite_vtbl *v31; // rbx
__int64 v32; // rcx
cocos2d::CCDirector *v33; // rax
float v34; // xmm6_4
__int64 v35; // rcx
cocos2d::CCDirector *v36; // rax
float v37; // xmm0_4
const cocos2d::CCPoint *v38; // rax
__int64 v39; // rcx
cocos2d::CCArray *v40; // rax
__int64 v41; // rcx
cocos2d::CCDirector *v42; // rax
float v43; // xmm0_4
struct cocos2d::CCRect *v44; // rax
struct cocos2d::extension::CCScale9Sprite *v45; // rbx
__int64 v46; // rdx
size_t v47; // rsi
const char *v48; // r9
GJGameLevel *m_level; // rdx
CCTextInputNode *v50; // rbx
TextInputDelegate *v51; // r13
void **v52; // rcx
size_t v53; // r15
size_t v54; // r8
__int64 v55; // rdi
__int128 *v56; // rdx
size_t v57; // r8
const char *p_Buf2; // rcx
struct cocos2d::CCLabelBMFont *v59; // rbx
struct cocos2d::CCRect *v60; // rax
struct cocos2d::extension::CCScale9Sprite *v61; // rbx
__int64 v62; // rdx
__int64 v63; // rax
const char *v64; // r9
CCTextInputNode *v65; // rbx
void **v66; // rdx
const struct cocos2d::CCPoint *v67; // rax
char *v68; // rax
void **v69; // rcx
bool v70; // r15
void **v71; // r14
size_t v72; // rdi
size_t v73; // r8
__int64 v74; // rcx
void **v75; // rdx
cocos2d::CCMenu *v76; // rax
struct cocos2d::CCSprite *v77; // rax
CCMenuItemSpriteExtra *v78; // rax
struct cocos2d::CCSprite *v79; // r13
CCMenuItemSpriteExtra *v80; // rax
struct cocos2d::CCSprite *v81; // rax
CCMenuItemSpriteExtra *v82; // rax
cocos2d::CCMenu *m_buttonMenu; // rcx
cocos2d::CCMenu_vtbl *v84; // rbx
float v85; // xmm6_4
float *v86; // rax
const cocos2d::CCPoint *v87; // rax
__int64 v88; // rcx
GJGameLevel *v89; // rax
struct cocos2d::CCSprite *v90; // rax
CCMenuItemSpriteExtra *v91; // rdi
CCMenuItemSpriteExtra_vtbl *v92; // rbx
struct cocos2d::CCPoint v93; // rax
cocos2d::CCNode *v94; // rdi
__int64 v95; // rcx
cocos2d::CCDirector *v96; // rax
float v97; // xmm6_4
__int64 v98; // rcx
cocos2d::CCDirector *v99; // rax
float v100; // xmm0_4
struct cocos2d::CCSprite *v101; // r14
CCMenuItemSpriteExtra *v102; // r15
CCMenuItemSpriteExtra_vtbl *v103; // rbx
struct cocos2d::CCPoint v104; // rax
struct cocos2d::CCSprite *v105; // rsi
cocos2d::CCSprite_vtbl *v106; // rdi
CCMenuItemSpriteExtra *v107; // rdi
cocos2d::CCNode *v108; // r14
__int64 v109; // rax
struct cocos2d::CCSprite *v110; // rax
CCMenuItemSpriteExtra *v111; // rsi
__int64 v112; // rax
struct cocos2d::CCSprite *v113; // rax
CCMenuItemSpriteExtra *v114; // rdi
__int64 v115; // rax
struct cocos2d::CCSprite *v116; // rdi
cocos2d::CCString *v117; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v119; // rax
cocos2d::CCLabelBMFont_vtbl *v120; // rbx
float height; // xmm6_4
float *v122; // rax
const cocos2d::CCPoint *v123; // rax
CCMenuItemSpriteExtra *v124; // rsi
CCMenuItemSpriteExtra_vtbl *v125; // rbx
struct cocos2d::CCPoint v126; // rax
struct cocos2d::CCSprite *v127; // rbx
CCMenuItemSpriteExtra *v128; // rdi
__int64 v129; // rax
struct cocos2d::CCSprite *v130; // rax
CCMenuItemSpriteExtra *v131; // r14
struct cocos2d::CCMenu *v132; // rdi
cocos2d::CCMenu_vtbl *v133; // rbx
__int64 v134; // rcx
cocos2d::CCDirector *v135; // rax
float v136; // xmm6_4
__int64 v137; // rcx
cocos2d::CCDirector *v138; // rax
float v139; // xmm0_4
const cocos2d::CCPoint *v140; // rax
__int64 v141; // rcx
cocos2d::CCNode *v142; // rsi
struct cocos2d::CCSprite *v143; // rax
CCMenuItemSpriteExtra *v144; // rax
cocos2d::CCNode_vtbl *v145; // rbx
__int64 v146; // rcx
cocos2d::CCDirector *v147; // rax
float v148; // xmm6_4
__int64 v149; // rcx
cocos2d::CCDirector *v150; // rax
float v151; // xmm0_4
const cocos2d::CCPoint *v152; // rax
struct cocos2d::CCSprite *v153; // rbx
CCMenuItemSpriteExtra *v154; // rdi
CCMenuItemSpriteExtra_vtbl *v155; // rbx
__int64 v156; // rcx
cocos2d::CCDirector *v157; // rax
float v158; // xmm6_4
__int64 v159; // rcx
cocos2d::CCDirector *v160; // rax
float v161; // xmm0_4
struct cocos2d::CCPoint v162; // rax
struct cocos2d::CCSprite *v163; // rbx
CCMenuItemSpriteExtra *v164; // rdi
CCMenuItemSpriteExtra_vtbl *v165; // rbx
struct cocos2d::CCPoint v166; // rax
__int64 v167; // rdx
__int64 v168; // rcx
struct cocos2d::CCSprite *v169; // rdi
cocos2d::CCSprite_vtbl *v170; // rbx
float v171; // xmm6_4
float *v172; // rax
const cocos2d::CCPoint *v173; // rax
int v174; // [rsp+20h] [rbp-E0h]
void **v175; // [rsp+40h] [rbp-C0h] BYREF
cocos2d::CCPoint v176; // [rsp+48h] [rbp-B8h] BYREF
float v177; // [rsp+50h] [rbp-B0h]
float v178; // [rsp+54h] [rbp-ACh]
cocos2d::CCPoint v179; // [rsp+58h] [rbp-A8h] BYREF
cocos2d::CCPoint v180; // [rsp+60h] [rbp-A0h] BYREF
cocos2d::CCSize v181; // [rsp+68h] [rbp-98h] BYREF
void *v182[2]; // [rsp+70h] [rbp-90h] BYREF
size_t v183; // [rsp+80h] [rbp-80h]
unsigned __int64 v184; // [rsp+88h] [rbp-78h]
void *Src[4]; // [rsp+90h] [rbp-70h] BYREF
cocos2d::CCPoint v186; // [rsp+B0h] [rbp-50h] BYREF
cocos2d::CCRect v187; // [rsp+B8h] [rbp-48h] BYREF
void *Buf1[2]; // [rsp+C8h] [rbp-38h] BYREF
size_t v189; // [rsp+D8h] [rbp-28h]
unsigned __int64 v190; // [rsp+E0h] [rbp-20h]
__int128 Buf2; // [rsp+E8h] [rbp-18h] BYREF
__int64 v192; // [rsp+F8h] [rbp-8h]
unsigned __int64 v193; // [rsp+100h] [rbp+0h]
void *v194[2]; // [rsp+108h] [rbp+8h] BYREF
size_t v195; // [rsp+118h] [rbp+18h]
unsigned __int64 v196; // [rsp+120h] [rbp+20h]
result = cocos2d::CCLayer::init(a1);
if ( result )
{
a1->m_level = a2;
cocos2d::CCObject::retain(a2);
sub_14003BDB0((__int64)&Buf2, (__int64)&a1->m_level->m_levelName);
v5 = v192 != 0;
sub_14003A830((__int64)&Buf2);
if ( v5 )
{
sub_14003BDB0((__int64)Src, (__int64)&a1->m_level->m_levelName);
v175 = Src;
p_m_tempName = &a1->m_level->m_tempName;
if ( p_m_tempName != (std::string *)Src )
{
v7 = Src;
if ( Src[3] > (void *)0xF )
v7 = (void **)Src[0];
sub_14003CCE0((void **)p_m_tempName, v7, (size_t)Src[2]);
}
sub_14003A830((__int64)Src);
}
sub_14003BDB0((__int64)&Buf2, (__int64)&a1->m_level->m_levelName);
sub_140051590((__int64)&a1->m_levelName, (__int64)&Buf2);
sub_14003A830((__int64)&Buf2);
a1->m_levelType = a2->m_levelType;
v8 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v175 = (void **)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v175);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v8 = qword_1406C2ED8;
}
*(_DWORD *)(v8 + 948) = a1->m_level->m_M_ID;
LOBYTE(v8) = 1;
a1->setKeypadEnabled(a1, v8);
LOBYTE(v9) = 1;
a1->setKeyboardEnabled(a1, v9);
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
v12 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v13 = v12->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, 0.0, 0.0);
v13->setAnchorPoint(v12, v14);
a1->addChild_0(a1, v12, -2);
((void (__fastcall *)(struct cocos2d::CCSprite *))v12->setScaleX)(v12);
((void (__fastcall *)(struct cocos2d::CCSprite *))v12->setScaleY)(v12);
v15 = v12->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, -5.0, -5.0);
v15->setPosition_0(v12, v16);
LOWORD(v175) = 26112;
BYTE2(v175) = -1;
v12->setColor(&v12->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v175);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v18 = v17->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, 0.0, 0.0);
v18->setAnchorPoint(v17, v19);
v20 = v17->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v21);
v23 = cocos2d::CCDirector::getScreenBottom(v22) - 1.0;
v25 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
v26 = cocos2d::CCDirector::getScreenLeft(v25) - 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, v26, v23);
v20->setPosition_0(v17, v27);
a1->addChild_0(a1, v17, 1);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v29 = v28->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, 1.0, 0.0);
v29->setAnchorPoint(v28, v30);
v31 = v28->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v33 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v32);
v34 = cocos2d::CCDirector::getScreenBottom(v33) - 1.0;
v36 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v35);
v37 = cocos2d::CCDirector::getScreenRight(v36) + 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v175, v37, v34);
v31->setPosition_0(v28, v38);
cocos2d::CCSprite::setFlipX(v28, 1);
a1->addChild_0(a1, v28, 1);
v40 = (cocos2d::CCArray *)cocos2d::CCArray::create(v39);
a1->m_textInputs = v40;
cocos2d::CCObject::retain(v40);
cocos2d::CCRect::CCRect(&v187, 0.0, 0.0, 80.0, 80.0);
v42 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v41);
v43 = cocos2d::CCDirector::getScreenTop(v42) - 30.0;
cocos2d::CCPoint::CCPoint(&v180, v177 * 0.5, v43);
v44 = (struct cocos2d::CCRect *)cocos2d::CCRect::CCRect((cocos2d::CCRect *)Buf1, &v187);
v45 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v44);
LOBYTE(v46) = -1;
v45->setOpacity(&v45->cocos2d::CCRGBAProtocol, v46);
cocos2d::CCSize::CCSize(&v181, 365.0, 40.0);
v45->setContentSize(v45, &v181);
v47 = -1;
a1->addChild_0(a1, v45, -1);
v45->setPosition_0(v45, &v180);
LOWORD(v175) = 14336;
BYTE2(v175) = -115;
v45->setColor(&v45->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v175);
m_level = a1->m_level;
if ( m_level->m_levelVersion > 1 || m_level->m_isUploaded )
{
sub_14003BDB0((__int64)&Buf2, (__int64)&m_level->m_levelName);
p_Buf2 = (const char *)&Buf2;
if ( v193 > 0xF )
p_Buf2 = (const char *)Buf2;
v59 = cocos2d::CCLabelBMFont::create(p_Buf2, "goldFont.fnt");
sub_14003A830((__int64)&Buf2);
a1->addChild_0(a1, v59, 20);
v59->setPosition_0(v59, &v180);
v51 = &a1->TextInputDelegate;
}
else
{
v50 = CCTextInputNode::create(300.0, 50.0, "Level Name", v48, v174, (const char *)&qword_14052A4D8);
a1->addChild_0(a1, v50, 18);
v51 = &a1->TextInputDelegate;
v50->m_delegate = &a1->TextInputDelegate;
v50->setTag(v50, 1);
v50->setPosition_0(v50, &v180);
v50->m_maxLabelLength = 20;
v50->m_filterSwearWords = 1;
Buf2 = 0;
v192 = 0;
v193 = 15;
LOBYTE(Buf2) = 0;
sub_14003BDB0((__int64)Buf1, (__int64)&a1->m_level->m_levelName);
v52 = Buf1;
if ( v190 > 0xF )
v52 = (void **)Buf1[0];
v53 = v189;
v54 = v189;
if ( v189 )
v54 = 0;
LODWORD(v55) = memcmp(v52, &Buf2, v54);
if ( !(_DWORD)v55 )
v55 = v53 != 0;
sub_14003A830((__int64)Buf1);
if ( (_DWORD)v55 )
{
sub_14003BDB0((__int64)&Buf2, (__int64)&a2->m_levelName);
v56 = &Buf2;
if ( v193 > 0xF )
v56 = (__int128 *)Buf2;
*(_OWORD *)Buf1 = 0;
v189 = 0;
v190 = 0;
v57 = -1;
do
++v57;
while ( *((_BYTE *)v56 + v57) );
sub_14003A930(Buf1, v56, v57);
CCTextInputNode::setString((__int64)v50, Buf1);
sub_14003A830((__int64)&Buf2);
}
LOWORD(v175) = -21896;
*(_WORD *)&v50->m_placeholderColor.r = -21896;
v50->m_placeholderColor.b = -16;
CCTextInputNode::refreshLabel(v50);
v50->m_placeholderScale = 0.69999999;
CCTextInputNode::refreshLabel(v50);
cocos2d::CCArray::addObject(a1->m_textInputs, v50);
}
cocos2d::CCPoint::CCPoint(&v179, v177 * 0.5, (float)(v178 * 0.5) + 65.0);
v60 = (struct cocos2d::CCRect *)cocos2d::CCRect::CCRect((cocos2d::CCRect *)Buf1, &v187);
v61 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v60);
LOBYTE(v62) = -1;
v61->setOpacity(&v61->cocos2d::CCRGBAProtocol, v62);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v175, 365.0, 60.0);
cocos2d::CCSize::operator=(&v181, v63);
v61->setContentSize(v61, &v181);
a1->addChild_0(a1, v61, -1);
v61->setPosition_0(v61, &v179);
LOWORD(v175) = 14336;
BYTE2(v175) = -115;
v61->setColor(&v61->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v175);
v65 = CCTextInputNode::create(365.0, 50.0, "Description [Optional]", v64, v174, nullptr);
v65->m_filterSwearWords = 0;
a1->addChild_0(a1, v65, 20);
v65->m_delegate = v51;
v65->setTag(v65, 2);
v65->setPosition_0(v65, &v179);
*(_OWORD *)v182 = 0;
v183 = 0;
v184 = 15;
v182[0] = sub_14003AA10(0x70u);
v183 = 97;
v184 = 111;
strcpy(
(char *)v182[0],
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
v175 = v182;
if ( &v65->m_allowedChars != (std::string *)v182 )
{
v66 = v182;
if ( v184 > 0xF )
v66 = (void **)v182[0];
sub_14003CCE0((void **)&v65->m_allowedChars, v66, v183);
}
sub_14003A830((__int64)v182);
v65->m_maxLabelLength = 180;
cocos2d::CCArray::addObject(a1->m_textInputs, v65);
v65->m_textField->setVisible(v65->m_textField, 0);
v175 = Buf1;
*(_OWORD *)Buf1 = 0;
v189 = 0;
v190 = 15;
LOBYTE(Buf1[0]) = 0;
cocos2d::CCPoint::CCPoint(&v176, 0.5, 0.5);
v68 = TextArea::create((__int64)Buf1, "chatFont.fnt", 1.0, 315.0, v67, 1101004800, 1);
CCTextInputNode::addTextArea(v65, (TextArea *)v68);
LOWORD(v175) = -21896;
*(_WORD *)&v65->m_placeholderColor.r = -21896;
v65->m_placeholderColor.b = -16;
CCTextInputNode::refreshLabel(v65);
GJGameLevel::getUnpackedLevelDescription(a2, v194);
Buf2 = 0;
v192 = 0;
v193 = 15;
LOBYTE(Buf2) = 0;
v69 = v194;
v70 = v196 > 0xF;
v71 = (void **)v194[0];
if ( v196 > 0xF )
v69 = (void **)v194[0];
v72 = v195;
v73 = v195;
if ( v195 )
v73 = 0;
if ( memcmp(v69, &Buf2, v73) || v72 )
{
v75 = v194;
if ( v70 )
v75 = v71;
*(_OWORD *)Buf1 = 0;
v189 = 0;
v190 = 0;
do
++v47;
while ( *((_BYTE *)v75 + v47) );
sub_14003A930(Buf1, v75, v47);
CCTextInputNode::setString((__int64)v65, Buf1);
}
v76 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v74);
a1->m_buttonMenu = v76;
a1->addChild_1(a1, v76);
v77 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_editBtn_001.png");
v78 = CCMenuItemSpriteExtra::create(v77, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onEdit);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v78);
v79 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playBtn2_001.png");
v80 = CCMenuItemSpriteExtra::create(v79, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onPlay);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v80);
v81 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_shareBtn_001.png");
v82 = CCMenuItemSpriteExtra::create(v81, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onShare);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v82);
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(a1->m_buttonMenu, 20.0);
m_buttonMenu = a1->m_buttonMenu;
v84 = m_buttonMenu->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v85 = v178 * 0.5;
v86 = (float *)m_buttonMenu->getPosition_0(m_buttonMenu);
cocos2d::CCPoint::CCPoint(&v176, *v86, v85 - 25.0);
v84->setPosition_0(a1->m_buttonMenu, v87);
EditLevelLayer::setupLevelInfo(a1);
v89 = a1->m_level;
if ( v89->m_levelVersion > 1 || v89->m_isUploaded )
{
v90 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v91 = CCMenuItemSpriteExtra::create(
v90,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)EditLevelLayer::onUpdateDescription);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v91);
v92 = v91->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v176, 30.0, v179.y);
v93 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v175);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v92->setPosition_0)(v91, v93);
}
v94 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v88);
v175 = (void **)&v94->__vftable;
a1->addChild_1(a1, v94);
v96 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v95);
v97 = cocos2d::CCDirector::getScreenTop(v96) - 30.0;
v99 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v98);
v100 = cocos2d::CCDirector::getScreenRight(v99) - 30.0;
cocos2d::CCPoint::CCPoint(&v186, v100, v97);
v101 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v102 = CCMenuItemSpriteExtra::create(v101, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::confirmDelete);
v94->addChild_1(v94, v102);
v103 = v102->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v104 = cocos2d::CCNode::convertToNodeSpace(v94, &v176);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v103->setPosition_0)(v102, v104);
v105 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_helpBtn_001.png");
v106 = v105->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v101->getContentSize(v101);
v105->getContentSize(v105);
((void (__fastcall *)(struct cocos2d::CCSprite *))v106->setScale_0)(v105);
v107 = CCMenuItemSpriteExtra::create(v105, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onHelp);
v108 = (cocos2d::CCNode *)v175;
(*((void (__fastcall **)(void **, CCMenuItemSpriteExtra *))*v175 + 56))(v175, v107);
cocos2d::CCPoint::CCPoint(&v176, 0.0, -60.0);
v109 = (__int64)v102->getPosition_0(v102);
cocos2d::CCPoint::operator+(v109, &v175);
v107->setPosition_0(v107, (const cocos2d::CCPoint *)&v175);
v110 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
v111 = CCMenuItemSpriteExtra::create(v110, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::confirmClone);
v108->addChild_1(v108, v111);
cocos2d::CCPoint::CCPoint(&v176, 0.0, -60.0);
v112 = (__int64)v107->getPosition_0(v107);
cocos2d::CCPoint::operator+(v112, &v175);
v111->setPosition_0(v111, (const cocos2d::CCPoint *)&v175);
v113 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_orderUpBtn_001.png");
v114 = CCMenuItemSpriteExtra::create(
v113,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)EditLevelLayer::confirmMoveToTop);
v108->addChild_1(v108, v114);
cocos2d::CCPoint::CCPoint(&v176, 0.0, -60.0);
v115 = (__int64)v111->getPosition_0(v111);
cocos2d::CCPoint::operator+(v115, &v175);
v114->setPosition_0(v114, (const cocos2d::CCPoint *)&v175);
v116 = cocos2d::CCSprite::createWithSpriteFrameName("gj_folderBtn_001.png");
v117 = cocos2d::CCString::createWithFormat("%i", a1->m_level->m_levelFolder);
CString = cocos2d::CCString::getCString(v117);
v119 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_14052A4D8);
a1->m_folderLabel = v119;
v116->addChild_0(v116, v119, 1);
v120 = a1->m_folderLabel->__vftable;
height = v116->getContentSize(v116)->height;
v122 = (float *)v116->getContentSize(v116);
cocos2d::CCPoint::CCPoint(&v176, *v122 * 0.5, (float)(height * 0.5) + 1.0);
v120->setPosition_0(a1->m_folderLabel, v123);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_folderLabel, 24.0, 0.55000001, 0.0);
v124 = CCMenuItemSpriteExtra::create(v116, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onSetFolder);
v108->addChild_1(v108, v124);
v125 = v124->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v176, 30.0, v179.y - 60.0);
v126 = cocos2d::CCNode::convertToNodeSpace(v108, (const struct cocos2d::CCPoint *)&v175);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v125->setPosition_0)(v124, v126);
if ( a1->m_level->m_levelLength == 5 )
{
v127 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_levelLeaderboardBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v127->setScale_0)(v127);
v128 = CCMenuItemSpriteExtra::create(
v127,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)EditLevelLayer::onLevelLeaderboard);
v108->addChild_1(v108, v128);
cocos2d::CCPoint::CCPoint(&v176, 0.0, -50.0);
v129 = (__int64)v124->getPosition_0(v124);
cocos2d::CCPoint::operator+(v129, &v175);
v128->setPosition_0(v128, (const cocos2d::CCPoint *)&v175);
}
v130 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v131 = CCMenuItemSpriteExtra::create(v130, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onBack);
HIDWORD(v131->m_pfnSelector.adj) = 1070386381;
v132 = cocos2d::CCMenu::create(v131, 0);
a1->addChild_0(a1, v132, 1);
v133 = v132->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v135 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v134);
v136 = cocos2d::CCDirector::getScreenTop(v135) - 23.0;
v138 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v137);
v139 = cocos2d::CCDirector::getScreenLeft(v138) + 24.0;
cocos2d::CCPoint::CCPoint(&v176, v139, v136);
v133->setPosition_0(v132, v140);
v142 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v141);
a1->addChild_0(a1, v142, 2);
v143 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v144 = CCMenuItemSpriteExtra::create(v143, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onLevelInfo);
HIDWORD(v144->m_pfnSelector.adj) = 0x40000000;
v142->addChild_1(v142, v144);
v145 = v142->__vftable;
v147 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v146);
v148 = cocos2d::CCDirector::getScreenBottom(v147) + 30.0;
v150 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v149);
v151 = cocos2d::CCDirector::getScreenLeft(v150) + 30.0;
cocos2d::CCPoint::CCPoint(&v176, v151, v148);
v145->setPosition_0(v142, v152);
v153 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_reportBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v153->setScale_0)(v153);
v154 = CCMenuItemSpriteExtra::create(v153, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onGuidelines);
HIDWORD(v154->m_pfnSelector.adj) = 1067030938;
v142->addChild_1(v142, v154);
v155 = v154->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v157 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v156);
v158 = cocos2d::CCDirector::getScreenBottom(v157) + 30.0;
v160 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v159);
v161 = cocos2d::CCDirector::getScreenRight(v160) - 30.0;
cocos2d::CCPoint::CCPoint(&v176, v161, v158);
v162 = cocos2d::CCNode::convertToNodeSpace(v142, (const struct cocos2d::CCPoint *)&v175);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v155->setPosition_0)(v154, v162);
v163 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_optionsBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v163->setScale_0)(v163);
v164 = CCMenuItemSpriteExtra::create(v163, nullptr, a1, (cocos2d::SEL_MenuHandler *)EditLevelLayer::onLevelOptions);
v142->addChild_1(v142, v164);
v165 = v164->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Buf1, 30.0, 70.0);
v166 = cocos2d::CCNode::convertToNodeSpace(v142, &v176);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v165->setPosition_0)(v164, v166);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v168, v167) + 197) )
{
GameToolbox::addBackButton(a1, v131);
v169 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_Start_001.png");
v79->addChild_1(v79, v169);
v170 = v169->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v171 = v79->getContentSize(v79)->height;
v172 = (float *)v79->getContentSize(v79);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Buf1, *v172 * 0.5, (float)(v171 * 0.5) - 40.0);
v170->setPosition_0(v169, v173);
}
sub_14003A830((__int64)v194);
return 1;
}
return result;
}