//
// EditLevelLayer::init from 0x1001dccd0 to 0x1001de304 (5684 bytes)
//
// 1 xrefs:
// > EditLevelLayer::create @ 0x1001dcc91
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:26:27 +0000
//
__int64 __fastcall EditLevelLayer::init(_QWORD *a1, std::string *p_str)
{
std::string *v2; // r15
__int64 result; // rax
void *data; // rdi
__int64 v6; // rdx
__int64 v7; // rax
__int64 v8; // rax
char v9; // al
__int64 v10; // rbx
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rax
_QWORD *v14; // r13
_QWORD *v15; // rbx
double v16; // xmm0_8
__int64 v17; // rax
__int64 v18; // rax
float *v19; // rbx
__int64 v20; // r14
__int64 v21; // rdi
__int64 v22; // rax
double v23; // xmm0_8
__int64 v24; // rbx
__int64 v25; // rdi
__int64 v26; // rax
double v27; // xmm0_8
__int64 v28; // rax
__int64 v29; // rax
double v30; // xmm0_8
__int64 v31; // r14
__int64 v32; // rax
bool v33; // cc
__int64 v34; // rax
char *v35; // rdi
__int64 v36; // rbx
_QWORD *v37; // r15
_QWORD *v38; // r12
_QWORD *v39; // rbx
__int64 v40; // rax
__int64 v41; // rax
__int64 v42; // rbx
const char *v43; // rbx
size_t v44; // rax
size_t v45; // r14
char *v46; // r13
size_t v47; // rbx
__int64 v48; // r14
_QWORD *v49; // r12
unsigned int v50; // eax
__int64 v51; // rbx
__int64 v52; // rbx
_QWORD *v53; // r15
__int64 v54; // rax
int v55; // edx
int v56; // ecx
int v57; // r8d
int v58; // r9d
__int64 v59; // rbx
const char *v60; // rbx
size_t v61; // rax
size_t v62; // r14
char *v63; // r15
size_t v64; // r13
__int64 v65; // rax
_QWORD *v66; // rdi
__int64 v67; // rax
_QWORD *v68; // rbx
__int64 v69; // rax
_QWORD *v70; // rbx
__int64 v71; // rax
__int64 v72; // rax
_QWORD *v73; // rbx
__int64 v74; // rax
__int64 v75; // rbx
float v76; // xmm0_4
__int64 v77; // r15
_QWORD *v78; // rdi
__int64 v79; // rdi
__int64 v80; // rax
double v81; // xmm0_8
__int64 v82; // rax
__int64 v83; // rbx
__int64 v84; // rax
__int64 v85; // rbx
__int64 v86; // r13
__int64 v87; // rbx
__int64 v88; // rbx
__int64 v89; // r14
__int64 v90; // rbx
__int64 v91; // rax
__int64 CString; // rax
__int64 v93; // rax
__int64 v94; // r14
__int64 v95; // rax
__int64 v96; // rbx
__int64 v97; // r14
__int64 v98; // rdi
__int64 v99; // rbx
__int64 v100; // rax
__int64 v101; // r14
float *v102; // rax
double v103; // xmm0_8
__int64 v104; // rsi
__int64 v105; // r14
float *v106; // rax
__int64 v107; // rax
__int64 v108; // rax
__int64 v109; // rax
__int64 v110; // rax
__int64 v111; // rax
__int64 v112; // rax
__int64 v113; // rax
int v114; // eax
unsigned int i; // ebx
__int64 v116; // r12
__int64 v117; // rax
__int64 v118; // r12
int v119; // edx
int v120; // ecx
int v121; // r8d
int v122; // r9d
__int64 v123; // rbx
_QWORD *v124; // rdi
__int64 v125; // rdi
__int64 v126; // rax
double v127; // xmm0_8
__int64 v128; // rbx
__int64 v129; // rax
__int64 v130; // r14
__int64 v131; // rdi
__int64 v132; // rax
double v133; // xmm0_8
__int64 v134; // rax
__int64 v135; // r14
__int64 v136; // rbx
__int64 v137; // rax
char v138[16]; // [rsp+0h] [rbp-130h] BYREF
char v139[8]; // [rsp+10h] [rbp-120h] BYREF
__int16 v140[8]; // [rsp+18h] [rbp-118h] BYREF
void *v141; // [rsp+28h] [rbp-108h]
__int64 v142; // [rsp+30h] [rbp-100h]
std::string v143; // [rsp+38h] [rbp-F8h] BYREF
std::string __str; // [rsp+50h] [rbp-E0h] BYREF
char v145[8]; // [rsp+70h] [rbp-C0h] BYREF
float v146[2]; // [rsp+78h] [rbp-B8h] BYREF
_QWORD __dst[2]; // [rsp+80h] [rbp-B0h] BYREF
void *v148; // [rsp+90h] [rbp-A0h]
_QWORD v149[2]; // [rsp+98h] [rbp-98h] BYREF
void *v150; // [rsp+A8h] [rbp-88h]
char v151[8]; // [rsp+B0h] [rbp-80h] BYREF
std::string *v152; // [rsp+B8h] [rbp-78h]
char v153[8]; // [rsp+C0h] [rbp-70h] BYREF
float v154; // [rsp+C8h] [rbp-68h] BYREF
float v155; // [rsp+CCh] [rbp-64h]
unsigned __int8 v156; // [rsp+D3h] [rbp-5Dh]
float v157; // [rsp+D4h] [rbp-5Ch]
char v158[8]; // [rsp+D8h] [rbp-58h] BYREF
char __s[16]; // [rsp+E0h] [rbp-50h] BYREF
void *__p; // [rsp+F0h] [rbp-40h]
__int64 v161; // [rsp+F8h] [rbp-38h]
_QWORD *v162; // [rsp+100h] [rbp-30h]
v2 = p_str;
result = cocos2d::CCLayer::init();
if ( !(_BYTE)result )
return result;
v156 = result;
a1[59] = p_str;
data = p_str;
cocos2d::CCObject::retain(p_str);
v162 = a1;
v7 = a1[59];
if ( (*(_BYTE *)(v7 + 344) & 1) != 0 )
{
p_str = *(std::string **)(v7 + 360);
data = __s;
sub_10001AD30(__s, p_str, *(_QWORD *)(v7 + 352));
v9 = __s[0];
if ( (__s[0] & 1) != 0 )
{
LABEL_4:
v10 = *(_QWORD *)&__s[8];
data = __p;
operator delete(__p);
if ( !v10 )
goto LABEL_13;
goto LABEL_8;
}
}
else
{
v8 = v7 + 344;
__p = *(void **)(v8 + 16);
*(_OWORD *)__s = *(_OWORD *)v8;
v9 = __s[0];
if ( (__s[0] & 1) != 0 )
goto LABEL_4;
}
if ( !v9 )
goto LABEL_13;
LABEL_8:
v11 = v162[59];
if ( (*(_BYTE *)(v11 + 344) & 1) != 0 )
sub_10001AD30(&__str, *(const void **)(v11 + 360), *(_QWORD *)(v11 + 352));
else
__str = *(std::string *)(v11 + 344);
p_str = &__str;
data = (void *)(v11 + 1152);
std::string::operator=((std::string *)(v11 + 1152), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
{
data = __str.__r_.__value_.__l.__data_;
operator delete(__str.__r_.__value_.__l.__data_);
}
LABEL_13:
v12 = v162[59];
if ( (*(_BYTE *)(v12 + 344) & 1) == 0 )
{
v13 = v12 + 344;
__p = *(void **)(v13 + 16);
*(_OWORD *)__s = *(_OWORD *)v13;
v14 = v162;
v15 = v162 + 63;
if ( (v162[63] & 1) == 0 )
goto LABEL_18;
goto LABEL_17;
}
p_str = *(std::string **)(v12 + 360);
data = __s;
sub_10001AD30(__s, p_str, *(_QWORD *)(v12 + 352));
v14 = v162;
v15 = v162 + 63;
if ( (v162[63] & 1) != 0 )
{
LABEL_17:
data = (void *)v14[65];
operator delete(data);
}
LABEL_18:
v15[2] = __p;
*(_OWORD *)v15 = *(_OWORD *)__s;
*((_DWORD *)v14 + 125) = HIDWORD(v2[47].__r_.__value_.__r.__words[1]);
*(_QWORD *)&v16 = GameManager::sharedState(data, p_str, v6).u64[0];
*(_DWORD *)(v17 + 964) = *(_DWORD *)(v14[59] + 1144LL);
(*(void (__fastcall **)(_QWORD *, __int64, double))(*v14 + 1072LL))(v14, 1, v16);
(*(void (__fastcall **)(_QWORD *, __int64))(*v14 + 1088LL))(v14, 1);
v18 = cocos2d::CCDirector::sharedDirector(v14, 1);
cocos2d::CCDirector::getWinSize(&v154, v18);
v19 = (float *)cocos2d::CCSprite::create_1("GJ_gradientBG.png");
sub_100278250(__s, 0.0, 0.0);
(*(void (__fastcall **)(float *, char *))(*(_QWORD *)v19 + 296LL))(v19, __s);
(*(void (__fastcall **)(_QWORD *, float *, __int64))(*v14 + 464LL))(v14, v19, 4294967294LL);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v19 + 128LL))(v19, (float)(v154 + 10.0) / v19[108]);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v19 + 144LL))(v19, (float)(v155 + 10.0) / v19[109]);
sub_100278250(__s, -5.0, -5.0);
(*(void (__fastcall **)(float *, char *))(*(_QWORD *)v19 + 184LL))(v19, __s);
__s[2] = -1;
*(_WORD *)__s = 26112;
(*(void (__fastcall **)(float *, char *))(*(_QWORD *)v19 + 960LL))(v19, __s);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
sub_100278250(__s, 0.0, 0.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v20 + 296LL))(v20, __s);
v21 = cocos2d::CCDirector::sharedDirector(v20, __s);
*(float *)&v161 = sub_100479760(v21) + -1.0;
v22 = cocos2d::CCDirector::sharedDirector(v21, __s);
v23 = sub_100479750(v22);
sub_100278250(__s, *(float *)&v161, *(float *)&v23 + -1.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v20 + 184LL))(v20, __s);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v14 + 464LL))(v14, v20, 1);
v24 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
sub_100278250(__s, 1.0, 0.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 296LL))(v24, __s);
v25 = cocos2d::CCDirector::sharedDirector(v24, __s);
*(float *)&v161 = sub_100479770(v25) + 1.0;
v26 = cocos2d::CCDirector::sharedDirector(v25, __s);
v27 = sub_100479750(v26);
sub_100278250(__s, *(float *)&v161, *(float *)&v27 + -1.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 184LL))(v24, __s);
cocos2d::CCSprite::setFlipX(v24, 1);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v14 + 464LL))(v14, v24, 1);
v28 = sub_1007FE900(v14);
v14[60] = v28;
cocos2d::CCObject::retain(v28);
sub_100278270(v138, 0.0, 0.0, COERCE_DOUBLE(1117782016), COERCE_DOUBLE(1117782016));
*(float *)&v161 = v154 * 0.5;
v29 = cocos2d::CCDirector::sharedDirector(v138, v24);
v30 = sub_100479740(v29);
sub_100278250(v145, *(float *)&v161, *(float *)&v30 + -30.0);
sub_1002787F0(__s, v138);
v31 = cocos2d::extension::CCScale9Sprite::create_2("square02b_001.png", __s);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v31 + 912LL))(v31, 255);
sub_100278260(v139, COERCE_DOUBLE(1136033792), COERCE_DOUBLE(1109393408));
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v31 + 320LL))(v31, v139);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v14 + 464LL))(v14, v31, 0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v31 + 184LL))(v31, v145);
__s[2] = -115;
*(_WORD *)__s = 14336;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v31 + 960LL))(v31, __s);
v32 = v14[59];
v33 = *(_DWORD *)(v32 + 788) <= 1;
v152 = v2;
if ( v33 && *(_BYTE *)(v32 + 785) != 1 )
{
v38 = CCTextInputNode::create(
(__int64)"Level Name",
(__int64)"Thonburi",
0x18u,
(__int64)"bigFont.fnt",
300.0,
50.0);
v39 = v162;
(*(void (__fastcall **)(_QWORD *, _QWORD *, __int64))(*v162 + 464LL))(v162, v38, 18);
v38[73] = v39 + 51;
(*(void (__fastcall **)(_QWORD *, __int64))(*v38 + 72LL))(v38, 1);
(*(void (__fastcall **)(_QWORD *, char *))(*v38 + 184LL))(v38, v145);
*((_DWORD *)v38 + 148) = 20;
*((_BYTE *)v38 + 608) = 1;
v40 = v39[59];
if ( (*(_BYTE *)(v40 + 344) & 1) != 0 )
{
sub_10001AD30(__s, *(const void **)(v40 + 360), *(_QWORD *)(v40 + 352));
}
else
{
v41 = v40 + 344;
__p = *(void **)(v41 + 16);
*(_OWORD *)__s = *(_OWORD *)v41;
}
if ( (__s[0] & 1) != 0 )
{
v42 = *(_QWORD *)&__s[8];
operator delete(__p);
if ( !v42 )
{
LABEL_52:
CCTextInputNode::setLabelPlaceholderColor((__int64)v38, 15772280);
CCTextInputNode::setLabelPlaceholderScale((__int64)v38, 0.69999999);
v37 = v162;
sub_1007FEBF0(v162[60], v38);
goto LABEL_53;
}
}
else if ( !((unsigned __int8)__s[0] >> 1) )
{
goto LABEL_52;
}
if ( (v2[14].__r_.__value_.__s.__data_[7] & 1) != 0 )
{
sub_10001AD30(__s, (const void *)v2[15].__r_.__value_.__r.__words[0], v2[14].__r_.__value_.__r.__words[2]);
if ( (__s[0] & 1) == 0 )
goto LABEL_37;
}
else
{
__p = (void *)v2[15].__r_.__value_.__r.__words[0];
*(_OWORD *)__s = *(_OWORD *)&v2[14].__r_.__value_.__r.__words[1];
if ( (__s[0] & 1) == 0 )
{
LABEL_37:
v43 = &__s[1];
goto LABEL_40;
}
}
v43 = (const char *)__p;
LABEL_40:
v44 = strlen(v43);
if ( v44 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v45 = v44;
if ( v44 >= 0x17 )
{
v161 = (__int64)v43;
v47 = 26;
if ( (v44 | 7) != 0x17 )
v47 = (v44 | 7) + 1;
v46 = (char *)operator new(v47);
v148 = v46;
__dst[0] = v47 | 1;
__dst[1] = v45;
v43 = (const char *)v161;
}
else
{
LOBYTE(__dst[0]) = 2 * v44;
v46 = (char *)__dst + 1;
if ( !v44 )
goto LABEL_48;
}
memmove(v46, v43, v45);
LABEL_48:
v46[v45] = 0;
CCTextInputNode::setString(v38, (__int64)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(v148);
if ( (__s[0] & 1) != 0 )
operator delete(__p);
goto LABEL_52;
}
if ( (*(_BYTE *)(v32 + 344) & 1) != 0 )
{
sub_10001AD30(__s, *(const void **)(v32 + 360), *(_QWORD *)(v32 + 352));
if ( (__s[0] & 1) == 0 )
goto LABEL_22;
LABEL_24:
v35 = (char *)__p;
goto LABEL_25;
}
v34 = v32 + 344;
__p = *(void **)(v34 + 16);
*(_OWORD *)__s = *(_OWORD *)v34;
if ( (__s[0] & 1) != 0 )
goto LABEL_24;
LABEL_22:
v35 = &__s[1];
LABEL_25:
v36 = cocos2d::CCLabelBMFont::create_3(v35, "goldFont.fnt");
if ( (__s[0] & 1) != 0 )
operator delete(__p);
v37 = v162;
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v162 + 464LL))(v162, v36, 20);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v36 + 184LL))(v36, v145);
LABEL_53:
sub_100278250(v146, v154 * 0.5, (float)(0.5 * v155) + 65.0);
sub_1002787F0(__s, v138);
v48 = cocos2d::extension::CCScale9Sprite::create_2("square02b_001.png", __s);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v48 + 912LL))(v48, 255);
sub_100278260(__s, COERCE_DOUBLE(1136033792), COERCE_DOUBLE(1114636288));
sub_100278660(v139, __s);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v48 + 320LL))(v48, v139);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v37 + 464LL))(v37, v48, 0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v48 + 184LL))(v48, v146);
__s[2] = -115;
*(_WORD *)__s = 14336;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v48 + 960LL))(v48, __s);
v49 = CCTextInputNode::create((__int64)"Description [Optional]", (__int64)"Thonburi", 0x18u, 0, 365.0, 50.0);
*((_BYTE *)v49 + 608) = 0;
(*(void (__fastcall **)(_QWORD *, _QWORD *, __int64))(*v37 + 464LL))(v37, v49, 20);
v49[73] = v37 + 51;
(*(void (__fastcall **)(_QWORD *, __int64))(*v49 + 72LL))(v49, 2);
(*(void (__fastcall **)(_QWORD *, float *))(*v49 + 184LL))(v49, v146);
v143.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x68u);
v143.__r_.__value_.__r.__words[0] = 105;
v143.__r_.__value_.__l.__size_ = 97;
strcpy(
v143.__r_.__value_.__l.__data_,
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
CCTextInputNode::setAllowedChars((__int64)v49, &v143);
if ( (*(_BYTE *)&v143.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v143.__r_.__value_.__l.__data_);
sub_100066EC0((__int64)v49, 1);
*((_DWORD *)v49 + 148) = 17 * EmoteSprite::maxEmotesComment() + 180;
v50 = EmoteSprite::maxEmotesComment();
CCTextInputNode::setParseEmotes((__int64)v49, v50);
sub_1007FEBF0(v162[60], v49);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v49[72] + 344LL))(v49[72], 0);
v140[0] = 0;
sub_100278250(__s, 0.5, 0.5);
v51 = TextArea::create(v140, "chatFont.fnt", __s, 1, 0, 1.0, 346.5, 20.0);
if ( (v140[0] & 1) != 0 )
operator delete(v141);
CCTextInputNode::addTextArea((__int64)v49, v51);
sub_100068D20((__int64)v49, 54.0);
CCTextInputNode::setLabelPlaceholderColor((__int64)v49, 15772280);
__s[0] = 8;
strcpy(&__s[1], "easy");
v52 = EmoteSprite::createWithName(__s);
if ( (__s[0] & 1) != 0 )
operator delete(__p);
EmoteSprite::fitToHeight(v52, 18.0, 0.0);
v53 = v162;
v54 = CCMenuItemSpriteExtra::create(v52, 0, v162, EditLevelLayer::onEmotes, 0);
v53[68] = v54;
CCMenuItemSpriteExtra::setSizeMult(v54, 1.5);
v59 = sub_1008735E0(v53[68], 0, v55, v56, v57, v58, v138[0]);
sub_100278250(__s, (float)(v146[0] + 182.5) + 17.0, v146[1]);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v59 + 184LL))(v59, __s);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v53 + 464LL))(v53, v59, 25);
GJGameLevel::getUnpackedLevelDescription(__s, v152);
if ( (__s[0] & 1) != 0 )
{
if ( !*(_QWORD *)&__s[8] )
goto LABEL_76;
LABEL_63:
if ( (__s[0] & 1) != 0 )
v60 = (const char *)__p;
else
v60 = &__s[1];
v61 = strlen(v60);
if ( v61 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v62 = v61;
if ( v61 >= 0x17 )
{
v64 = 26;
if ( (v61 | 7) != 0x17 )
v64 = (v61 | 7) + 1;
v63 = (char *)operator new(v64);
v150 = v63;
v149[0] = v64 | 1;
v149[1] = v62;
}
else
{
LOBYTE(v149[0]) = 2 * v61;
v63 = (char *)v149 + 1;
if ( !v61 )
{
LABEL_74:
v63[v62] = 0;
CCTextInputNode::setString(v49, (__int64)v149);
if ( (v149[0] & 1) != 0 )
operator delete(v150);
goto LABEL_76;
}
}
memmove(v63, v60, v62);
goto LABEL_74;
}
if ( (unsigned __int8)__s[0] >> 1 )
goto LABEL_63;
LABEL_76:
v65 = cocos2d::CCMenu::create();
v66 = v162;
v162[58] = v65;
(*(void (__fastcall **)(_QWORD *, __int64))(*v66 + 456LL))(v66, v65);
v67 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_editBtn_001.png");
v68 = v162;
v69 = CCMenuItemSpriteExtra::create(v67, 0, v162, EditLevelLayer::onEdit, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v68[58] + 456LL))(v68[58], v69);
v142 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playBtn2_001.png");
v70 = v162;
v71 = CCMenuItemSpriteExtra::create(v142, 0, v162, EditLevelLayer::onPlay, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v70[58] + 456LL))(v70[58], v71);
v72 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_shareBtn_001.png");
v73 = v162;
v74 = CCMenuItemSpriteExtra::create(v72, 0, v162, EditLevelLayer::onShare, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v73[58] + 456LL))(v73[58], v74);
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(v73[58], 20.0);
v75 = v73[58];
v76 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v75 + 192LL))(v75);
sub_100278250(v151, v76, (float)(v155 * 0.5) + -25.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v75 + 184LL))(v75, v151);
EditLevelLayer::setupLevelInfo(v162);
v77 = cocos2d::CCMenu::create();
v78 = v162;
(*(void (__fastcall **)(_QWORD *, __int64))(*v162 + 456LL))(v162, v77);
v79 = cocos2d::CCDirector::sharedDirector(v78, v77);
LODWORD(v161) = sub_100479770(v79);
v80 = cocos2d::CCDirector::sharedDirector(v79, v77);
v81 = sub_100479740(v80);
sub_100278250(v151, *(float *)&v161 + -30.0, *(float *)&v81 + -30.0);
v82 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v83 = CCMenuItemSpriteExtra::create(v82, 0, v162, EditLevelLayer::confirmDelete, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v77 + 456LL))(v77, v83);
cocos2d::CCNode::convertToNodeSpace(v158, v77, v151);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v83 + 184LL))(v83, v158);
v84 = cocos2d::CCDirector::sharedDirector(v83, v158);
LODWORD(v161) = sub_100479770(v84);
v85 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v85 + 160LL))(v85, 0.89999998);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v85 + 360LL))(v85, 90.0);
v86 = CCMenuItemSpriteExtra::create(v85, 0, v162, EditLevelLayer::confirmMoveToTop, 0);
CCMenuItemSpriteExtra::setSizeMult(v86, 1.1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v77 + 456LL))(v77, v86);
sub_100278250(v153, *(float *)&v161 + -30.0, (float)(v155 * 0.5) + 2.5);
cocos2d::CCNode::convertToNodeSpace(v158, v77, v153);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v86 + 184LL))(v86, v158);
v87 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v87 + 160LL))(v87, 0.89999998);
cocos2d::CCSprite::setFlipY(v87, 1);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v87 + 360LL))(v87, -90.0);
v88 = CCMenuItemSpriteExtra::create(v87, 0, v162, EditLevelLayer::confirmMoveToBottom, 0);
CCMenuItemSpriteExtra::setSizeMult(v88, 1.1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v77 + 456LL))(v77, v88);
v89 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v86 + 192LL))(v86);
sub_100278250(v153, 0.0, -30.0);
sub_100278350(v158, v89, v153);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v88 + 184LL))(v88, v158);
v90 = cocos2d::CCSprite::createWithSpriteFrameName("gj_folderBtn_001.png");
v91 = sub_10088E820("%i", v138[0]);
CString = cocos2d::CCString::getCString(v91);
v93 = cocos2d::CCLabelBMFont::create_3(CString, "bigFont.fnt");
v162[61] = v93;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v90 + 464LL))(v90, v93, 1);
v94 = v162[61];
LODWORD(v161) = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v90 + 328LL))(v90);
v95 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v90 + 328LL))(v90);
sub_100278250(v158, *(float *)&v161 * 0.5, (float)(*(float *)(v95 + 4) * 0.5) + 1.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v94 + 184LL))(v94, v158);
cocos2d::CCLabelBMFont::limitLabelWidth(v162[61], 24.0, 0.55000001, 0.0);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v90 + 160LL))(v90, 0.80000001);
v96 = CCMenuItemSpriteExtra::create(v90, 0, v162, EditLevelLayer::onSetFolder, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v77 + 456LL))(v77, v96);
v97 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v86 + 192LL))(v86);
sub_100278250(v153, 0.0, 25.0);
sub_100278350(v158, v97, v153);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v96 + 184LL))(v96, v158);
v98 = cocos2d::CCDirector::sharedDirector(v96, v158);
LODWORD(v152) = sub_100479760(v98);
v161 = sub_1007FE900(v98);
v99 = cocos2d::CCSprite::createWithSpriteFrameName("sideBtn_config_001.png");
v100 = CCMenuItemSpriteExtra::create(v99, 0, v162, EditLevelLayer::onCreatorSettings, 0);
sub_1007FEBF0(v161, v100);
v101 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
v157 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v99 + 328LL))(v99);
v102 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v101 + 328LL))(v101);
*(_QWORD *)&v103 = LODWORD(v157);
*(float *)&v103 = v157 / *v102;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v101 + 160LL))(v101, *(float *)&v103);
v104 = CCMenuItemSpriteExtra::create(v101, 0, v162, EditLevelLayer::confirmClone, 0);
sub_1007FEBF0(v161, v104);
if ( (unsigned __int8)GJGameLevel::isPlatformer(v162[59], v103) )
{
v105 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_levelLeaderboardBtn_001.png");
v157 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v99 + 328LL))(v99);
v106 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v105 + 328LL))(v105);
*(_QWORD *)&v103 = LODWORD(v157);
*(float *)&v103 = v157 / *v106;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v105 + 160LL))(v105, *(float *)&v103);
v107 = CCMenuItemSpriteExtra::create(v105, 0, v162, EditLevelLayer::onLevelLeaderboard, 0);
sub_1007FEBF0(v161, v107);
}
v108 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_exportBtn_001.png");
v109 = CCMenuItemSpriteExtra::create(v108, 0, v162, EditLevelLayer::onExportLevel, 0);
sub_1007FEBF0(v161, v109);
if ( !(unsigned __int8)GJGameLevel::isPlatformer(v162[59], v103) )
{
v110 = cocos2d::CCSprite::createWithSpriteFrameName("sideBtn_death_001.png");
v111 = CCMenuItemSpriteExtra::create(v110, 0, v162, EditLevelLayer::onDeathTracker, 0);
sub_1007FEBF0(v161, v111);
}
v112 = cocos2d::CCSprite::createWithSpriteFrameName("sideBtn_options_001.png");
v113 = CCMenuItemSpriteExtra::create(v112, 0, v162, EditLevelLayer::onLevelOptions, 0);
sub_1007FEBF0(v161, v113);
v157 = v155;
v114 = sub_1007FEF90(v161);
*(float *)&v152 = *(float *)&v152 + 30.0;
v157 = (float)((float)((float)(v114 - 1) * 34.0) * 0.5) + (float)(v157 * 0.5);
for ( i = 0; i < (unsigned int)sub_1007FEF90(v161); ++i )
{
v116 = sub_1007FEFE0(v161, i);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v77 + 456LL))(v77, v116);
sub_100278250(v153, *(float *)&v152, (float)((float)(int)i * -34.0) + v157);
cocos2d::CCNode::convertToNodeSpace(v158, v77, v153);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v116 + 184LL))(v116, v158);
}
v117 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v118 = CCMenuItemSpriteExtra::create(v117, 0, v162, EditLevelLayer::onBack, 0);
CCMenuItemSpriteExtra::setSizeMult(v118, 1.6);
v123 = sub_1008735E0(v118, 0, v119, v120, v121, v122, v138[0]);
v124 = v162;
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v162 + 464LL))(v162, v123, 1);
v125 = cocos2d::CCDirector::sharedDirector(v124, v123);
LODWORD(v161) = sub_100479760(v125);
v126 = cocos2d::CCDirector::sharedDirector(v125, v123);
v127 = sub_100479740(v126);
sub_100278250(v158, *(float *)&v161 + 24.0, *(float *)&v127 + -23.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v123 + 184LL))(v123, v158);
v128 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v162 + 464LL))(v162, v128, 2);
v129 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v130 = CCMenuItemSpriteExtra::create(v129, 0, v162, EditLevelLayer::onLevelInfo, 0);
CCMenuItemSpriteExtra::setSizeMult(v130, 2.0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v128 + 456LL))(v128, v130);
v131 = cocos2d::CCDirector::sharedDirector(v128, v130);
LODWORD(v161) = sub_100479760(v131);
v132 = cocos2d::CCDirector::sharedDirector(v131, v130);
v133 = sub_100479750(v132);
sub_100278250(v158, *(float *)&v161 + 30.0, *(float *)&v133 + 30.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v128 + 184LL))(v128, v158);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected() )
{
GameToolbox::addBackButton(v162, v118);
v134 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_Start_001.png");
v135 = v142;
v136 = v134;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v142 + 456LL))(v142, v134);
LODWORD(v161) = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v135 + 328LL))(v135);
v137 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v135 + 328LL))(v135);
sub_100278250(v158, *(float *)&v161 * 0.5, (float)(0.5 * *(float *)(v137 + 4)) + -40.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v136 + 184LL))(v136, v158);
}
if ( (__s[0] & 1) != 0 )
operator delete(__p);
return v156;
}