// // GJShopLayer::init from 0x10014a66c to 0x10014b854 (4584 bytes) // // 1 xrefs: // > GJShopLayer::create @ 0x10014a620 // // 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 __fastcall GJShopLayer::init(GJShopLayer *a1, ShopType a2) { _BOOL4 v4; // w0 cocos2d::CCDirector *v5; // x0 cocos2d::CCTouchDispatcher *v6; // x0 ShopType m_type; // w8 const std::string::value_type *v8; // x1 cocos2d::CCTextureCache *v9; // x21 std::size_t size; // x22 void **v11; // x23 const void *p_m_sheetName; // x1 void **v13; // x1 cocos2d::CCSpriteFrameCache *v14; // x21 std::size_t v15; // x22 void **v16; // x23 const void *capacitym1; // x1 void **v18; // x1 cocos2d::CCDirector *v19; // x0 std::string *v20; // x1 CCSpriteWithHue *v21; // x22 __n128 v22; // q0 __n128 v23; // q1 std::string *v24; // x0 __n128 v25; // q0 __n128 v26; // q1 std::string *v27; // x0 cocos2d::CCSprite *v28; // x19 __n128 v29; // q0 __n128 v30; // q1 __n128 v31; // q0 AnimatedShopKeeper *m_shopKeeper; // x19 __n128 v33; // q1 AnimatedShopKeeper *v34; // x19 cocos2d::CCDelayTime *v35; // x21 cocos2d::CCAction *v36; // x0 std::string *v37; // x1 CCSpriteWithHue *v38; // x19 std::string *v39; // x0 __n128 v40; // q0 __n128 v41; // q1 cocos2d::CCSprite *v42; // x21 CCMenuItemSpriteExtra *v43; // x0 cocos2d::CCMenu *v44; // x21 float32x2_t *v45; // x19 __n128 v46; // q0 __n128 v47; // q1 double v48; // d0 cocos2d::CCMenu *v49; // x19 AppDelegate *v50; // x0 __n128 v51; // q0 __n128 v52; // q1 cocos2d::CCSprite *v53; // x0 CCMenuItemSpriteExtra *v54; // x21 cocos2d::CCSprite *v55; // x0 CCMenuItemSpriteExtra *v56; // x19 __int64 v57; // x21 cocos2d::CCDirector *v58; // x0 float v59; // s8 cocos2d::CCDirector *v60; // x0 __n128 v61; // q0 __n128 v62; // q1 FMOD::Channel *v63; // x19 GameStatsManager *v64; // x0 const char *v65; // x1 int Stat; // w0 CCCounterLabel *m_currencyLabel; // x19 float v68; // s8 AppDelegate *v69; // x0 __n128 v70; // q0 __n128 v71; // q1 __n128 v72; // q0 CCCounterLabel *v73; // x19 __n128 v74; // q1 char *v75; // x1 void **v76; // x0 cocos2d::CCSprite *v77; // x19 float32x2_t *v78; // x21 __n128 v79; // q0 __n128 v80; // q1 double v81; // d0 cocos2d::CCParticleSystemQuad *v82; // x21 __n128 v83; // q0 __n128 v84; // q1 __int64 v85; // x0 __int64 v86; // x0 GameStatsManager *v87; // x0 unsigned __int64 m_storeItemArray; // x19 __int64 v89; // x23 GameManager *v90; // x0 bool UGV; // w21 __int64 i; // x24 _DWORD *v93; // x0 ShopType v94; // w8 cocos2d::CCDictionary *v95; // x0 cocos2d::CCSprite *v96; // x0 __int64 v97; // x25 const char *v98; // x8 float v99; // s10 __n128 v100; // q0 __n128 v101; // q1 _DWORD *v102; // x21 int v103; // w24 int v104; // w28 int v105; // w26 int v106; // w22 GameStatsManager *v107; // x0 _BOOL4 isStoreItemUnlocked; // w27 __int64 v109; // x26 GJItemIcon *StoreItem; // x24 CCMenuItemSpriteExtra *v111; // x28 __n128 v112; // q0 __n128 v113; // q0 void **v114; // x0 cocos2d::CCLabelBMFont *v115; // x27 __n128 v116; // q0 __n128 v117; // q1 void **v118; // x0 cocos2d::CCSprite *v119; // x26 float32x2_t *v120; // x24 float v121; // s14 __n128 v122; // q0 __n128 v123; // q1 double v124; // d0 float v125; // s4 float v126; // s5 ListButtonBar *v127; // x19 BoomScrollLayer *m_scrollLayer; // x0 BoomScrollLayer *v129; // x19 bool v131; // [xsp+14h] [xbp-19Ch] __int64 v132; // [xsp+18h] [xbp-198h] char *__s; // [xsp+20h] [xbp-190h] cocos2d::CCArray *v134; // [xsp+28h] [xbp-188h] ShopType v135; // [xsp+34h] [xbp-17Ch] float32x2_t v136; // [xsp+38h] [xbp-178h] BYREF float32x2_t v137; // [xsp+40h] [xbp-170h] BYREF void *v138[2]; // [xsp+48h] [xbp-168h] BYREF char v139; // [xsp+5Fh] [xbp-151h] void *v140[2]; // [xsp+60h] [xbp-150h] BYREF char v141; // [xsp+77h] [xbp-139h] std::string __dst; // [xsp+80h] [xbp-130h] BYREF float v143; // [xsp+98h] [xbp-118h] float v144; // [xsp+9Ch] [xbp-114h] void *__p[2]; // [xsp+A0h] [xbp-110h] BYREF char v146; // [xsp+B7h] [xbp-F9h] std::string v147; // [xsp+B8h] [xbp-F8h] BYREF std::string v148; // [xsp+D0h] [xbp-E0h] BYREF std::string v149; // [xsp+E8h] [xbp-C8h] BYREF std::string v150; // [xsp+100h] [xbp-B0h] BYREF cocos2d::ccColor3B v151; // 0:w0.3 cocos2d::SEL_CallFunc v152; // 0:x1.16 cocos2d::SEL_MenuHandler v153; // 0:x3.16 cocos2d::SEL_MenuHandler v154; // 0:x3.16 cocos2d::SEL_MenuHandler v155; // 0:x3.16 cocos2d::SEL_MenuHandler v156; // 0:x3.16 cocos2d::CCPoint v157; // 0:s0.4,4:s1.4 v4 = cocos2d::CCLayer::init(a1); if ( !v4 ) return v4; v131 = v4; v5 = cocos2d::CCDirector::sharedDirector(); v6 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v5->getTouchDispatcher)(v5); cocos2d::CCTouchDispatcher::registerForcePrio(v6, a1, 2); a1->m_type = a2; sub_100009900(&v150, "shopBG_001.png"); sub_100009900(&v149, "storeDesk_001.png"); sub_100009900(&v148, "shopSign_001.png"); std::string::assign((std::string *)&a1->m_sheetName, "GJ_ShopSheet01"); sub_100009900(&v147, "shop.mp3"); m_type = a1->m_type; if ( m_type > Community ) { if ( m_type == Mechanic ) { std::string::assign((std::string *)&a1->m_sheetName, "GJ_ShopSheet02"); std::string::assign(&v150, "shopBG_02_001.png"); std::string::assign(&v149, "storeDesk_02_001.png"); std::string::assign(&v148, "shopSign4_001.png"); v8 = "shop4.mp3"; goto LABEL_11; } if ( m_type == Diamond ) { std::string::assign((std::string *)&a1->m_sheetName, "GJ_ShopSheet03"); std::string::assign(&v150, "shopBG_03_001.png"); std::string::assign(&v149, "storeDesk_03_001.png"); std::string::assign(&v148, "shopSign5_001.png"); v8 = "shop5.ogg"; goto LABEL_11; } } else { if ( m_type == Secret ) { std::string::assign(&v148, "shopSign2_001.png"); v8 = "secretShop.mp3"; goto LABEL_11; } if ( m_type == Community ) { std::string::assign(&v148, "shopSign3_001.png"); v8 = "shop3.ogg"; LABEL_11: std::string::assign(&v147, v8); } } v9 = cocos2d::CCTextureCache::sharedTextureCache(); if ( a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22] >= 0 ) size = (unsigned __int8)a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22]; else size = a1->m_sheetName.m_data.m_long.size; v11 = __p; sub_100048E98((__int64)__p, size + 4); if ( v146 < 0 ) v11 = (void **)__p[0]; if ( size ) { if ( a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22] >= 0 ) p_m_sheetName = &a1->m_sheetName; else p_m_sheetName = (const void *)a1->m_sheetName.m_data.m_long.capacitym1; memmove(v11, p_m_sheetName, size); } strcpy((char *)v11 + size, ".png"); if ( v146 >= 0 ) v13 = __p; else v13 = (void **)__p[0]; cocos2d::CCTextureCache::addImage(v9, (const char *)v13, 0); if ( v146 < 0 ) operator delete(__p[0]); v14 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(); if ( a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22] >= 0 ) v15 = (unsigned __int8)a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22]; else v15 = a1->m_sheetName.m_data.m_long.size; v16 = __p; sub_100048E98((__int64)__p, v15 + 6); if ( v146 < 0 ) v16 = (void **)__p[0]; if ( v15 ) { if ( a1->m_sheetName.m_data.m_short.shortStorage.__elems_[22] >= 0 ) capacitym1 = &a1->m_sheetName; else capacitym1 = (const void *)a1->m_sheetName.m_data.m_long.capacitym1; memmove(v16, capacitym1, v15); } strcpy((char *)v16 + v15, ".plist"); if ( v146 >= 0 ) v18 = __p; else v18 = (void **)__p[0]; cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v14, (const char *)v18); if ( v146 < 0 ) operator delete(__p[0]); ((void (__fastcall *)(GJShopLayer *, __int64))a1->setKeypadEnabled)(a1, 1); ((void (__fastcall *)(GJShopLayer *, __int64))a1->setKeyboardEnabled)(a1, 1); ((void (__fastcall *)(GJShopLayer *, __int64))a1->setTouchEnabled)(a1, 1); ((void (__fastcall *)(GJShopLayer *, __int64))a1->setMouseEnabled)(a1, 1); v19 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(v19); if ( a1->m_type == Community ) { if ( (v150.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v20 = &v150; else v20 = (std::string *)v150.__r_.__value_.__r.__words[0]; sub_100009900(__p, (char *)v20); v21 = (CCSpriteWithHue *)CCSpriteWithHue::createWithSpriteFrameName(__p); if ( v146 < 0 ) operator delete(__p[0]); CCSpriteWithHue::setHueDegrees(v21, -110.0); BYTE2(__p[0]) = -16; LOWORD(__p[0]) = 240; ((void (__fastcall *)(CCSpriteWithHue *, void **))v21->setColor)(v21, __p); } else { if ( (v150.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v24 = &v150; else v24 = (std::string *)v150.__r_.__value_.__r.__words[0]; v21 = (CCSpriteWithHue *)cocos2d::CCSprite::createWithSpriteFrameName((const char *)v24); } v22.n128_u32[0] = 0; v23.n128_u32[0] = 0; sub_100022980(v22, v23, __p); ((void (__fastcall *)(CCSpriteWithHue *, void **))v21->setAnchorPoint)(v21, __p); ((void (__fastcall *)(GJShopLayer *, CCSpriteWithHue *, __int64))a1->addChild_0)(a1, v21, 4294967294LL); ((void (__fastcall *)(CCSpriteWithHue *, float))v21->setScaleX)(v21, (float)(v143 + 5.0) / v21->m_obRect.size.width); v25 = ((__n128 (__fastcall *)(CCSpriteWithHue *, float))v21->setScaleY)( v21, (float)(v144 + 5.0) / v21->m_obRect.size.height); v25.n128_u32[0] = -2.5; v26.n128_u32[0] = -2.5; sub_100022980(v25, v26, __p); ((void (__fastcall *)(CCSpriteWithHue *, void **))v21->setPosition)(v21, __p); if ( (v148.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v27 = &v148; else v27 = (std::string *)v148.__r_.__value_.__r.__words[0]; v28 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v27); v29.n128_f32[0] = (float)(v143 * 0.5) + -70.0; v30.n128_f32[0] = v144 + -38.0; sub_100022980(v29, v30, __p); ((void (__fastcall *)(cocos2d::CCSprite *, void **))v28->setPosition)(v28, __p); ((void (__fastcall *)(GJShopLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v28); a1->m_shopKeeper = AnimatedShopKeeper::create(a2); v31 = ((__n128 (__fastcall *)(GJShopLayer *))a1->addChild_0)(a1); m_shopKeeper = a1->m_shopKeeper; v31.n128_f32[0] = (float)(v143 * 0.5) + 100.0; v33.n128_u32[0] = 1130758144; sub_100022980(v31, v33, __p); ((void (__fastcall *)(AnimatedShopKeeper *, void **))m_shopKeeper->setPosition)(m_shopKeeper, __p); v34 = a1->m_shopKeeper; v35 = cocos2d::CCDelayTime::create(0.1); v152.ptr = (void (*)(void))AnimatedShopKeeper::startAnimating; v152.adj = 0; cocos2d::CCCallFunc::create(a1->m_shopKeeper, v152); v36 = (cocos2d::CCAction *)sub_10018A494(v35); cocos2d::CCNode::runAction(v34, v36); if ( a1->m_type == Community ) { if ( (v149.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v37 = &v149; else v37 = (std::string *)v149.__r_.__value_.__r.__words[0]; sub_100009900(__p, (char *)v37); v38 = (CCSpriteWithHue *)CCSpriteWithHue::createWithSpriteFrameName(__p); if ( v146 < 0 ) operator delete(__p[0]); CCSpriteWithHue::setHueDegrees(v38, -120.0); } else { if ( (v149.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v39 = &v149; else v39 = (std::string *)v149.__r_.__value_.__r.__words[0]; v38 = (CCSpriteWithHue *)cocos2d::CCSprite::createWithSpriteFrameName((const char *)v39); } v40 = ((__n128 (__fastcall *)(GJShopLayer *, CCSpriteWithHue *, __int64))a1->addChild_0)(a1, v38, 1); v40.n128_f32[0] = v143 * 0.5; v41.n128_u32[0] = 1119748096; sub_100022980(v40, v41, __p); ((void (__fastcall *)(CCSpriteWithHue *, void **))v38->setPosition)(v38, __p); ((void (__fastcall *)(CCSpriteWithHue *, float))v38->setScaleX)(v38, 0.96); if ( a2 > Secret ) { if ( a2 == Community ) { v49 = cocos2d::CCMenu::create(); ((void (__fastcall *)(GJShopLayer *, cocos2d::CCMenu *, __int64))a1->addChild_0)(a1, v49, 0xFFFFFFFFLL); v50 = AppDelegate::get(); v52.n128_u32[0] = 0; if ( v50->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] ) v52.n128_f32[0] = 10.0; v51.n128_f32[0] = (float)(v143 + -40.0) - v52.n128_f32[0]; v52.n128_f32[0] = v144 + -60.0; sub_100022980(v51, v52, __p); ((void (__fastcall *)(cocos2d::CCMenu *, void **))v49->setPosition)(v49, __p); v53 = cocos2d::CCSprite::createWithSpriteFrameName("communityCreditsBtn_001.png"); v154.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJShopLayer::onCommunityCredits; v154.adj = 0; v54 = CCMenuItemSpriteExtra::create(v53, nullptr, a1, v154); CCMenuItemSpriteExtra::setSizeMult(v54, 1.2); ((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v49->addChild)(v49, v54); } else if ( a2 == Mechanic ) { BYTE2(__p[0]) = -81; LOWORD(__p[0]) = -20561; ((void (__fastcall *)(CCSpriteWithHue *, void **))v21->setColor)(v21, __p); } } else if ( a2 ) { if ( a2 == Secret ) { BYTE2(__p[0]) = -1; LOWORD(__p[0]) = -256; ((void (__fastcall *)(CCSpriteWithHue *, void **))v21->setColor)(v21, __p); BYTE2(__p[0]) = -1; LOWORD(__p[0]) = -256; ((void (__fastcall *)(CCSpriteWithHue *, void **))v38->setColor)(v38, __p); } } else { v42 = cocos2d::CCSprite::createWithSpriteFrameName("plushies_001.png"); ((void (__fastcall *)(cocos2d::CCSprite *, float))v42->setScale)(v42, 1.1); v153.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJShopLayer::onPlushies; v153.adj = 0; v43 = CCMenuItemSpriteExtra::create(v42, nullptr, a1, v153); *(_WORD *)&v43->m_animationEnabled = 256; v44 = cocos2d::CCMenu::createWithItem(v43); ((void (__fastcall *)(GJShopLayer *, cocos2d::CCMenu *, _QWORD))a1->addChild_0)(a1, v44, 0); v45 = (float32x2_t *)((__int64 (__fastcall *)(CCSpriteWithHue *))v38->getPosition)(v38); v46.n128_u32[0] = -1023279104; v47.n128_u32[0] = 1123024896; sub_100022980(v46, v47, v140); *(float32x2_t *)&v48 = sub_1000229DC(v45, (float32x2_t *)v140, (float32x2_t *)__p); ((void (__fastcall *)(cocos2d::CCMenu *, void **, double))v44->setPosition)(v44, __p, v48); ((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))v44->setEnabled)(v44, 0); } v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png"); v155.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJShopLayer::onBack; v155.adj = 0; v56 = CCMenuItemSpriteExtra::create(v55, nullptr, a1, v155); CCMenuItemSpriteExtra::setSizeMult(v56, 1.6); v57 = sub_1001D7ED0(v56); ((void (__fastcall *)(GJShopLayer *, __int64, __int64))a1->addChild_0)(a1, v57, 1); v58 = cocos2d::CCDirector::sharedDirector(); v59 = sub_1001768D8(v58); v60 = cocos2d::CCDirector::sharedDirector(); v61.n128_f64[0] = sub_1001768C8(v60); v62.n128_f32[0] = v61.n128_f32[0] + -23.0; v61.n128_f32[0] = v59 + 24.0; sub_100022980(v61, v62, __p); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v57 + 184LL))(v57, __p); if ( PlatformToolbox::isControllerConnected() ) GameToolbox::addBackButton(a1, v56); v63 = (FMOD::Channel *)FMODAudioEngine::sharedEngine(); if ( SHIBYTE(v147.__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&__dst, v147.__r_.__value_.__l.__data_, v147.__r_.__value_.__l.__size_); else __dst = v147; FMODAudioEngine::playMusic(v63, (__int64)&__dst, 1, 0, 0.0); if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__dst.__r_.__value_.__l.__data_); if ( a1->m_type == Diamond ) { v64 = GameStatsManager::sharedState(); v65 = "29"; } else { v64 = GameStatsManager::sharedState(); v65 = "14"; } Stat = GameStatsManager::getStat(v64, v65); a1->m_currencyLabel = CCCounterLabel::create(Stat, "bigFont.fnt", Integer); ((void (__fastcall *)(GJShopLayer *))a1->addChild_0)(a1); m_currencyLabel = a1->m_currencyLabel; v68 = v143; v69 = AppDelegate::get(); v71.n128_u32[0] = 0; if ( v69->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] ) v71.n128_f32[0] = 10.0; v70.n128_f32[0] = (float)(v68 + -34.0) - v71.n128_f32[0]; v71.n128_f32[0] = v144 + -15.0; sub_100022980(v70, v71, __p); v72 = ((__n128 (__fastcall *)(CCCounterLabel *, void **))m_currencyLabel->setPosition)(m_currencyLabel, __p); v73 = a1->m_currencyLabel; v72.n128_u32[0] = 1.0; v74.n128_u32[0] = 0.5; sub_100022980(v72, v74, __p); ((void (__fastcall *)(CCCounterLabel *, void **))v73->setAnchorPoint)(v73, __p); ((void (__fastcall *)(CCCounterLabel *, float))a1->m_currencyLabel->setScale)(a1->m_currencyLabel, 0.6); if ( a1->m_type == Diamond ) v75 = "currencyDiamondIcon_001.png"; else v75 = "currencyOrbIcon_001.png"; sub_100009900(__p, v75); if ( v146 >= 0 ) v76 = __p; else v76 = (void **)__p[0]; v77 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v76); ((void (__fastcall *)(GJShopLayer *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v77, 3); v78 = (float32x2_t *)((__int64 (__fastcall *)(CCCounterLabel *))a1->m_currencyLabel->getPosition)(a1->m_currencyLabel); v79.n128_u32[0] = 13.0; v80.n128_u32[0] = -0.5; sub_100022980(v79, v80, v138); *(float32x2_t *)&v81 = sub_1000229DC(v78, (float32x2_t *)v138, (float32x2_t *)v140); ((void (__fastcall *)(cocos2d::CCSprite *, void **, double))v77->setPosition)(v77, v140, v81); v82 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0); ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v82->setTotalParticles)(v82, 8); *(_OWORD *)v140 = xmmword_100635E80; ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v82->setStartColor)(v82, v140); *(_OWORD *)v140 = xmmword_100638480; ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v82->setEndColor)(v82, v140); v140[0] = nullptr; v140[1] = nullptr; ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v82->setStartColorVar)(v82, v140); v140[0] = nullptr; v140[1] = nullptr; ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v82->setEndColorVar)(v82, v140); ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v82->setLife)(v82, 1.0); v83 = ((__n128 (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))v82->setLifeVar)(v82, 0.2); v83.n128_u32[0] = 12.0; v84.n128_u32[0] = 10.0; sub_100022980(v83, v84, v140); ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **))v82->setPosVar)(v82, v140); ((void (__fastcall *)(GJShopLayer *, cocos2d::CCParticleSystemQuad *, __int64))a1->addChild_0)(a1, v82, 100); v85 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v77->getPosition)(v77); ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v82->setPosition)(v82, v85); ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v82->setPositionType)(v82, 2); cocos2d::CCParticleSystem::resetSystem(v82); v134 = (cocos2d::CCArray *)sub_10024A15C(v86); v87 = GameStatsManager::sharedState(); m_storeItemArray = (unsigned __int64)v87->m_storeItemArray; v89 = sub_10024A15C(v87); v90 = GameManager::sharedState(); UGV = GameManager::getUGV(v90, "7"); for ( i = 0; (unsigned int)i < (unsigned int)sub_10024A36C(m_storeItemArray); i = (unsigned int)(i + 1) ) { v93 = (_DWORD *)sub_10024A388(m_storeItemArray, i); v94 = a1->m_type; if ( v94 == v93[91] && (v94 != Secret || UGV || v93[79] - v93[80] != 20) ) sub_10024A2D0(v89, v93); } v95 = cocos2d::CCDictionary::create(); a1->m_shopItems = v95; cocos2d::CCObject::retain(v95); v96 = cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png"); v135 = a2; v132 = sub_10024A15C(v96); v97 = 0; if ( v135 == Diamond ) v98 = "currencyDiamondIcon_001.png"; else v98 = "currencyOrbIcon_001.png"; __s = (char *)v98; if ( v135 == Diamond ) v99 = 1.0; else v99 = 0.0; while ( (unsigned int)v97 < (unsigned int)sub_10024A36C(v89) ) { v102 = (_DWORD *)sub_10024A388(v89, v97); v103 = v102[82]; v104 = v102[83]; v105 = v102[85]; v106 = v102[86]; v107 = GameStatsManager::sharedState(); isStoreItemUnlocked = GameStatsManager::isStoreItemUnlocked(v107, v102[79] - v102[80]); v151 = GJItemIcon::unlockedColorForType(v135); v109 = (unsigned int)(v105 - v106); m_storeItemArray = m_storeItemArray & 0xFFFFFFFFFF000000LL | *(_QWORD *)&v151.r & 0xFFFFFFLL; StoreItem = GJItemIcon::createStoreItem( (UnlockType)v109, v103 - v104, isStoreItemUnlocked, (cocos2d::ccColor3B)m_storeItemArray); ((void (__fastcall *)(GJItemIcon *, float))StoreItem->setScale)(StoreItem, 1.1); v156.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJShopLayer::onSelectItem; v156.adj = 0; v111 = CCMenuItemSpriteExtra::create(StoreItem, nullptr, a1, v156); CCMenuItemSpriteExtra::setSizeMult(v111, 2.0); v112 = sub_10024A2D0(v134, v111); ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD, __n128))v111->setTag)( v111, (unsigned int)(v102[79] - v102[80]), v112); ((void (__fastcall *)(GJItemIcon *, __int64))StoreItem->setTag)(StoreItem, v109); if ( (unsigned int)v109 > 9 || ((1 << v109) & 0x302) == 0 ) v113 = sub_10024A2D0(v132, v111); if ( isStoreItemUnlocked ) { ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD, __n128))v111->setEnabled)(v111, 0, v113); GJItemIcon::darkenStoreItem_1(StoreItem, a1->m_type); } else { GameToolbox::pointsToString((unsigned int)(v102[88] - v102[89]), (__int64)v140); if ( v141 >= 0 ) v114 = v140; else v114 = (void **)v140[0]; v115 = cocos2d::CCLabelBMFont::create_1((const char *)v114, "bigFont.fnt"); ((void (__fastcall *)(GJItemIcon *, cocos2d::CCLabelBMFont *))StoreItem->addChild)(StoreItem, v115); v116.n128_f32[0] = (float)(*(float *)((__int64 (__fastcall *)(GJItemIcon *))StoreItem->getContentSize)(StoreItem) * 0.5) + -4.0; v117.n128_u32[0] = -6.5; sub_100022980(v116, v117, v138); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v115->setPosition)(v115, v138); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v115->setScale)(v115, 0.35); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v115->setTag)(v115, 1234); sub_100009900(v138, __s); if ( v139 >= 0 ) v118 = v138; else v118 = (void **)v138[0]; v119 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v118); ((void (__fastcall *)(GJItemIcon *, cocos2d::CCSprite *))StoreItem->addChild)(StoreItem, v119); v120 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v115->getPosition)(v115); v121 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v115->getContentSize)(v115); v122.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v115->getScale)(v115); v122.n128_f32[0] = (float)((float)((float)(v121 * 0.5) * v122.n128_f32[0]) + 6.0) + v99; v123.n128_u32[0] = -0.5; sub_100022980(v122, v123, &v136); *(float32x2_t *)&v124 = sub_1000229DC(v120, &v136, &v137); ((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, double))v119->setPosition)(v119, &v137, v124); ((void (__fastcall *)(cocos2d::CCSprite *, float))v119->setScale)(v119, 0.5); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v119->setTag)(v119, 1234); if ( v139 < 0 ) operator delete(v138[0]); if ( v141 < 0 ) operator delete(v140[0]); } cocos2d::CCDictionary::setObject(a1->m_shopItems, v111, (int)v102[79] - (__int64)(int)v102[80]); v97 = (unsigned int)(v97 + 1); } v100.n128_f32[0] = v143 * 0.5; v101.n128_u32[0] = 1119485952; sub_100022980(v100, v101, v138); sub_1000229B8((__int64 *)v140, (__int64 *)v138); v157.x = 25.0; v157.y = 15.0; v127 = ListButtonBar::create(v134, v157, (int)v140, 4, 60.0, 221.0, v125, v126, 2); ((void (__fastcall *)(GJShopLayer *, ListButtonBar *, __int64))a1->addChild_0)(a1, v127, 100); v127->m_useMoveAnimation = 1; m_scrollLayer = v127->m_scrollLayer; m_scrollLayer->m_unkFloat2 = 0.6; ((void (__fastcall *)(BoomScrollLayer *, __int64))m_scrollLayer->setTouchEnabled)(m_scrollLayer, 1); ListButtonBar::goToPage(v127, 0); v127->m_scrollLayer->m_doVisit = 1; sub_100022988((float *)&v137, 406.0, 200.0); v129 = v127->m_scrollLayer; sub_100022990( (float *)v140, *(float *)v138 - (float)(v137.f32[0] * 0.5), *((float *)v138 + 1) - (float)(v137.f32[1] * 0.5), v137.f32[0], v137.f32[1]); sub_100022BB0(&v129->m_clippingRect.origin, (__int64)v140); if ( v146 < 0 ) operator delete(__p[0]); if ( SHIBYTE(v147.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v147.__r_.__value_.__l.__data_); if ( SHIBYTE(v148.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v148.__r_.__value_.__l.__data_); if ( SHIBYTE(v149.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v149.__r_.__value_.__l.__data_); if ( SHIBYTE(v150.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v150.__r_.__value_.__l.__data_); LOBYTE(v4) = v131; return v4; }
GD Web Decomp Icon

GD Web Decomp

Raw Source