//
// SetGroupIDLayer::init from 0x9775c4 to 0x9797d8 (8724 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::create @ 0x9799ac
// > ??> @ 0x7b828
//
// 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 SetGroupIDLayer::init(SetGroupIDLayer *a1, GameObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCArray *v5; // x0
cocos2d::CCArray *v6; // x0
cocos2d::CCDictionary *v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCLayer *v9; // x0
SetGroupIDLayer_vtbl *v10; // x2
cocos2d::CCArray *v11; // x0
cocos2d::CCArray *v12; // x0
cocos2d::CCNode *v13; // x22
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x23
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCNode *v16; // x22
void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x23
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCLabelBMFont *v19; // x22
void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCLabelBMFont *v21; // x24
void (__fastcall *v22)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCLabelBMFont *v23; // x23
void (__fastcall *v24)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
__int64 v25; // x0
cocos2d::CCLabelBMFont *v26; // x25
cocos2d::CCMenu *v27; // x0
cocos2d::CCLayer *m_mainLayer; // x3
cocos2d::CCNode *v29; // x0
CCMenuItemSpriteExtra *v30; // x0
cocos2d::CCMenu *m_buttonMenu; // x26
cocos2d::CCSprite *v32; // x26
CCMenuItemSpriteExtra *v33; // x26
const cocos2d::CCPoint *v34; // x0
cocos2d::CCSprite *v35; // x26
CCMenuItemSpriteExtra *v36; // x26
void (__fastcall *v37)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
const cocos2d::CCPoint *v38; // x0
cocos2d::CCSprite *v39; // x26
CCMenuItemSpriteExtra *v40; // x26
void (__fastcall *v41)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
const cocos2d::CCPoint *v42; // x0
cocos2d::CCNode *v43; // x26
void *v44; // x0
void *v45; // x0
cocos2d::CCMenu *v46; // x0
cocos2d::CCMenu_vtbl *v47; // x2
void (__fastcall *v48)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
__int64 v49; // x22
void *v50; // x0
__int64 v51; // x22
void *v52; // x0
__int64 v53; // x23
char *v54; // x1
const char *v55; // x6
void *v56; // x0
cocos2d::CCNode *v57; // x0
CCMenuItemSpriteExtra *v58; // x22
cocos2d::CCMenu *v59; // x24
void (__fastcall *v60)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
const cocos2d::CCPoint *v61; // x0
const char *v62; // x6
float v63; // s8
cocos2d::CCNode *v64; // x0
CCMenuItemSpriteExtra *v65; // x22
void (__fastcall *v66)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
const cocos2d::CCPoint *v67; // x0
const char *v68; // x6
cocos2d::CCNode *v69; // x0
CCMenuItemSpriteExtra *v70; // x23
CCMenuItemSpriteExtra *v71; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v73)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
__int64 v74; // x24
__int64 v75; // x22
cocos2d::CCArray *v76; // x0
const char *v77; // x6
cocos2d::CCArray *v78; // x23
int v79; // w26
unsigned int v80; // w22
char *v81; // x0
cocos2d::CCNode *v82; // x24
CCMenuItemSpriteExtra *v83; // x25
float v84; // s0
float v85; // s1
void (__fastcall *v86)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
void (__fastcall *v87)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
void (__fastcall *v88)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCMenu *v89; // x25
char m_pobTexture; // w26
void *v91; // x0
unsigned int *v92; // x1
int v93; // w2
EffectGameObject *m_playbackObject; // x24
cocos2d::CCMenu *v95; // x25
void *v96; // x0
unsigned int *v97; // x1
int v98; // w2
EffectGameObject *m_traceOutObject; // x24
cocos2d::CCMenu *v100; // x25
void *v101; // x0
unsigned int *v102; // x1
int v103; // w2
EffectGameObject *m_traceInObject; // x24
cocos2d::CCMenu *v105; // x25
void *v106; // x0
unsigned int *v107; // x1
int v108; // w2
cocos2d::CCArray **p_m_pTargetArray; // x23
unsigned int *p_m_nExtraKerning; // x24
int m_nExtraKerning; // w0
cocos2d::CCMenu *v113; // x22
__int64 v114; // x24
GameObject *m_targetObject; // x0
float v116; // s15
unsigned int ParentMode; // w23
cocos2d::CCString *v118; // x0
char *CString; // x1
cocos2d::CCLabelBMFont *v120; // x22
void (__fastcall *v121)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
__int64 v122; // x24
char *v123; // x0
void *v124; // x0
cocos2d::CCSprite *v125; // x22
CCMenuItemSpriteExtra *v126; // x22
void (__fastcall *v127)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCMenu *v128; // x23
const char *v129; // x6
const char *v130; // x6
cocos2d::CCNode *v131; // x26
const char *v132; // x6
cocos2d::CCNode *v133; // x23
const char *v134; // x6
cocos2d::CCNode *v135; // x24
const char *v136; // x6
cocos2d::CCNode *v137; // x25
CCMenuItemSpriteExtra *v138; // x27
CCMenuItemSpriteExtra *v139; // x23
CCMenuItemSpriteExtra *v140; // x24
CCMenuItemSpriteExtra *v141; // x25
GameManager *v142; // x0
cocos2d::CCArray *m_targetObjects; // x0
unsigned int v144; // w26
char *v145; // x1
cocos2d::CCSprite *v146; // x22
const cocos2d::ccColor3B *v147; // x1
cocos2d::CCLabelBMFont *v148; // x23
void (__fastcall *v149)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
CCMenuItemSpriteExtra *v150; // x22
cocos2d::CCMenu *v151; // x23
void (__fastcall *v152)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
__int64 v153; // x24
float v154; // s0
void *v155; // x0
cocos2d::CCArray *v156; // x0
unsigned int v157; // w22
int v158; // w1
GameObject *v159; // x0
unsigned int *v160; // x1
int v161; // w2
unsigned int *v162; // x1
int v163; // w2
unsigned int *v164; // x1
int v165; // w2
unsigned int *v166; // x1
int v167; // w2
unsigned int *v168; // x1
int v169; // w2
unsigned int *v170; // x1
int v171; // w2
unsigned int *v172; // x1
int v173; // w2
unsigned int *v174; // x1
int v175; // w2
unsigned int *v176; // x1
int v177; // w2
char v178; // [xsp+DFh] [xbp+AFh]
cocos2d::CCMenu *v179; // [xsp+E0h] [xbp+B0h]
cocos2d::CCLabelBMFont *v181; // [xsp+F8h] [xbp+C8h]
cocos2d::CCNode *v182; // [xsp+108h] [xbp+D8h]
cocos2d::CCNode *v183; // [xsp+108h] [xbp+D8h]
cocos2d::CCMenu *v184; // [xsp+108h] [xbp+D8h]
__int64 v186; // [xsp+110h] [xbp+E0h]
__int64 v187; // [xsp+110h] [xbp+E0h]
void (__fastcall *v188)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+110h] [xbp+E0h]
void (__fastcall *v189)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+110h] [xbp+E0h]
cocos2d::CCMenu *v190; // [xsp+110h] [xbp+E0h]
cocos2d::CCMenu *v191; // [xsp+110h] [xbp+E0h]
cocos2d::CCMenu *v192; // [xsp+110h] [xbp+E0h]
cocos2d::CCNode *v193; // [xsp+110h] [xbp+E0h]
CCMenuItemSpriteExtra *v194; // [xsp+110h] [xbp+E0h]
float v195; // [xsp+130h] [xbp+100h]
float v196; // [xsp+134h] [xbp+104h]
cocos2d::CCPoint v197; // [xsp+138h] [xbp+108h] BYREF
cocos2d::CCLabelBMFont *v198; // [xsp+140h] [xbp+110h] BYREF
const char *v199; // [xsp+148h] [xbp+118h] BYREF
cocos2d::CCPoint v200; // [xsp+150h] [xbp+120h] BYREF
cocos2d::CCPoint v201; // [xsp+158h] [xbp+128h] BYREF
cocos2d::CCPoint v202; // [xsp+160h] [xbp+130h] BYREF
cocos2d::CCPoint v203; // [xsp+168h] [xbp+138h] BYREF
cocos2d::CCPoint v204; // [xsp+170h] [xbp+140h] BYREF
cocos2d::CCPoint v205; // [xsp+178h] [xbp+148h] BYREF
cocos2d::CCPoint v206; // [xsp+180h] [xbp+150h] BYREF
cocos2d::CCRect v207; // [xsp+188h] [xbp+158h] BYREF
cocos2d::CCPoint v208; // 0:kr28_8.8
cocos2d::CCPoint v209; // 0:kr30_8.8
cocos2d::CCPoint v210; // 0:kr38_8.8
cocos2d::CCPoint v211; // 0:kr60_8.8
cocos2d::SEL_MenuHandler v212; // 0:x2.16
cocos2d::SEL_MenuHandler v213; // 0:x2.16
cocos2d::SEL_MenuHandler v214; // 0:x2.16
cocos2d::SEL_MenuHandler v215; // 0:x2.16
cocos2d::SEL_MenuHandler v216; // 0:x2.16
cocos2d::SEL_MenuHandler v217; // 0:x2.16
cocos2d::SEL_MenuHandler v218; // 0:x2.16
cocos2d::SEL_MenuHandler v219; // 0:x2.16
cocos2d::SEL_MenuHandler v220; // 0:x2.16
cocos2d::SEL_MenuHandler v221; // 0:x2.16
cocos2d::SEL_MenuHandler v222; // 0:x2.16
cocos2d::SEL_MenuHandler v223; // 0:x2.16
cocos2d::SEL_MenuHandler v224; // 0:x2.16
cocos2d::SEL_MenuHandler v225; // 0:x2.16
cocos2d::SEL_MenuHandler v226; // 0:x2.16
cocos2d::CCPoint v227; // 0:s1.4,4:s2.4
cocos2d::CCRect v228; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
cocos2d::CCRect v229; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v207.origin.x = 8388600.0;
v178 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v207);
if ( !v178 )
return v178;
v5 = (cocos2d::CCArray *)((char *)&dword_0 + 1);
a1->m_editorLayerEdited = (unsigned __int8)&dword_0 + 1;
a1->m_noElasticity = (unsigned __int8)&dword_0 + 1;
if ( a2 )
{
a1->m_targetObject = a2;
}
else
{
a1->m_targetObjects = a3;
cocos2d::CCObject::retain(a3);
}
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
a1->m_zLayerButtons = v6;
cocos2d::CCObject::retain(v6);
v7 = cocos2d::CCDictionary::create();
a1->m_parentGroups = v7;
cocos2d::CCObject::retain(v7);
FLAlertLayer::incrementForcePrio(a1);
a1->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
v9 = cocos2d::CCLayer::create();
v10 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v9;
((void (__fastcall *)(SetGroupIDLayer *))v10->addChild)(a1);
v11 = (cocos2d::CCArray *)((__int64 (__fastcall *)(SetGroupIDLayer *, __int64))a1->setOpacity)(a1, 4294967240LL);
v12 = (cocos2d::CCArray *)cocos2d::CCArray::create(v11);
a1->m_groupIDObjects = v12;
cocos2d::CCObject::retain(v12);
a1->m_groupIDValue = GameManager::sharedState()->m_currentGroupID;
cocos2d::CCRect::CCRect(&v207, 0.0, 0.0, 80.0, 80.0);
v13 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v207,
v228);
setContentSize = v13->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v207, 390.0, 310.0);
setContentSize(v13, (const cocos2d::CCSize *)&v207);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v13, -2);
setPosition = v13->setPosition;
cocos2d::CCPoint::CCPoint(&v207.origin, v195 * 0.5, v196 * 0.5);
setPosition(v13, &v207.origin);
cocos2d::CCRect::CCRect(&v207, 0.0, 0.0, 80.0, 80.0);
v16 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02_001.png",
(const char *)&v207,
v229);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v16->__vftable[1].~CCNode_0)(v16, 50);
v17 = v16->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v207, 360.0, 68.0);
v17(v16, (const cocos2d::CCSize *)&v207);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v16, -1);
v18 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v207.origin, v195 * 0.5, (float)(v196 * 0.5) + -17.0);
v18(v16, &v207.origin);
v19 = cocos2d::CCLabelBMFont::create();
v20 = v19->setPosition;
cocos2d::CCPoint::CCPoint(&v207.origin, (float)(v195 * 0.5) + -125.0, (float)((float)(v196 * 0.5) + 155.0) - 17.0);
v20(v19, &v207.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v19);
v19->setScale(v19, 0.65);
v21 = cocos2d::CCLabelBMFont::create();
v22 = v21->setPosition;
cocos2d::CCPoint::CCPoint(&v207.origin, v195 * 0.5, (float)((float)(v196 * 0.5) + 155.0) - 17.0);
v22(v21, &v207.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v21);
v21->setScale(v21, 0.65);
v23 = cocos2d::CCLabelBMFont::create();
v24 = v23->setPosition;
v25 = (__int64)v19->getPosition(v19);
cocos2d::CCPoint::CCPoint(&v207.origin, v195 * 0.5, *(float *)(v25 + 4) - 65.0);
v24(v23, &v207.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v23);
v23->setScale(v23, 0.65);
v26 = cocos2d::CCLabelBMFont::create();
v182 = (cocos2d::CCNode *)v26->setPosition;
v186 = (__int64)v19->getPosition(v19);
cocos2d::CCPoint::CCPoint(&v206, 250.0, 0.0);
cocos2d::CCPoint::operator+(&v207, v186, &v206);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCRect *))v182)(v26, &v207);
a1->m_mainLayer->addChild(a1->m_mainLayer, v26);
v26->setScale(v26, 0.65);
v181 = cocos2d::CCLabelBMFont::create();
v183 = (cocos2d::CCNode *)v181->setPosition;
v187 = (__int64)v23->getPosition(v23);
cocos2d::CCPoint::CCPoint(&v206, 0.0, -137.0);
cocos2d::CCPoint::operator+(&v207, v187, &v206);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCRect *))v183)(v181, &v207);
a1->m_mainLayer->addChild(a1->m_mainLayer, v181);
v181->setScale(v181, 0.65);
v27 = cocos2d::CCMenu::create();
m_mainLayer = a1->m_mainLayer;
a1->m_buttonMenu = v27;
m_mainLayer->addChild_0(m_mainLayer, v27, 10);
a1->m_joystickConnected = -1;
v29 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0xFFFFFFFFLL,
30.0);
v212.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v212.adj = (size_t)SetGroupIDLayer::onClose;
v30 = CCMenuItemSpriteExtra::create(v29, nullptr, v212);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v30);
m_buttonMenu = a1->m_buttonMenu;
v188 = m_buttonMenu->setPosition;
cocos2d::CCPoint::CCPoint(&v207.origin, v195 * 0.5, (float)((float)(v196 * 0.5) + -155.0) + 23.0);
v188(m_buttonMenu, &v207.origin);
v32 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plus2Btn_001.png");
v32->setScale(v32, 0.8);
v213.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v213.adj = (size_t)SetGroupIDLayer::onNextFreeEditorLayer1;
v33 = CCMenuItemSpriteExtra::create(v32, nullptr, v213);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v33);
v189 = v33->setPosition;
v184 = a1->m_buttonMenu;
v34 = v19->getPosition(v19);
cocos2d::CCNode::convertToNodeSpace(v184, v34);
cocos2d::CCPoint::CCPoint(&v206, 50.0, 0.0);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
v189(v33, &v207.origin);
v35 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plus2Btn_001.png");
v35->setScale(v35, 0.8);
v214.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v214.adj = (size_t)SetGroupIDLayer::onNextFreeEditorLayer2;
v36 = CCMenuItemSpriteExtra::create(v35, nullptr, v214);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v36);
v190 = a1->m_buttonMenu;
v37 = v36->setPosition;
v38 = v21->getPosition(v21);
cocos2d::CCNode::convertToNodeSpace(v190, v38);
cocos2d::CCPoint::CCPoint(&v206, 54.0, 0.0);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
v37(v36, &v207.origin);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_optionsBtn_001.png");
v39->setScale(v39, 0.35);
v215.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v215.adj = (size_t)SetGroupIDLayer::onGroupIDOptions;
v40 = CCMenuItemSpriteExtra::create(v39, nullptr, v215);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v40);
v191 = a1->m_buttonMenu;
v41 = v40->setPosition;
v42 = v23->getPosition(v23);
cocos2d::CCNode::convertToNodeSpace(v191, v42);
cocos2d::CCPoint::CCPoint(&v206, 73.0, 0.0);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
v41(v40, &v207.origin);
sub_D153B8((int)&v206, "Help");
sub_D153B8(
(int)&v207,
"Add assigns up to 10 groups to the selected object(s).\n"
" P sets a single object as group parent.\n"
"Editor L1 and L2 places the object(s) on an editor layer.\n"
"Z layer sets the draw layer of the object(s). T layers are above, while B layers are below the player.\n"
"Z order sets the draw order of the object(s) within the Z layer.\n"
"CH sets the channel of the object(s).\n"
"ORD sets the order of the object(s).\n"
"Extra has more advanced options.\n"
"Preview makes touch toggled triggers preview in editor.\n"
"Playback starts playback from this object.");
v43 = (cocos2d::CCNode *)InfoAlertButton::create(0.8);
v44 = (void *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v160 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v161 = __ldaxr(v160);
while ( __stlxr(v161 - 1, v160) );
}
else
{
v161 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v161 - 1;
}
if ( v161 <= 0 )
operator delete(v44);
}
v45 = (void *)(*(_QWORD *)&v206 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v206 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v162 = (unsigned int *)(*(_QWORD *)&v206 - 8LL);
do
v163 = __ldaxr(v162);
while ( __stlxr(v163 - 1, v162) );
}
else
{
v163 = *(_DWORD *)(*(_QWORD *)&v206 - 8LL);
*(_DWORD *)(*(_QWORD *)&v206 - 8LL) = v163 - 1;
}
if ( v163 <= 0 )
operator delete(v45);
}
v46 = a1->m_buttonMenu;
v47 = v46->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v43[1].m_sInverse.b = 0.9;
v47->addChild(v46, v43);
v48 = v43->setPosition;
v192 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v206,
(float)((float)(v195 * 0.5) + 195.0) - 17.0,
(float)((float)(v196 * 0.5) + 155.0) - 17.0);
v208 = cocos2d::CCNode::convertToNodeSpace(v192, &v206);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *, float, float))v48)(v43, &v207, v208.x, v208.y);
v49 = (__int64)v19->getPosition(v19);
cocos2d::CCPoint::CCPoint(&v205, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v206, v49, &v205);
sub_D153B8((int)&v207, "L1");
a1->m_editorLayerInput = SetGroupIDLayer::createTextInput((__int64)a1, &v206, 5u, 6, (const char **)&v207, 2u, 50.0);
v50 = (void *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v164 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v165 = __ldaxr(v164);
while ( __stlxr(v165 - 1, v164) );
}
else
{
v165 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v165 - 1;
}
if ( v165 <= 0 )
operator delete(v50);
}
v51 = (__int64)v21->getPosition(v21);
cocos2d::CCPoint::CCPoint(&v205, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v206, v51, &v205);
sub_D153B8((int)&v207, "L2");
a1->m_editorLayer2Input = SetGroupIDLayer::createTextInput((__int64)a1, &v206, 6u, 6, (const char **)&v207, 3u, 50.0);
v52 = (void *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v166 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v167 = __ldaxr(v166);
while ( __stlxr(v167 - 1, v166) );
}
else
{
v167 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v167 - 1;
}
if ( v167 <= 0 )
operator delete(v52);
}
v53 = (__int64)v23->getPosition(v23);
cocos2d::CCPoint::CCPoint(&v207.origin, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v197, v53, &v207);
cocos2d::CCPoint::CCPoint(&v206, &v197);
if ( a1->m_groupIDValue == -1 )
v54 = "Mixed";
else
v54 = "Num";
sub_D153B8((int)&v207, v54);
a1->m_groupIDInput = SetGroupIDLayer::createTextInput((__int64)a1, &v206, 1u, 6, (const char **)&v207, 1u, 50.0);
v56 = (void *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v172 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v173 = __ldaxr(v172);
while ( __stlxr(v173 - 1, v172) );
}
else
{
v173 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v173 - 1;
}
if ( v173 <= 0 )
operator delete(v56);
}
v57 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Next Free",
(const char *)&dword_30 + 2,
0,
1,
0.7,
"goldFont.fnt",
"GJ_button_04.png",
v55,
25.0);
v216.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v216.adj = (size_t)SetGroupIDLayer::onNextGroupID1;
v58 = CCMenuItemSpriteExtra::create(v57, nullptr, v216);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v58);
v59 = a1->m_buttonMenu;
v60 = v58->setPosition;
v61 = a1->m_groupIDInput->getPosition(a1->m_groupIDInput);
cocos2d::CCPoint::CCPoint(&v206, (float)(v195 * 0.5) + -125.0, v61->y);
v209 = cocos2d::CCNode::convertToNodeSpace(v59, &v206);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v60)(v58, &v207, v209.x, v209.y);
v63 = 0.0;
if ( a2 )
v63 = -20.0;
v64 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Add",
(const char *)&dword_30 + 2,
0,
1,
0.7,
"goldFont.fnt",
"GJ_button_04.png",
v62,
25.0);
v217.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v217.adj = (size_t)SetGroupIDLayer::onAddGroup;
v65 = CCMenuItemSpriteExtra::create(v64, nullptr, v217);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v65);
v179 = a1->m_buttonMenu;
v66 = v65->setPosition;
v67 = a1->m_groupIDInput->getPosition(a1->m_groupIDInput);
cocos2d::CCPoint::CCPoint(&v206, v63 + (float)((float)(v195 * 0.5) + 125.0), v67->y);
v210 = cocos2d::CCNode::convertToNodeSpace(v179, &v206);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v66)(v65, &v207, v210.x, v210.y);
if ( a2 )
{
v69 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"P",
(const char *)&dword_30 + 2,
0,
0,
0.7,
"goldFont.fnt",
"GJ_button_04.png",
v68,
25.0);
v218.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v218.adj = (size_t)SetGroupIDLayer::onAddGroupParent;
v70 = CCMenuItemSpriteExtra::create(v69, nullptr, v218);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v70);
v71 = v65;
getPosition = v65->getPosition;
v73 = v70->setPosition;
v74 = (__int64)getPosition(v71);
cocos2d::CCPoint::CCPoint(&v206, 60.0, 0.0);
cocos2d::CCPoint::operator+(&v207, v74, &v206);
v73(v70, &v207.origin);
}
v75 = (__int64)v26->getPosition(v26);
cocos2d::CCPoint::CCPoint(&v205, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v206, v75, &v205);
sub_D153B8((int)&v207, "Z");
a1->m_zOrderInput = SetGroupIDLayer::createTextInput((__int64)a1, &v206, 7u, 6, (const char **)&v207, 2u, 50.0);
v76 = (cocos2d::CCArray *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v168 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v169 = __ldaxr(v168);
while ( __stlxr(v169 - 1, v168) );
}
else
{
v169 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v169 - 1;
}
if ( v169 <= 0 )
operator delete(v76);
}
v78 = (cocos2d::CCArray *)cocos2d::CCArray::create(v76);
v79 = 0;
v80 = -5;
v81 = "B5";
while ( 1 )
{
++v79;
v82 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)v81,
(const char *)&qword_D8 + 4,
0,
0,
0.3,
"bigFont.fnt",
"GJ_button_04.png",
v77,
25.0);
cocos2d::CCArray::addObject(a1->m_zLayerButtons, v82);
v219.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v219.adj = (size_t)SetGroupIDLayer::onZLayer;
v83 = CCMenuItemSpriteExtra::create(v82, nullptr, v219);
v83->setTag(v83, v80);
v82->setTag(v82, v80);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v83);
cocos2d::CCArray::addObject(v78, v83);
if ( v79 == 10 )
break;
switch ( v79 )
{
case 1:
v80 = -3;
v81 = "B4";
break;
case 2:
v80 = -1;
v81 = "B3";
break;
case 3:
v80 = 1;
v81 = "B2";
break;
case 4:
v80 = 3;
v81 = "B1";
break;
case 5:
v80 = 5;
v81 = "T1";
break;
case 6:
v80 = 7;
v81 = "T2";
break;
case 7:
v80 = 9;
v81 = "T3";
break;
case 8:
v80 = 11;
v81 = "T4";
break;
default:
v80 = 0;
v81 = "Default";
break;
}
}
v113 = a1->m_buttonMenu;
v114 = (__int64)v181->getPosition(v181);
cocos2d::CCPoint::CCPoint(&v205, 0.0, -28.0);
cocos2d::CCPoint::operator+(&v206, v114, &v205);
LODWORD(v227.x) = COERCE_UNSIGNED_INT(cocos2d::CCNode::convertToNodeSpace(v113, &v206).y);
GameToolbox::alignItemsHorisontally(v78, 5.0, v227, (bool)&v207);
SetGroupIDLayer::determineStartValues(a1);
if ( a1->m_zLayerValue == -100 )
{
m_targetObjects = a1->m_targetObjects;
if ( m_targetObjects )
{
if ( (unsigned int)cocos2d::CCArray::count(m_targetObjects) )
{
v144 = 0;
v145 = &byte_F10E40;
while ( 1 )
{
sub_D153B8((int)&v204, v145);
v146 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_colorBtn_001.png");
v147 = (const cocos2d::ccColor3B *)&unk_EFB8D8;
if ( v144 )
v147 = (const cocos2d::ccColor3B *)&unk_EFB8E0;
v146->setColor(v146, v147);
v146->setOpacity(v146, 100);
v148 = cocos2d::CCLabelBMFont::create();
v146->addChild(v146, v148);
v148->setScale(v148, 1.4);
v149 = v148->setPosition;
cocos2d::CCNode::convertToNodeSpace(v146, &stru_1243AA8);
cocos2d::CCPoint::CCPoint(&v206, 2.0, 2.5);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
v149(v148, &v207.origin);
v146->setScale(v146, 0.3);
v226.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v226.adj = (size_t)SetGroupIDLayer::onZLayerShift;
v150 = CCMenuItemSpriteExtra::create(v146, nullptr, v226);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v150);
v150->setTag(v150, v144);
v151 = a1->m_buttonMenu;
v152 = v150->setPosition;
v153 = (__int64)v181->getPosition(v181);
if ( v144 )
v154 = 40.0;
else
v154 = -40.0;
cocos2d::CCPoint::CCPoint(&v205, v154, -2.0);
cocos2d::CCPoint::operator+(&v206, v153, &v205);
v211 = cocos2d::CCNode::convertToNodeSpace(v151, &v206);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v152)(
v150,
&v207,
v211.x,
v211.y);
CCMenuItemSpriteExtra::setSizeMult(v150, 2.0);
v155 = (void *)(*(_QWORD *)&v204 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v204 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v170 = (unsigned int *)(*(_QWORD *)&v204 - 8LL);
do
v171 = __ldaxr(v170);
while ( __stlxr(v171 - 1, v170) );
}
else
{
v171 = *(_DWORD *)(*(_QWORD *)&v204 - 8LL);
*(_DWORD *)(*(_QWORD *)&v204 - 8LL) = v171 - 1;
}
if ( v171 <= 0 )
operator delete(v155);
}
v145 = "+";
if ( v144 )
break;
v144 = 1;
}
m_targetObject = a1->m_targetObject;
v116 = 55.0;
if ( !m_targetObject )
goto LABEL_91;
LABEL_70:
ParentMode = GameObject::getParentMode(m_targetObject);
goto LABEL_71;
}
}
}
m_targetObject = a1->m_targetObject;
v116 = 40.0;
if ( m_targetObject )
goto LABEL_70;
LABEL_91:
v156 = a1->m_targetObjects;
if ( !v156 )
goto LABEL_80;
v157 = 0;
ParentMode = -1;
while ( v157 < (unsigned int)cocos2d::CCArray::count(v156) )
{
v159 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, v157);
if ( ParentMode == -1 )
{
v158 = GameObject::getParentMode(v159);
}
else
{
v158 = GameObject::getParentMode(v159);
if ( ParentMode != v158 )
goto LABEL_80;
}
v156 = a1->m_targetObjects;
++v157;
ParentMode = v158;
}
LABEL_71:
if ( ParentMode != -1 )
{
v118 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"(%i)",
(const char *)ParentMode);
CString = (char *)cocos2d::CCString::getCString(v118);
goto LABEL_73;
}
LABEL_80:
CString = "(-)";
LABEL_73:
sub_D153B8((int)&v198, CString);
v120 = cocos2d::CCLabelBMFont::create();
v121 = v120->setPosition;
v122 = (__int64)v181->getPosition(v181);
cocos2d::CCPoint::CCPoint(&v206, v116, -2.0);
cocos2d::CCPoint::operator+(&v207, v122, &v206);
v121(v120, &v207.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v120);
v120->setScale(v120, 0.6);
v120->setColor(v120, (const cocos2d::ccColor3B *)&unk_EFB8E8);
if ( a1->m_showChannelOrder )
{
cocos2d::CCPoint::CCPoint(&v203, (float)(v195 * 0.5) + -125.0, (float)((float)(v196 * 0.5) + -155.0) + 25.0);
cocos2d::CCPoint::CCPoint(&v204, (float)(v195 * 0.5) + 125.0, v203.y);
cocos2d::CCPoint::CCPoint(&v207.origin, &v203);
sub_D153B8((int)&v199, "ORD");
a1->m_orderInput = SetGroupIDLayer::createTextInput((__int64)a1, &v207.origin, 3u, 6, &v199, 2u, 50.0);
v123 = (char *)(v199 - 24);
if ( v199 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v174 = (unsigned int *)(v199 - 8);
do
v175 = __ldaxr(v174);
while ( __stlxr(v175 - 1, v174) );
}
else
{
v175 = *((_DWORD *)v199 - 2);
*((_DWORD *)v199 - 2) = v175 - 1;
}
if ( v175 <= 0 )
operator delete(v123);
}
SetGroupIDLayer::updateEditorOrderLabel(a1);
cocos2d::CCPoint::CCPoint(&v206, &v204);
sub_D153B8((int)&v207, "CH");
a1->m_channelInput = SetGroupIDLayer::createTextInput((__int64)a1, &v206, 4u, 6, (const char **)&v207, 2u, 50.0);
v124 = (void *)(*(_QWORD *)&v207.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v207.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v176 = (unsigned int *)(*(_QWORD *)&v207.origin - 8LL);
do
v177 = __ldaxr(v176);
while ( __stlxr(v177 - 1, v176) );
}
else
{
v177 = *(_DWORD *)(*(_QWORD *)&v207.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v207.origin - 8LL) = v177 - 1;
}
if ( v177 <= 0 )
operator delete(v124);
}
SetGroupIDLayer::updateOrderChannelLabel(a1);
v125 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plus2Btn_001.png");
v125->setScale(v125, 0.8);
v220.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v220.adj = (size_t)SetGroupIDLayer::onNextFreeOrderChannel;
v126 = CCMenuItemSpriteExtra::create(v125, nullptr, v220);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v126);
v127 = v126->setPosition;
cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v204);
cocos2d::CCPoint::CCPoint(&v206, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
v127(v126, &v207.origin);
}
SetGroupIDLayer::updateGroupIDLabel(a1);
SetGroupIDLayer::updateEditorLabel(a1);
SetGroupIDLayer::updateEditorLabel2(a1);
SetGroupIDLayer::updateZOrderLabel(a1);
SetGroupIDLayer::updateZLayerButtons(a1);
SetGroupIDLayer::updateGroupIDButtons(a1);
v128 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v207.origin, (float)(v195 * 0.5) + 217.0, (float)(v196 * 0.5) + 142.0);
cocos2d::CCNode::convertToNodeSpace(v128, &v207.origin);
v193 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Copy",
(const char *)&dword_14,
0,
1,
0.5,
"goldFont.fnt",
"GJ_button_04.png",
v129,
25.0);
v131 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Paste",
(const char *)&dword_14,
0,
1,
0.5,
"goldFont.fnt",
"GJ_button_04.png",
v130,
25.0);
v133 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Extra",
(const char *)&dword_14,
0,
1,
0.5,
"goldFont.fnt",
"GJ_button_04.png",
v132,
25.0);
v135 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Extra2",
(const char *)&dword_14,
0,
1,
0.5,
"goldFont.fnt",
"GJ_button_04.png",
v134,
25.0);
v137 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Anim",
(const char *)&dword_14,
0,
1,
0.5,
"goldFont.fnt",
"GJ_button_04.png",
v136,
25.0);
v221.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v221.adj = (size_t)SetGroupIDLayer::onCopy;
v194 = CCMenuItemSpriteExtra::create(v193, nullptr, v221);
v222.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v222.adj = (size_t)SetGroupIDLayer::onPaste;
v138 = CCMenuItemSpriteExtra::create(v131, nullptr, v222);
v223.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v223.adj = (size_t)SetGroupIDLayer::onExtra;
v139 = CCMenuItemSpriteExtra::create(v133, nullptr, v223);
v224.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v224.adj = (size_t)SetGroupIDLayer::onExtra2;
v140 = CCMenuItemSpriteExtra::create(v135, nullptr, v224);
v225.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v225.adj = (size_t)SetGroupIDLayer::onAnim;
v141 = CCMenuItemSpriteExtra::create(v137, nullptr, v225);
if ( a2 )
{
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v194);
v194->setPosition(v194, &v200);
LABEL_21:
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v138);
cocos2d::CCPoint::CCPoint(&v205, &v200);
if ( a2 )
{
cocos2d::CCPoint::CCPoint(&v206, 0.0, -31.0);
cocos2d::CCPoint::operator+(&v207, &v205, &v206);
cocos2d::CCPoint::operator=(&v205, v84, v85);
}
v138->setPosition(v138, &v205);
goto LABEL_24;
}
v142 = GameManager::sharedState();
if ( LevelEditorLayer::canPasteState(v142->m_levelEditorLayer) )
goto LABEL_21;
LABEL_24:
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v139);
v86 = v139->setPosition;
cocos2d::CCPoint::CCPoint(&v206, 0.0, -62.0);
cocos2d::CCPoint::operator+(&v207, &v200, &v206);
v86(v139, &v207.origin);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v140);
v87 = v140->setPosition;
cocos2d::CCPoint::CCPoint(&v206, 0.0, -93.0);
cocos2d::CCPoint::operator+(&v207, &v200, &v206);
v87(v140, &v207.origin);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v141);
v88 = v141->setPosition;
cocos2d::CCPoint::CCPoint(&v206, 0.0, -124.0);
cocos2d::CCPoint::operator+(&v207, &v200, &v206);
v88(v141, &v207.origin);
cocos2d::CCPoint::CCPoint(&v201, 0.0, 2.0);
cocos2d::CCPoint::CCPoint(&v202, (float)(v195 * 0.5) + 217.0, (float)((float)(v196 * 0.5) + 142.0) - 164.0);
if ( a2 )
{
if ( a2->m_classType == Effect && GameManager::sharedState()->m_levelEditorLayer )
{
sub_D153B8((int)&v203, "Preview");
v89 = a1->m_buttonMenu;
m_pobTexture = (char)a2[1].m_pobTexture;
cocos2d::CCPoint::CCPoint(&v205, 0.0, -0.0);
cocos2d::CCPoint::operator+(&v206, &v202, &v205);
cocos2d::CCPoint::CCPoint(&v207.origin, &v201);
GameToolbox::createToggleButton(
0.7,
0.3,
80.0,
(__int64)&v203,
(void (__cdecl *)(cocos2d::CCObject *))SetGroupIDLayer::onToggleGuide,
0,
m_pobTexture,
v89,
&v206,
a1,
a1,
(float *)&v207.origin,
(__int64)"goldFont.fnt",
1,
0,
nullptr);
v91 = (void *)(*(_QWORD *)&v203 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v203 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v92 = (unsigned int *)(*(_QWORD *)&v203 - 8LL);
do
v93 = __ldaxr(v92);
while ( __stlxr(v93 - 1, v92) );
}
else
{
v93 = *(_DWORD *)(*(_QWORD *)&v203 - 8LL);
*(_DWORD *)(*(_QWORD *)&v203 - 8LL) = v93 - 1;
}
if ( v93 <= 0 )
operator delete(v91);
}
m_playbackObject = GameManager::sharedState()->m_levelEditorLayer->m_playbackObject;
sub_D153B8((int)&v204, "Playback");
v95 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v205, 0.0, -38.0);
cocos2d::CCPoint::operator+(&v206, &v202, &v205);
cocos2d::CCPoint::CCPoint(&v207.origin, &v201);
GameToolbox::createToggleButton(
0.7,
0.3,
80.0,
(__int64)&v204,
(void (__cdecl *)(cocos2d::CCObject *))SetGroupIDLayer::onToggleSelectedOrder,
0,
a2 == m_playbackObject,
v95,
&v206,
a1,
a1,
(float *)&v207.origin,
(__int64)"goldFont.fnt",
1,
0,
nullptr);
v96 = (void *)(*(_QWORD *)&v204 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v204 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v97 = (unsigned int *)(*(_QWORD *)&v204 - 8LL);
do
v98 = __ldaxr(v97);
while ( __stlxr(v98 - 1, v97) );
}
else
{
v98 = *(_DWORD *)(*(_QWORD *)&v204 - 8LL);
*(_DWORD *)(*(_QWORD *)&v204 - 8LL) = v98 - 1;
}
if ( v98 <= 0 )
operator delete(v96);
}
m_traceOutObject = GameManager::sharedState()->m_levelEditorLayer->m_traceOutObject;
sub_D153B8((int)&v205, "Trace Out");
v100 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v204, 0.0, -76.0);
cocos2d::CCPoint::operator+(&v206, &v202, &v204);
cocos2d::CCPoint::CCPoint(&v207.origin, &v201);
GameToolbox::createToggleButton(
0.7,
0.3,
80.0,
(__int64)&v205,
(void (__cdecl *)(cocos2d::CCObject *))SetGroupIDLayer::onToggleTraceOut,
0,
a2 == m_traceOutObject,
v100,
&v206,
a1,
a1,
(float *)&v207.origin,
(__int64)"goldFont.fnt",
1,
0,
nullptr);
v101 = (void *)(*(_QWORD *)&v205 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v205 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v102 = (unsigned int *)(*(_QWORD *)&v205 - 8LL);
do
v103 = __ldaxr(v102);
while ( __stlxr(v103 - 1, v102) );
}
else
{
v103 = *(_DWORD *)(*(_QWORD *)&v205 - 8LL);
*(_DWORD *)(*(_QWORD *)&v205 - 8LL) = v103 - 1;
}
if ( v103 <= 0 )
operator delete(v101);
}
}
if ( GameManager::sharedState()->m_levelEditorLayer )
{
m_traceInObject = GameManager::sharedState()->m_levelEditorLayer->m_traceInObject;
sub_D153B8((int)&v206, "Trace In");
v105 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v204, 0.0, -114.0);
cocos2d::CCPoint::operator+(&v205, &v202, &v204);
cocos2d::CCPoint::CCPoint(&v207.origin, &v201);
GameToolbox::createToggleButton(
0.7,
0.3,
80.0,
(__int64)&v206,
(void (__cdecl *)(cocos2d::CCObject *))SetGroupIDLayer::onToggleTraceIn,
0,
a2 == m_traceInObject,
v105,
&v205,
a1,
a1,
(float *)&v207.origin,
(__int64)"goldFont.fnt",
1,
0,
nullptr);
v106 = (void *)(*(_QWORD *)&v206 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v206 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v107 = (unsigned int *)(*(_QWORD *)&v206 - 8LL);
do
v108 = __ldaxr(v107);
while ( __stlxr(v108 - 1, v107) );
}
else
{
v108 = *(_DWORD *)(*(_QWORD *)&v206 - 8LL);
*(_DWORD *)(*(_QWORD *)&v206 - 8LL) = v108 - 1;
}
if ( v108 <= 0 )
operator delete(v106);
}
}
}
a1->m_editorLayerEdited = 0;
p_m_pTargetArray = &v198[-1].m_pTargetArray;
if ( &v198[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_nExtraKerning = (unsigned int *)&v198[-1].m_nExtraKerning;
do
m_nExtraKerning = __ldaxr(p_m_nExtraKerning);
while ( __stlxr(m_nExtraKerning - 1, p_m_nExtraKerning) );
}
else
{
m_nExtraKerning = v198[-1].m_nExtraKerning;
v198[-1].m_nExtraKerning = m_nExtraKerning - 1;
}
if ( m_nExtraKerning <= 0 )
operator delete(p_m_pTargetArray);
}
return v178;
}