// // ColorSelectPopup::init from 0x73d208 to 0x73f9f8 (10224 bytes) // // 2 xrefs: // > ColorSelectPopup::create @ 0x73fccc // > @ 0x96858 // // 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 ColorSelectPopup::init(ColorSelectPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3, ColorAction *a4) { cocos2d::CCArray *v6; // x0 cocos2d::CCArray *v7; // x0 _BOOL4 v8; // w24 cocos2d::CCArray *v9; // x0 cocos2d::CCArray *v10; // x0 ColorSelectPopup_vtbl *v11; // x1 cocos2d::CCDirector *v12; // x0 cocos2d::extension::CCControlColourPicker *m_gameObject; // x0 cocos2d::extension::CCControlColourPicker *v14; // x0 cocos2d::extension::CCControlColourPicker *m_colorPicker; // x22 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 float v17; // s1 cocos2d::CCLabelBMFont *v18; // x22 void (__fastcall *v19)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23 const char *v20; // x6 cocos2d::CCNode *v21; // x0 CCMenuItemSpriteExtra *v22; // x0 float v23; // s0 cocos2d::CCLabelBMFont *v24; // x26 void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCNode *v26; // x26 void (__fastcall *v27)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 const char *v28; // x0 CCTextInputNode *v29; // x0 CCTextInputNode *m_fadeTimeInput; // x27 cocos2d::CCNode *v31; // x0 const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1 void (__fastcall *v33)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26 __int64 v34; // x0 CCTextInputNode *v35; // x26 void *v36; // x0 Slider *v37; // x0 Slider *m_fadeTimeSlider; // x26 void (__fastcall *v39)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 float v40; // s0 SliderThumb *Thumb; // x0 const char *v43; // x6 cocos2d::CCNode *v44; // x28 const char *v45; // x6 cocos2d::CCNode *v46; // x27 const char *v47; // x6 cocos2d::CCNode *v48; // x26 CCMenuItemSpriteExtra *v49; // x25 CCMenuItemSpriteExtra *v50; // x21 CCMenuItemSpriteExtra *v51; // x26 cocos2d::CCMenu *m_buttonMenu; // x28 void (__fastcall *v53)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 void (__fastcall *v54)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 __int64 v55; // x28 CCMenuItemSpriteExtra *v56; // x0 const cocos2d::CCPoint *(__fastcall *v57)(cocos2d::CCNode *__hidden); // x1 void (__fastcall *v58)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21 __int64 v59; // x25 cocos2d::CCSprite *v60; // x0 cocos2d::CCSprite_vtbl *v61; // x1 cocos2d::CCSprite *m_currentColorSprite; // x24 void (__fastcall *v63)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25 float width; // s8 cocos2d::CCSprite *v65; // x0 cocos2d::CCSprite_vtbl *v66; // x1 cocos2d::CCSprite *m_originalColorSprite; // x21 void (__fastcall *v68)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24 const cocos2d::CCPoint *v69; // x25 float v70; // s1 ConfigureHSVWidget *v71; // x0 ColorSelectPopup_vtbl *v72; // x2 ConfigureHSVWidget *m_hsvWidget; // x21 void (__fastcall *v74)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25 cocos2d::CCLabelBMFont *v75; // x21 cocos2d::CCNode *v76; // x21 int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // x2 CCTextInputNode *v78; // x0 CCTextInputNode *m_copyColorInput; // x21 char *v80; // x1 void *v81; // x0 CCTextInputNode *v82; // x0 cocos2d::CCArray *m_copyObjects; // x0 CCTextInputNode *v84; // x1 cocos2d::CCSprite *v85; // x26 CCMenuItemSpriteExtra *v86; // x26 cocos2d::CCSprite *v87; // x26 CCMenuItemSpriteExtra *v88; // x26 void (__fastcall *v89)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCSprite *v90; // x0 CCMenuItemSpriteExtra *v91; // x26 CCMenuItemSpriteExtra_vtbl *v92; // x1 void (__fastcall *v93)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCNode *v94; // x24 void *v95; // x0 void *v96; // x0 cocos2d::CCMenu *v97; // x2 int v98; // w27 int v99; // w26 cocos2d::CCMenu *v100; // x1 float v101; // s2 CCTextInputNode *v102; // x24 int v103; // w0 char *v104; // x1 void *v105; // x0 cocos2d::CCArray *m_colorObjects; // x0 CCTextInputNode_vtbl *v107; // x2 cocos2d::CCLabelBMFont *v108; // x24 void (__fastcall *v109)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22 cocos2d::CCNode *v110; // x24 int (__fastcall *v111)(const cocos2d::CCObject *__hidden); // x2 float v112; // s0 cocos2d::CCLabelBMFont *v113; // x21 void (__fastcall *v114)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25 cocos2d::CCNode *v115; // x21 CCTextInputNode *v116; // x0 CCTextInputNode *m_colorInput; // x21 char *v118; // x1 void *v119; // x0 cocos2d::CCMenu *v120; // x0 cocos2d::CCSprite *v121; // x0 CCMenuItemSpriteExtra *v122; // x25 CCMenuItemSpriteExtra_vtbl *v123; // x1 void (__fastcall *v124)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCSprite *v125; // x25 CCMenuItemSpriteExtra *v126; // x25 void (__fastcall *v127)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCSprite *v128; // x25 CCMenuItemSpriteExtra *v129; // x24 void (__fastcall *v130)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25 _BOOL4 v131; // w28 void *v132; // x0 _BOOL4 v133; // w28 void *v134; // x0 _BOOL4 m_tintGround; // w28 void *v136; // x0 _BOOL4 v137; // w28 void *v138; // x0 float v139; // s0 float v140; // s1 _BOOL4 v141; // w28 void *v142; // x0 float v143; // s0 float v144; // s1 _BOOL4 m_touchTriggered; // w26 void *v146; // x0 _BOOL4 m_spawnTriggered; // w26 void *v148; // x0 bool m_multiTriggered; // w27 cocos2d::CCMenu *v150; // x26 cocos2d::CCLayer *m_mainLayer; // x25 cocos2d::CCArray *m_multiTriggerContainer; // x1 void *v153; // x0 unsigned int *v154; // x1 int v155; // w2 cocos2d::CCSprite *v156; // x26 cocos2d::CCSprite *v157; // x24 CCMenuItemToggler *v158; // x24 void (__fastcall *v159)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCLabelBMFont *v160; // x24 void (__fastcall *v161)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x27 cocos2d::CCSprite *v162; // x0 const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x1 void (__fastcall *v164)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26 float *v165; // x0 cocos2d::CCMenu *v166; // x27 cocos2d::CCLayer *v167; // x25 CCMenuItemToggler *v168; // x21 void *v169; // x0 cocos2d::CCNode *v170; // x24 cocos2d::CCLabelBMFont *v171; // x0 cocos2d::CCLabelBMFont *m_opacityLabel; // x21 void (__fastcall *v173)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25 Slider *v174; // x0 Slider *m_opacitySlider; // x21 void (__fastcall *v176)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25 const cocos2d::CCPoint *v177; // x26 SliderThumb *v178; // x0 unsigned int *v179; // x1 int v180; // w2 unsigned int *v181; // x1 int v182; // w2 unsigned int *v183; // x1 int v184; // w2 unsigned int *v185; // x1 int v186; // w2 unsigned int *v187; // x1 int v188; // w2 unsigned int *v189; // x1 int v190; // w2 unsigned int *v191; // x1 int v192; // w2 unsigned int *v193; // x1 int v194; // w2 unsigned int *v195; // x1 int v196; // w2 unsigned int *v197; // x1 int v198; // w2 unsigned int *v199; // x1 int v200; // w2 unsigned int *v201; // x1 int v202; // w2 unsigned int *v203; // x1 int v204; // w2 unsigned int *v205; // x1 int v206; // w2 float v207; // s0 float v208; // s1 __int64 v209; // [xsp+30h] [xbp+0h] BYREF cocos2d::CCNode *v210; // [xsp+D0h] [xbp+A0h] bool v211; // [xsp+DFh] [xbp+AFh] cocos2d::CCRect *v212; // [xsp+E0h] [xbp+B0h] cocos2d::CCNode *v213; // [xsp+E8h] [xbp+B8h] char *v214; // [xsp+F0h] [xbp+C0h] const char *v215; // [xsp+F8h] [xbp+C8h] char *v216; // [xsp+100h] [xbp+D0h] _QWORD *v217; // [xsp+108h] [xbp+D8h] cocos2d::CCNode *v218; // [xsp+110h] [xbp+E0h] char *v219; // [xsp+118h] [xbp+E8h] const char *v220; // [xsp+120h] [xbp+F0h] __int64 (__fastcall **v221)(int, int, int, int, int, int, int, int, char); // [xsp+128h] [xbp+F8h] char v222; // [xsp+130h] [xbp+100h] BYREF __int64 v223; // [xsp+138h] [xbp+108h] __int64 v224; // [xsp+140h] [xbp+110h] __int64 v225; // [xsp+148h] [xbp+118h] _BYTE v226[8]; // [xsp+150h] [xbp+120h] BYREF float v227; // [xsp+158h] [xbp+128h] float v228; // [xsp+15Ch] [xbp+12Ch] cocos2d::CCPoint v229; // [xsp+160h] [xbp+130h] BYREF cocos2d::CCPoint v230; // [xsp+168h] [xbp+138h] BYREF cocos2d::CCPoint v231; // [xsp+170h] [xbp+140h] BYREF cocos2d::CCPoint v232; // [xsp+178h] [xbp+148h] BYREF cocos2d::CCPoint v233; // [xsp+180h] [xbp+150h] BYREF cocos2d::CCSize v234; // [xsp+188h] [xbp+158h] BYREF cocos2d::CCPoint v235; // [xsp+190h] [xbp+160h] BYREF cocos2d::CCPoint v236; // [xsp+198h] [xbp+168h] BYREF cocos2d::CCPoint v237; // [xsp+1A0h] [xbp+170h] BYREF cocos2d::CCRect v238; // [xsp+1A8h] [xbp+178h] BYREF cocos2d::CCRect v239; // [xsp+1B8h] [xbp+188h] BYREF std::string v240; // 0:x2.8 cocos2d::CCPoint v241; // 0:kr08_8.8 cocos2d::CCPoint v242; // 0:kr18_8.8 cocos2d::CCPoint v243; // 0:kr20_8.8 cocos2d::CCPoint v244; // 0:kr30_8.8 cocos2d::CCPoint v245; // 0:kr38_8.8 cocos2d::SEL_MenuHandler v246; // 0:x2.16 cocos2d::SEL_MenuHandler v247; // 0:x2.16 cocos2d::SEL_MenuHandler v248; // 0:x2.16 cocos2d::SEL_MenuHandler v249; // 0:x2.16 cocos2d::SEL_MenuHandler v250; // 0:x2.16 cocos2d::SEL_MenuHandler v251; // 0:x2.16 cocos2d::SEL_MenuHandler v252; // 0:x2.16 cocos2d::SEL_MenuHandler v253; // 0:x2.16 cocos2d::SEL_MenuHandler v254; // 0:x2.16 cocos2d::SEL_MenuHandler v255; // 0:x2.16 cocos2d::SEL_MenuHandler v256; // 0:x3.16 cocos2d::CCRect v257; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v258; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v259; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 cocos2d::CCRect v260; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4 v211 = SetupTriggerPopup::init(a1, a2, a3, 450.0, 300.0, 1); v6 = (cocos2d::CCArray *)v211; if ( !v211 ) return v211; if ( a4 ) { a1->m_colorAction = a4; cocos2d::CCObject::retain(a4); } v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(v6); a1->m_colorObjects = v7; v8 = 1; cocos2d::CCObject::retain(v7); v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9); a1->m_copyObjects = v10; cocos2d::CCObject::retain(v10); v11 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_initializing = 1; v11->determineStartValues(a1); a1->setOpacity(a1, 4294967240LL); v12 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(v12); m_gameObject = (cocos2d::extension::CCControlColourPicker *)a1->m_gameObject; if ( !m_gameObject ) { m_gameObject = (cocos2d::extension::CCControlColourPicker *)a1->m_gameObjects; v8 = m_gameObject != nullptr; } v14 = (cocos2d::extension::CCControlColourPicker *)cocos2d::extension::CCControlColourPicker::create(m_gameObject); a1->m_colorPicker = v14; v14->m_delegate = &a1->cocos2d::extension::ColorPickerDelegate; a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_colorPicker, 10); m_colorPicker = a1->m_colorPicker; setPosition = m_colorPicker->setPosition; if ( v8 ) v17 = 36.0; else v17 = 20.0; cocos2d::CCPoint::CCPoint(&v239.origin, v227 * 0.5, (float)(v228 * 0.5) + v17); setPosition(m_colorPicker, &v239.origin); cocos2d::CCArray::addObject(a1->m_colorObjects, a1->m_colorPicker); v18 = cocos2d::CCLabelBMFont::create(); v18->setScale(v18, 0.9); a1->m_mainLayer->addChild(a1->m_mainLayer, v18); v19 = v18->setPosition; cocos2d::CCPoint::CCPoint(&v239.origin, v227 * 0.5, (float)(v228 * 0.5) + 135.0); v19(v18, &v239.origin); v21 = (cocos2d::CCNode *)ButtonSprite::create( (ButtonSprite *)"OK", (const char *)&qword_28, 0, 1, 0.8, "goldFont.fnt", "GJ_button_01.png", v20, 30.0); v246.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v246.adj = (size_t)ColorSelectPopup::closeColorSelect; v22 = CCMenuItemSpriteExtra::create(v21, nullptr, v246); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22); a1->m_joystickConnected = -1; if ( !v8 || a1->m_noChannel ) { v221 = &jpeg_idct_9x9_ptr; } else { v23 = 0.0; if ( a1->m_newColorTrigger ) v23 = -10.0; cocos2d::CCPoint::CCPoint(&v235, (float)(v227 * 0.5) + v23, (float)(v228 * 0.5) + -68.0); v24 = cocos2d::CCLabelBMFont::create(); v24->setScale(v24, 0.7); v24->setPosition(v24, &v235); setAnchorPoint = v24->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v239.origin, 1.0, 0.5); setAnchorPoint(v24, &v239.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v24); cocos2d::CCRect::CCRect(&v238, 0.0, 0.0, 40.0, 40.0); cocos2d::CCRect::CCRect(&v239, &v238); v26 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02_small.png", (const char *)&v239, v257); ((void (__fastcall *)(cocos2d::CCNode *, __int64))v26->__vftable[1].~CCNode_0)(v26, 100); cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v236, 70.0, 30.0); v26->setContentSize(v26, (const cocos2d::CCSize *)&v236); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v26, -1); v27 = v26->setPosition; cocos2d::CCPoint::CCPoint(&v237, 45.0, 0.0); cocos2d::CCPoint::operator+(&v239, &v235, &v237); v27(v26, &v239.origin); if ( a1->m_fadeTime == -99999.0 ) v28 = "Mixed"; else v28 = "Num"; v29 = CCTextInputNode::create(50.0, 40.0, v28, "Thonburi"); a1->m_fadeTimeInput = v29; a1->m_mainLayer->addChild_0(a1->m_mainLayer, v29, 20); m_fadeTimeInput = a1->m_fadeTimeInput; v31 = v26; getPosition = v26->getPosition; v33 = m_fadeTimeInput->setPosition; v34 = (__int64)getPosition(v31); v33(m_fadeTimeInput, (const cocos2d::CCPoint *)v34); CCTextInputNode::setMaxLabelScale(a1->m_fadeTimeInput, 0.6); CCTextInputNode::setMaxLabelWidth(a1->m_fadeTimeInput, 200.0); a1->m_fadeTimeInput->m_textField->setVisible(a1->m_fadeTimeInput->m_textField, 0); v35 = a1->m_fadeTimeInput; v35->m_maxLabelLength = 5; sub_D153B8((int)&v239, "0123456789."); CCTextInputNode::setAllowedChars((__int64)v35, (__int64)&v239); v221 = &jpeg_idct_9x9_ptr; v36 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 *)(*(_QWORD *)&v239.origin - 24LL) != &qword_124B6B0 ) { if ( &pthread_create ) { v197 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v198 = __ldaxr(v197); while ( __stlxr(v198 - 1, v197) ); } else { v198 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v198 - 1; } if ( v198 <= 0 ) operator delete(v36); } LOWORD(v223) = -21896; BYTE2(v223) = -16; CCTextInputNode::setLabelPlaceholderColor(a1->m_fadeTimeInput, (cocos2d::ccColor3B)v223); CCTextInputNode::setLabelPlaceholderScale(a1->m_fadeTimeInput, 0.5); a1->m_fadeTimeInput->m_delegate = &a1->TextInputDelegate; a1->m_fadeTimeInput->setTag(a1->m_fadeTimeInput, 5); a1->m_fadeTimeInput->m_numberInput = 1; v37 = (Slider *)Slider::create(a1, (void (__cdecl *)(cocos2d::CCObject *))ColorSelectPopup::sliderChanged, 0, 0.8); a1->m_fadeTimeSlider = v37; Slider::setBarVisibility(v37, 0); a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_fadeTimeSlider); m_fadeTimeSlider = a1->m_fadeTimeSlider; v39 = m_fadeTimeSlider->setPosition; cocos2d::CCPoint::CCPoint(&v237, 0.0, -28.0); cocos2d::CCPoint::operator+(&v239, &v235, &v237); v39(m_fadeTimeSlider, &v239.origin); v40 = a1->m_fadeTime / 10.0; if ( v40 < 1.0 ) { if ( v40 <= 0.0 ) v40 = 0.0; } else { v40 = 1.0; } Slider::setValue(a1->m_fadeTimeSlider, v40); Thumb = Slider::getThumb(a1->m_fadeTimeSlider); Thumb->setTag(Thumb, 1); ColorSelectPopup::updateDurLabel(a1); } ColorSelectPopup::selectColor(a1, (cocos2d::ccColor3B)*(_QWORD *)&a1->m_currentColor.r); if ( a1->m_colorTrigger && !a1->m_noChannel ) { v171 = cocos2d::CCLabelBMFont::create(); a1->m_opacityLabel = v171; a1->m_mainLayer->addChild(a1->m_mainLayer, v171); a1->m_opacityLabel->setScale(a1->m_opacityLabel, 0.65); m_opacityLabel = a1->m_opacityLabel; v173 = m_opacityLabel->setPosition; cocos2d::CCPoint::CCPoint(&v239.origin, (float)(v227 * 0.5) + 150.0, (float)(v228 * 0.5) + -15.0); v173(m_opacityLabel, &v239.origin); v174 = (Slider *)Slider::create(a1, (void (__cdecl *)(cocos2d::CCObject *))ColorSelectPopup::sliderChanged, 0, 0.55); a1->m_opacitySlider = v174; Slider::setBarVisibility(v174, 0); a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_opacitySlider); m_opacitySlider = a1->m_opacitySlider; v176 = m_opacitySlider->setPosition; v177 = a1->m_opacityLabel->getPosition(a1->m_opacityLabel); cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, -20.0); cocos2d::CCPoint::operator+(&v239, v177, &v238); v176(m_opacitySlider, &v239.origin); v178 = Slider::getThumb(a1->m_opacitySlider); v178->setTag(v178, 2); ColorSelectPopup::updateOpacityLabel(a1); Slider::setValue(a1->m_opacitySlider, a1->m_opacity); } v44 = (cocos2d::CCNode *)ButtonSprite::create( (ButtonSprite *)"Copy", (const char *)&qword_28, 0, 1, 0.6, "goldFont.fnt", "GJ_button_04.png", v43, 30.0); v46 = (cocos2d::CCNode *)ButtonSprite::create( (ButtonSprite *)"Paste", (const char *)&qword_28, 0, 1, 0.6, "goldFont.fnt", "GJ_button_04.png", v45, 30.0); v48 = (cocos2d::CCNode *)ButtonSprite::create( (ButtonSprite *)"Default", (const char *)&qword_28, 0, 1, 0.6, "goldFont.fnt", "GJ_button_04.png", v47, 30.0); v247.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v247.adj = (size_t)ColorSelectPopup::onCopy; v49 = CCMenuItemSpriteExtra::create(v44, nullptr, v247); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v49); v248.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v248.adj = (size_t)ColorSelectPopup::onPaste; v50 = CCMenuItemSpriteExtra::create(v46, nullptr, v248); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v50); v249.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v249.adj = (size_t)ColorSelectPopup::onDefault; v51 = CCMenuItemSpriteExtra::create(v48, nullptr, v249); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v51); m_buttonMenu = a1->m_buttonMenu; v53 = v49->setPosition; cocos2d::CCPoint::CCPoint(&v238.origin, (float)(v227 * 0.5) + 190.0, (float)(v228 * 0.5) + 130.0); v241 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v238.origin); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v53)(v49, &v239, v241.x, v241.y); v54 = v50->setPosition; v55 = (__int64)v49->getPosition(v49); cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, -40.0); cocos2d::CCPoint::operator+(&v239, v55, &v238); v54(v50, &v239.origin); cocos2d::CCArray::addObject(a1->m_colorObjects, v49); cocos2d::CCArray::addObject(a1->m_colorObjects, v50); if ( v51 ) { v56 = v50; v57 = v50->getPosition; v58 = v51->setPosition; v59 = (__int64)v57(v56); cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, -40.0); cocos2d::CCPoint::operator+(&v239, v59, &v238); v58(v51, &v239.origin); cocos2d::CCArray::addObject(a1->m_colorObjects, v51); } cocos2d::CCPoint::CCPoint(&v229, (float)(v227 * 0.5) + 64.0, (float)(v228 * 0.5) + -130.0); cocos2d::CCPoint::CCPoint(&v230, (float)(v227 * 0.5) + -205.0, (float)(v228 * 0.5) + -90.0); if ( a1->m_noChannel ) { v220 = "icon_299"; } else { sub_D153B8((int)&v239, "Player\nColor 1"); v131 = a1->m_playerColor == 1; cocos2d::CCPoint::CCPoint(&v237, 0.0, -40.0); cocos2d::CCPoint::operator+(&v238, &v230, &v237); a1->m_playerColor1Toggle = (CCMenuItemToggler *)SetupTriggerPopup::createToggleButton( a1, &v239, ColorSelectPopup::onPlayerColor1, 0, v131, &v238); v132 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v193 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v194 = __ldaxr(v193); while ( __stlxr(v194 - 1, v193) ); } else { v194 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v194 - 1; } if ( v194 <= 0 ) operator delete(v132); } sub_D153B8((unsigned int)&v209 + 392, "Player\nColor 2"); v133 = a1->m_playerColor == 2; cocos2d::CCPoint::CCPoint(&v238.origin, (float)(v227 * 0.5) + -108.0, (float)(v228 * 0.5) + -130.0); a1->m_playerColor2Toggle = (CCMenuItemToggler *)SetupTriggerPopup::createToggleButton( a1, &v239, ColorSelectPopup::onPlayerColor2, 0, v133, &v238); v134 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v195 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v196 = __ldaxr(v195); while ( __stlxr(v196 - 1, v195) ); } else { v196 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v196 - 1; } if ( v196 <= 0 ) operator delete(v134); } if ( a1->m_backgroundTrigger ) { sub_D153B8((int)&v239, "Tint\nGround"); m_tintGround = a1->m_tintGround; cocos2d::CCPoint::CCPoint(&v237, 90.0, 40.0); cocos2d::CCPoint::operator+(&v238, &v229, &v237); SetupTriggerPopup::createToggleButton(a1, &v239, ColorSelectPopup::onTintGround, 0, m_tintGround, &v238); v136 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v185 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v186 = __ldaxr(v185); while ( __stlxr(v186 - 1, v185) ); } else { v186 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v186 - 1; } if ( v186 <= 0 ) operator delete(v136); } } cocos2d::CCPoint::CCPoint(&v239.origin, 0.0, -9.0); cocos2d::CCPoint::operator+(&v234, &v230, &v239); if ( a1->m_colorTrigger ) { sub_D153B8((int)&v238, "Blending"); v137 = a1->m_blending == 1; cocos2d::CCPoint::CCPoint(&v239.origin, (const cocos2d::CCPoint *)&v234); SetupTriggerPopup::createToggleButton(a1, &v238, ColorSelectPopup::onToggleTintMode, 0, v137, &v239); v138 = (void *)(*(_QWORD *)&v238.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v238.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v199 = (unsigned int *)(*(_QWORD *)&v238.origin - 8LL); do v200 = __ldaxr(v199); while ( __stlxr(v200 - 1, v199) ); } else { v200 = *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL) = v200 - 1; } if ( v200 <= 0 ) operator delete(v138); } cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, 30.0); cocos2d::CCPoint::operator+(&v239, &v234, &v238); cocos2d::CCPoint::operator=(&v234, v139, v140); } sub_D153B8((int)&v238, "Copy Color"); v141 = a1->m_copyColorID != 0; cocos2d::CCPoint::CCPoint(&v239.origin, (const cocos2d::CCPoint *)&v234); SetupTriggerPopup::createToggleButton(a1, &v238, ColorSelectPopup::onToggleHSVMode, 0, v141, &v239); v142 = (void *)(*(_QWORD *)&v238.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v238.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v191 = (unsigned int *)(*(_QWORD *)&v238.origin - 8LL); do v192 = __ldaxr(v191); while ( __stlxr(v192 - 1, v191) ); } else { v192 = *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL) = v192 - 1; } if ( v192 <= 0 ) operator delete(v142); } cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, 30.0); cocos2d::CCPoint::operator+(&v239, &v234, &v238); cocos2d::CCPoint::operator=(&v234, v143, v144); if ( v8 ) { sub_D153B8((int)&v238, "Touch\nTrigger"); m_touchTriggered = a1->m_touchTriggered; cocos2d::CCPoint::CCPoint(&v239.origin, &v229); a1->m_touchToggle = (CCMenuItemToggler *)SetupTriggerPopup::createToggleButton( a1, &v238, SetupTriggerPopup::onTouchTriggered, 0, m_touchTriggered, &v239); v146 = (void *)(*(_QWORD *)&v238.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v238.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v203 = (unsigned int *)(*(_QWORD *)&v238.origin - 8LL); do v204 = __ldaxr(v203); while ( __stlxr(v204 - 1, v203) ); } else { v204 = *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL) = v204 - 1; } if ( v204 <= 0 ) operator delete(v146); } sub_D153B8((int)&v239, "Spawn\nTrigger"); m_spawnTriggered = a1->m_spawnTriggered; cocos2d::CCPoint::CCPoint(&v237, 90.0, 0.0); cocos2d::CCPoint::operator+(&v238, &v229, &v237); a1->m_spawnToggle = (CCMenuItemToggler *)SetupTriggerPopup::createToggleButton( a1, &v239, SetupTriggerPopup::onSpawnedByTrigger, 0, m_spawnTriggered, &v238); v148 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v205 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v206 = __ldaxr(v205); while ( __stlxr(v206 - 1, v205) ); } else { v206 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v206 - 1; } if ( v206 <= 0 ) operator delete(v148); } sub_D153B8((int)&v238, "Multi\nTrigger"); m_multiTriggered = a1->m_multiTriggered; v150 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v239.origin, (const cocos2d::CCPoint *)&v234); m_mainLayer = a1->m_mainLayer; cocos2d::CCPoint::CCPoint(&v237, 8.0, 0.0); m_multiTriggerContainer = a1->m_multiTriggerContainer; v220 = "icon_299"; GameToolbox::createToggleButton( 0.7, 0.35, 110.0, (__int64)&v238, (void (__cdecl *)(cocos2d::CCObject *))SetupTriggerPopup::onMultiTrigger, 0, m_multiTriggered, v150, &v239.origin, a1, m_mainLayer, (float *)&v237, (__int64)"bigFont.fnt", 0, 0, m_multiTriggerContainer); v153 = (void *)(*(_QWORD *)&v238.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v238.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v201 = (unsigned int *)(*(_QWORD *)&v238.origin - 8LL); do v202 = __ldaxr(v201); while ( __stlxr(v202 - 1, v201) ); } else { v202 = *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v238.origin - 8LL) = v202 - 1; } if ( v202 <= 0 ) operator delete(v153); } SetupTriggerPopup::updateMultiTriggerBtn(a1); } else { v220 = "icon_299"; } cocos2d::CCPoint::CCPoint(&v235, (float)(v227 * 0.5) + 110.0, (float)(v228 * 0.5) + 18.0); v156 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png"); v157 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png"); v156->setScale(v156, 0.7); v157->setScale(v157, 0.7); v256.adj = 0; v256.ptr = (void (__cdecl *)(cocos2d::CCObject *))ColorSelectPopup::onCopyOpacity; v158 = CCMenuItemToggler::create(v156, v157, a1, v256); CCMenuItemToggler::toggle(v158, !a1->m_copyOpacity); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v158); v159 = v158->setPosition; v245 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v235); ((void (__fastcall *)(CCMenuItemToggler *, cocos2d::CCRect *, float, float))v159)(v158, &v239, v245.x, v245.y); CCMenuItemToggler::setSizeMult(v158, 1.5); cocos2d::CCArray::addObject(a1->m_copyObjects, v158); v160 = cocos2d::CCLabelBMFont::create(); a1->addChild(a1, v160); v161 = v160->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v239.origin, 0.0, 0.5); v161(v160, &v239.origin); v162 = v156; getContentSize = v156->getContentSize; v164 = v160->setPosition; v165 = (float *)getContentSize(v162); cocos2d::CCPoint::CCPoint(&v238.origin, (float)((float)(*v165 * 0.5) * 0.7) + 8.0, 0.0); cocos2d::CCPoint::operator+(&v239, &v235, &v238); v164(v160, &v239.origin); cocos2d::CCLabelBMFont::limitLabelWidth(v160, 110.0, 0.35, 0.0); cocos2d::CCArray::addObject(a1->m_copyObjects, v160); sub_D153B8((int)&v239, "Legacy\nHSV"); LOBYTE(v160) = !a1->m_legacyHSV; v166 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v236, 0.0, 100.0); cocos2d::CCPoint::operator+(&v237, &v235, &v236); v167 = a1->m_mainLayer; cocos2d::CCPoint::CCPoint(&v238.origin, 8.0, 0.0); v168 = GameToolbox::createToggleButton( 0.7, 0.3, 0.0, (__int64)&v239, (void (__cdecl *)(cocos2d::CCObject *))ColorSelectPopup::onHSVLegacyMode, 0, (bool)v160, v166, &v237, a1, v167, (float *)&v238.origin, (__int64)(v220 + 3272), 0, 111, nullptr); v169 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v187 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v188 = __ldaxr(v187); while ( __stlxr(v188 - 1, v187) ); } else { v188 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v188 - 1; } if ( v188 <= 0 ) operator delete(v169); } v170 = a1->m_mainLayer->getChildByTag(a1->m_mainLayer, 111); cocos2d::CCArray::addObject(a1->m_copyObjects, v168); if ( v170 ) cocos2d::CCArray::addObject(a1->m_copyObjects, v170); } v60 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png"); v61 = v60->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_currentColorSprite = v60; ((void (__fastcall *)(float))v61->setScale)(1.0); a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_currentColorSprite, 5); m_currentColorSprite = a1->m_currentColorSprite; v63 = m_currentColorSprite->setPosition; cocos2d::CCPoint::CCPoint(&v239.origin, (float)(v227 * 0.5) + -200.0, (float)(v228 * 0.5) + 125.0); v63(m_currentColorSprite, &v239.origin); width = a1->m_currentColorSprite->getContentSize(a1->m_currentColorSprite)->width; v65 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png"); v66 = v65->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_originalColorSprite = v65; ((void (__fastcall *)(float))v66->setScaleY)(0.5); a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_originalColorSprite, 5); m_originalColorSprite = a1->m_originalColorSprite; v68 = m_originalColorSprite->setPosition; v69 = a1->m_currentColorSprite->getPosition(a1->m_currentColorSprite); v70 = (float)((float)-width * 0.5) - (float)(width * 0.5) * 0.5; cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, v70); cocos2d::CCPoint::operator+(&v239, v69, &v238); v68(m_originalColorSprite, &v239.origin); cocos2d::CCArray::addObject(a1->m_colorObjects, a1->m_currentColorSprite); cocos2d::CCArray::addObject(a1->m_colorObjects, a1->m_originalColorSprite); if ( a1->m_newColorTrigger ) { v216 = "redBtn_001.png"; v215 = "&levelsInfo="; v214 = "redBtn_001.png"; v219 = " #endif\n\n varying vec4 v_fragmentColor;\n varying vec2 v_texCoord;\n uniform sampler2D u_texture;\n\n uniform vec3 u_lum;\n\n void main(void) {\n vec4 color = texture2D(u_texture, v_texCoord);\n float gray = dot(color.rgb * v_fragmentColor.rgb, u_lum);\n float normalization = (v_fragmentColor.r + v_fragmentColor.g + v_fragmentColor.b) / 3.0;\n gray /= normalization; // Adjust for tint brightness\n gl_FragColor = vec4(v_fragmentColor.rgb*vec3(gray), color.a * v_fragmentColor.a);\n }\n "; cocos2d::CCPoint::CCPoint(&v233, (float)(v227 * 0.5) + 150.0, (float)(v228 * 0.5) + -90.0); v113 = cocos2d::CCLabelBMFont::create(); v113->setScale(v113, 0.7); a1->m_mainLayer->addChild(a1->m_mainLayer, v113); v114 = v113->setPosition; cocos2d::CCPoint::CCPoint(&v238.origin, 0.0, 30.0); cocos2d::CCPoint::operator+(&v239, &v233, &v238); v114(v113, &v239.origin); cocos2d::CCRect::CCRect(&v238, 0.0, 0.0, 40.0, 40.0); cocos2d::CCRect::CCRect(&v239, &v238); v115 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02b_small.png", (const char *)&v239, v260); ((void (__fastcall *)(cocos2d::CCNode *, __int64))v115->__vftable[1].~CCNode_0)(v115, 100); ((void (__fastcall *)(cocos2d::CCNode *, void *))v115->__vftable[1].getTag)(v115, &unk_ECD3A8); v218 = (cocos2d::CCNode *)&v234; cocos2d::CCSize::CCSize(&v234, 50.0, 30.0); v115->setContentSize(v115, (const cocos2d::CCSize *)v218); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v115, -1); v115->setPosition(v115, &v233); v116 = CCTextInputNode::create(50.0, 40.0, "Num", v219 + 3112); a1->m_colorInput = v116; a1->m_mainLayer->addChild_0(a1->m_mainLayer, v116, 20); a1->m_colorInput->setPosition(a1->m_colorInput, &v233); CCTextInputNode::setMaxLabelScale(a1->m_colorInput, 0.6); CCTextInputNode::setMaxLabelWidth(a1->m_colorInput, 200.0); a1->m_colorInput->m_textField->setVisible(a1->m_colorInput->m_textField, 0); m_colorInput = a1->m_colorInput; v118 = v214 + 1856; m_colorInput->m_maxLabelLength = 4; sub_D153B8((int)&v239, v118); CCTextInputNode::setAllowedChars((__int64)m_colorInput, (__int64)&v239); v119 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v189 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v190 = __ldaxr(v189); while ( __stlxr(v190 - 1, v189) ); } else { v190 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v190 - 1; } if ( v190 <= 0 ) operator delete(v119); } LOWORD(v224) = -21896; BYTE2(v224) = -16; CCTextInputNode::setLabelPlaceholderColor(a1->m_colorInput, (cocos2d::ccColor3B)v224); CCTextInputNode::setLabelPlaceholderScale(a1->m_colorInput, 0.5); a1->m_colorInput->m_delegate = &a1->TextInputDelegate; a1->m_colorInput->setTag(a1->m_colorInput, 3); v120 = a1->m_buttonMenu; a1->m_colorInput->m_numberInput = 1; cocos2d::CCNode::convertToNodeSpace(v120, &v233); v121 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plus2Btn_001.png"); v253.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v253.adj = (size_t)ColorSelectPopup::onSelectSpecialColor; v122 = CCMenuItemSpriteExtra::create(v121, nullptr, v253); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v122); v123 = v122->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; v218 = a1->m_buttonMenu; v124 = v123->setPosition; cocos2d::CCPoint::CCPoint(&v236, 54.0, 28.5); cocos2d::CCPoint::operator+(&v237, &v233, &v236); v244 = cocos2d::CCNode::convertToNodeSpace(v218, &v237); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v124)(v122, &v239, v244.x, v244.y); v122->setTag(v122, 6); v125 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png"); v125->setScale(v125, 1.1); v254.adj = (size_t)ColorSelectPopup::onUpdateCustomColor; v254.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v126 = CCMenuItemSpriteExtra::create(v125, nullptr, v254); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v126); v126->setTag(v126, 2); v127 = v126->setPosition; cocos2d::CCPoint::CCPoint(&v237, -50.0, 0.0); cocos2d::CCPoint::operator+(&v239, &v235, &v237); v127(v126, &v239.origin); CCMenuItemSpriteExtra::setSizeMult(v126, 2.0); v128 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png"); v128->setScale(v128, 1.1); v255.adj = (size_t)ColorSelectPopup::onUpdateCustomColor; v255.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v129 = CCMenuItemSpriteExtra::create(v128, nullptr, v255); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v129); v129->setTag(v129, 1); v130 = v129->setPosition; cocos2d::CCPoint::CCPoint(&v237, 50.0, 0.0); cocos2d::CCPoint::operator+(&v239, &v235, &v237); v130(v129, &v239.origin); CCMenuItemSpriteExtra::setSizeMult(v129, 2.0); ColorSelectPopup::updateTextInputLabel(a1); } else { v215 = "&levelsInfo="; v219 = " #endif\n\n varying vec4 v_fragmentColor;\n varying vec2 v_texCoord;\n uniform sampler2D u_texture;\n\n uniform vec3 u_lum;\n\n void main(void) {\n vec4 color = texture2D(u_texture, v_texCoord);\n float gray = dot(color.rgb * v_fragmentColor.rgb, u_lum);\n float normalization = (v_fragmentColor.r + v_fragmentColor.g + v_fragmentColor.b) / 3.0;\n gray /= normalization; // Adjust for tint brightness\n gl_FragColor = vec4(v_fragmentColor.rgb*vec3(gray), color.a * v_fragmentColor.a);\n }\n "; v216 = "redBtn_001.png"; v214 = "redBtn_001.png"; } v71 = ConfigureHSVWidget::create(a1->m_hsv, 0, 0); v72 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_hsvWidget = v71; ((void (__fastcall *)(ColorSelectPopup *))v72->addChild)(a1); m_hsvWidget = a1->m_hsvWidget; v74 = m_hsvWidget->setPosition; cocos2d::CCPoint::CCPoint(&v239.origin, (float)(v227 * 0.5) + -75.0, (float)(v228 * 0.5) + 45.0); v74(m_hsvWidget, &v239.origin); a1->m_hsvWidget->setScale(a1->m_hsvWidget, 0.85); cocos2d::CCArray::addObject(a1->m_copyObjects, a1->m_hsvWidget); cocos2d::CCPoint::CCPoint(&v231, (float)(v227 * 0.5) + 150.0, (float)(v228 * 0.5) + 90.0); v75 = cocos2d::CCLabelBMFont::create(); a1->addChild(a1, v75); v75->setScale(v75, 0.7); v75->setPosition(v75, &v231); cocos2d::CCArray::addObject(a1->m_copyObjects, v75); cocos2d::CCPoint::CCPoint(&v239.origin, 0.0, -30.0); cocos2d::CCPoint::operator+(&v232, &v231, &v239); cocos2d::CCRect::CCRect(&v238, 0.0, 0.0, 40.0, 40.0); cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v233, 50.0, 30.0); cocos2d::CCRect::CCRect(&v239, &v238); v76 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)(v216 + 1144), (const char *)&v239, v258); ((void (__fastcall *)(cocos2d::CCNode *, __int64))v76->__vftable[1].~CCNode_0)(v76, 100); getTag = v76->__vftable[1].getTag; LOWORD(v239.origin.x) = 0; BYTE2(v239.origin.x) = 0; ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))getTag)(v76, &v239); v76->setContentSize(v76, (const cocos2d::CCSize *)&v233); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v76, -1); v76->setPosition(v76, &v232); cocos2d::CCArray::addObject(a1->m_copyObjects, v76); v78 = CCTextInputNode::create(50.0, 40.0, v215 + 1160, v219 + 3112); a1->m_copyColorInput = v78; a1->m_mainLayer->addChild_0(a1->m_mainLayer, v78, 20); a1->m_copyColorInput->setPosition(a1->m_copyColorInput, &v232); CCTextInputNode::setMaxLabelScale(a1->m_copyColorInput, 0.6); CCTextInputNode::setMaxLabelWidth(a1->m_copyColorInput, 200.0); a1->m_copyColorInput->m_textField->setVisible(a1->m_copyColorInput->m_textField, 0); m_copyColorInput = a1->m_copyColorInput; v80 = v214 + 1856; m_copyColorInput->m_maxLabelLength = 6; sub_D153B8((int)&v239, v80); CCTextInputNode::setAllowedChars((__int64)m_copyColorInput, (__int64)&v239); v81 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v183 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v184 = __ldaxr(v183); while ( __stlxr(v184 - 1, v183) ); } else { v184 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v184 - 1; } if ( v184 <= 0 ) operator delete(v81); } LOWORD(v225) = -21896; v218 = (cocos2d::CCNode *)&a1->TextInputDelegate; BYTE2(v225) = -16; v82 = a1->m_copyColorInput; v213 = (cocos2d::CCNode *)&v234; v217 = v226; CCTextInputNode::setLabelPlaceholderColor(v82, (cocos2d::ccColor3B)v225); CCTextInputNode::setLabelPlaceholderScale(a1->m_copyColorInput, 0.5); a1->m_copyColorInput->m_delegate = (TextInputDelegate *)v218; a1->m_copyColorInput->setTag(a1->m_copyColorInput, 4); m_copyObjects = a1->m_copyObjects; v84 = a1->m_copyColorInput; v84->m_numberInput = 1; cocos2d::CCArray::addObject(m_copyObjects, v84); cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v232); v85 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png"); v85->setScale(v85, 1.1); v250.adj = (size_t)ColorSelectPopup::onUpdateCopyColor; v250.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v86 = CCMenuItemSpriteExtra::create(v85, nullptr, v250); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v86); v86->setTag(v86, 1); v212 = (cocos2d::CCRect *)v86->setPosition; cocos2d::CCPoint::CCPoint(&v237, -50.0, 0.0); cocos2d::CCPoint::operator+(&v239, v213, &v237); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *))v212)(v86, &v239); CCMenuItemSpriteExtra::setSizeMult(v86, 2.0); cocos2d::CCArray::addObject(a1->m_copyObjects, v86); v87 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png"); v87->setScale(v87, 1.1); v251.adj = (size_t)ColorSelectPopup::onUpdateCopyColor; v251.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v88 = CCMenuItemSpriteExtra::create(v87, nullptr, v251); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v88); v88->setTag(v88, 2); v89 = v88->setPosition; cocos2d::CCPoint::CCPoint(&v237, 50.0, 0.0); cocos2d::CCPoint::operator+(&v239, v213, &v237); v89(v88, &v239.origin); CCMenuItemSpriteExtra::setSizeMult(v88, 2.0); cocos2d::CCArray::addObject(a1->m_copyObjects, v88); v90 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plus2Btn_001.png"); v252.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1; v252.adj = (size_t)ColorSelectPopup::onSelectSpecialColor; v91 = CCMenuItemSpriteExtra::create(v90, nullptr, v252); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v91); v92 = v91->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; v213 = a1->m_buttonMenu; v93 = v92->setPosition; cocos2d::CCPoint::CCPoint(&v236, 50.0, 25.0); cocos2d::CCPoint::operator+(&v237, &v231, &v236); v242 = cocos2d::CCNode::convertToNodeSpace(v213, &v237); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v93)(v91, &v239, v242.x, v242.y); cocos2d::CCArray::addObject(a1->m_copyObjects, v91); v91->setTag(v91, 7); sub_D153B8((int)&v237, "Help"); sub_D153B8( (int)&v239, "Change the attributes of a color channel. Each color channel is separated by a Color ID, which goes " "up to 999.\n" "This color channel can then be set in specific objects.\n" "Copy Color inherits color from another channel."); v94 = (cocos2d::CCNode *)InfoAlertButton::create((InfoAlertButton *)&v237, (std::string)&v239, v240, 1.0); v95 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v181 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v182 = __ldaxr(v181); while ( __stlxr(v182 - 1, v181) ); } else { v182 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v182 - 1; } if ( v182 <= 0 ) operator delete(v95); } v96 = (void *)(*(_QWORD *)&v237 - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v237 - 24LL) != v221[509] ) { if ( &pthread_create ) { v179 = (unsigned int *)(*(_QWORD *)&v237 - 8LL); do v180 = __ldaxr(v179); while ( __stlxr(v180 - 1, v179) ); } else { v180 = *(_DWORD *)(*(_QWORD *)&v237 - 8LL); *(_DWORD *)(*(_QWORD *)&v237 - 8LL) = v180 - 1; } if ( v180 <= 0 ) operator delete(v96); } v97 = a1->m_buttonMenu; v213 = (cocos2d::CCNode *)&v222; v98 = 1; v99 = 0; v97->addChild(v97, v94); v100 = a1->m_buttonMenu; v101 = a1->m_height * 0.5; v212 = (cocos2d::CCRect *)v94->setPosition; v210 = v100; cocos2d::CCPoint::CCPoint(&v237, (float)(v227 * 0.5) + -100.0, (float)(v101 + (float)(v228 * 0.5)) - 18.0); v243 = cocos2d::CCNode::convertToNodeSpace(v210, &v237); ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *, float, float))v212)(v94, &v239, v243.x, v243.y); cocos2d::CCPoint::CCPoint(&v235, (float)(v227 * 0.5) + -154.0, (float)(v228 * 0.5) + 30.0); v212 = &v238; while ( 1 ) { cocos2d::CCPoint::CCPoint(&v239.origin, (float)((float)v99 - 1.0) * 42.0, 22.0); cocos2d::CCPoint::operator+(&v236, &v235, &v239); if ( v99 == 3 ) { cocos2d::CCPoint::CCPoint(&v237, 0.0, -22.0); cocos2d::CCPoint::operator+(&v239, &v235, &v237); cocos2d::CCPoint::operator=(&v236, v207, v208); } v108 = cocos2d::CCLabelBMFont::create(); v108->setScale(v108, 0.5); a1->m_mainLayer->addChild(a1->m_mainLayer, v108); v109 = v108->setPosition; cocos2d::CCPoint::CCPoint(&v237, 0.0, 20.0); cocos2d::CCPoint::operator+(&v239, &v236, &v237); v109(v108, &v239.origin); cocos2d::CCArray::addObject(a1->m_colorObjects, v108); cocos2d::CCRect::CCRect(&v239, v212); v110 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)(v216 + 1144), (const char *)&v239, v259); ((void (__fastcall *)(cocos2d::CCNode *, __int64))v110->__vftable[1].~CCNode_0)(v110, 100); v111 = v110->__vftable[1].getTag; LOWORD(v239.origin.x) = 0; BYTE2(v239.origin.x) = 0; ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))v111)(v110, &v239); if ( v99 == 3 ) v233.x = 100.0; v110->setContentSize(v110, (const cocos2d::CCSize *)&v233); v110->setScale(v110, 0.6); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v110, -1); v110->setPosition(v110, &v236); cocos2d::CCArray::addObject(a1->m_colorObjects, v110); v112 = 40.0; if ( v99 == 3 ) v112 = 80.0; v102 = CCTextInputNode::create(v112, 20.0, v215 + 1160, v219 + 3112); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v102, 20); v102->setPosition(v102, &v236); CCTextInputNode::setMaxLabelScale(v102, 0.4); CCTextInputNode::setMaxLabelWidth(v102, 50.0); v102->m_textField->setVisible(v102->m_textField, 0); if ( v99 == 3 ) { v103 = 7; v104 = "0123456789ABCDEFabcdef"; } else { v103 = 4; v104 = v214 + 1856; } v102->m_maxLabelLength = v103; sub_D153B8((int)&v239, v104); CCTextInputNode::setAllowedChars((__int64)v102, (__int64)&v239); v105 = (void *)(*(_QWORD *)&v239.origin - 24LL); if ( (__int64 (__fastcall *)(int, int, int, int, int, int, int, int, char))(*(_QWORD *)&v239.origin - 24LL) != v221[509] ) { if ( &pthread_create ) { v154 = (unsigned int *)(*(_QWORD *)&v239.origin - 8LL); do v155 = __ldaxr(v154); while ( __stlxr(v155 - 1, v154) ); } else { v155 = *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL); *(_DWORD *)(*(_QWORD *)&v239.origin - 8LL) = v155 - 1; } if ( v155 <= 0 ) operator delete(v105); } v226[2] = -16; v226[0] = 120; v226[1] = -86; CCTextInputNode::setLabelPlaceholderColor(v102, (cocos2d::ccColor3B)*v217); CCTextInputNode::setLabelPlaceholderScale(v102, 0.4); v102->m_delegate = (TextInputDelegate *)v218; m_colorObjects = a1->m_colorObjects; v102->m_numberInput = v99 <= 2; cocos2d::CCArray::addObject(m_colorObjects, v102); v107 = v102->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; if ( v99 == 2 ) { a1->m_bInput = v102; v107->setTag(v102, 10); goto LABEL_43; } if ( v99 == 3 ) break; if ( v99 == 1 ) { a1->m_gInput = v102; v107->setTag(v102, 9); } else { a1->m_rInput = v102; v107->setTag(v102, 8); if ( v98 == 4 ) goto LABEL_19; } LABEL_43: ++v99; ++v98; } a1->m_hexInput = v102; ((void (*)(void))v107->setTag)(); LABEL_19: ColorSelectPopup::updateHSVMode(a1); ColorSelectPopup::updateCopyColorTextInputLabel(a1); a1->m_disableTextDelegate = 0; a1->m_initializing = 0; return v211; }