//
// GJShopLayer::init from 0x1402a9730 to 0x1402ab817 (8423 bytes)
//
// 2 xrefs:
// > GJShopLayer::scene @ 0x1402a96d9
// > ??> @ 0x1406d2204
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=21
bool GJShopLayer::init(GJShopLayer *a1, ShopType a2)
{
float v2; // xmm3_4
bool result; // al
__int64 v6; // rcx
__int64 v7; // rax
cocos2d::CCTouchDispatcher *v8; // rax
__int64 v9; // rdi
__int64 v10; // rdx
__int64 v11; // r8
__int64 v12; // r9
unsigned __int64 v13; // r12
unsigned __int64 v14; // r15
__int64 v15; // rsi
__int64 v16; // r13
unsigned __int64 v17; // r12
_BYTE *v18; // rbx
unsigned __int64 v19; // rcx
__int64 v20; // rbx
cocos2d::CCArray *v21; // rax
void *v22; // rcx
unsigned __int64 v23; // r12
_BYTE *v24; // rbx
unsigned __int64 v25; // rcx
__int64 v26; // rbx
cocos2d::CCArray *v27; // rax
void *v28; // rcx
unsigned __int64 v29; // r12
unsigned __int64 v30; // rcx
_QWORD *v31; // rbx
void *v32; // rcx
const char *v33; // rdx
std::string *p_m_sheetName; // rdi
cocos2d::CCArray *m_size; // rcx
cocos2d::CCPoint v36; // rdx
unsigned __int64 v37; // rbx
void **v38; // rax
unsigned __int64 v39; // r12
_BYTE *v40; // rbx
unsigned __int64 v41; // rcx
__int64 v42; // rbx
cocos2d::CCArray *v43; // rax
void *v44; // rcx
unsigned __int64 v45; // r12
_BYTE *v46; // rbx
unsigned __int64 v47; // rcx
__int64 v48; // rbx
cocos2d::CCArray *v49; // rax
void *v50; // rcx
unsigned __int64 v51; // r12
unsigned __int64 v52; // rcx
_QWORD *v53; // rbx
void *v54; // rcx
void **v55; // rax
cocos2d::CCArray *v56; // rdx
void **v57; // rbx
cocos2d::CCTextureCache *v58; // rax
__int64 v59; // r8
__int64 v60; // r9
unsigned __int64 v61; // rdx
void *v62; // rcx
std::size_t v63; // rcx
float v64; // xmm0_4
cocos2d::CCPoint v65; // rdx
unsigned __int64 v66; // rbx
cocos2d::CCArray *v67; // rax
cocos2d::CCArray *v68; // rdx
void **v69; // r8
void **v70; // rbx
cocos2d::CCSpriteFrameCache *v71; // rax
_BOOL8 v72; // rdx
void *v73; // rcx
_BOOL8 v74; // rdx
_BOOL8 v75; // rdx
_BOOL8 v76; // rdx
__int64 v77; // rcx
cocos2d::CCDirector *v78; // rax
void **v79; // rdx
size_t v80; // r8
CCSpriteWithHue *v81; // rdi
float v82; // xmm0_4
const char *v83; // rcx
CCSpriteWithHue_vtbl *v84; // rbx
const cocos2d::CCPoint *v85; // rax
float v86; // xmm0_4
CCSpriteWithHue_vtbl *v87; // rbx
double v88; // xmm0_8
const cocos2d::CCPoint *v89; // rax
void **v90; // rcx
struct cocos2d::CCSprite *v91; // rdi
cocos2d::CCSprite_vtbl *v92; // rbx
const cocos2d::CCPoint *v93; // rax
void *v94; // rbx
ShopType v95; // ecx
__int32 v96; // ecx
__int32 v97; // ecx
int v98; // ecx
const char *v99; // rdx
int v100; // eax
SpriteAnimationManager *v101; // rdi
cocos2d::CCNode *m_paSprite; // rcx
cocos2d::CCNode *m_fbfSprite; // rcx
float v104; // xmm0_4
AnimatedShopKeeper_vtbl *v105; // rbx
const cocos2d::CCPoint *v106; // rax
__int64 v107; // rbx
struct cocos2d::CCDelayTime *v108; // rax
struct cocos2d::CCSequence *v109; // rax
cocos2d::ccColor3B *v110; // r8
void **v111; // rdx
size_t v112; // r8
CCSpriteWithHue *v113; // rdi
float v114; // xmm0_4
float v115; // xmm0_4
void **v116; // rcx
float v117; // xmm0_4
CCSpriteWithHue_vtbl *v118; // rbx
const cocos2d::CCPoint *v119; // rax
__int64 v120; // rcx
struct cocos2d::CCSprite *v121; // rdi
CCMenuItemSpriteExtra *v122; // rbx
struct cocos2d::CCMenu *v123; // rdi
float v124; // xmm0_4
__int64 v125; // rax
__int64 v126; // rdi
float v127; // xmm0_4
__int64 v128; // rbx
__int64 v129; // rax
struct cocos2d::CCSprite *v130; // rax
CCMenuItemSpriteExtra *v131; // rax
struct cocos2d::CCSprite *v132; // rax
CCMenuItemSpriteExtra *v133; // rax
struct cocos2d::CCMenu *v134; // rdi
cocos2d::CCMenu_vtbl *v135; // rbx
__int64 v136; // rcx
cocos2d::CCDirector *v137; // rax
__int64 v138; // rcx
cocos2d::CCDirector *v139; // rax
float v140; // xmm0_4
const cocos2d::CCPoint *v141; // rax
__int64 v142; // rdx
__int64 v143; // rcx
__int64 v144; // rdx
__int64 v145; // rcx
__int64 v146; // r8
__int64 v147; // r9
__int64 *v148; // rbx
FMODAudioEngine *v149; // rcx
GameStatsManager *v150; // rcx
const char *v151; // rdx
int Stat; // edi
CCMenuItemSpriteExtra *v153; // rbx
struct cocos2d::CCPoint v154; // rax
float v155; // xmm0_4
CCCounterLabel_vtbl *v156; // rbx
__int64 v157; // rax
float v158; // xmm0_4
CCCounterLabel_vtbl *v159; // rbx
const cocos2d::CCPoint *v160; // rax
__int128 *v161; // rdx
size_t v162; // r8
const char *v163; // rcx
struct cocos2d::CCSprite *v164; // rsi
float v165; // xmm0_4
const cocos2d::CCPoint *v166; // rax
struct cocos2d::CCParticleSystemQuad *v167; // rdi
float v168; // xmm0_4
cocos2d::CCParticleSystemQuad_vtbl *v169; // rbx
double v170; // xmm0_8
const cocos2d::CCPoint *v171; // rax
cocos2d::CCParticleSystemQuad_vtbl *v172; // rbx
__int64 v173; // rax
__int64 v174; // rcx
__int64 v175; // rcx
__int64 v176; // rdi
cocos2d::CCArray *v177; // rdi
cocos2d::CCArray *v178; // rsi
GameManager *v179; // rcx
bool UGV; // r15
unsigned int i; // ebx
__int64 v182; // rcx
struct cocos2d::CCObject *v183; // rax
ShopType m_type; // ecx
cocos2d::CCDictionary *v185; // rax
__int64 v186; // rcx
unsigned int v187; // ebx
struct cocos2d::CCObject *v188; // r15
int v189; // edi
UnlockType v190; // ebx
GameStatsManager *v191; // rcx
bool isStoreItemUnlocked; // al
cocos2d::ccColor3B *v193; // r9
bool v194; // r13
GJItemIcon *StoreItem; // r12
CCMenuItemSpriteExtra *v196; // rsi
GLubyte v197; // cl
__m128i *v198; // rcx
struct cocos2d::CCLabelBMFont *v199; // r13
cocos2d::CCLabelBMFont_vtbl *v200; // rbx
float *v201; // rax
const cocos2d::CCPoint *v202; // rax
__int128 *v203; // rdx
ShopType v204; // ebx
size_t v205; // r8
const char *v206; // rcx
struct cocos2d::CCSprite *v207; // rdi
float v208; // xmm6_4
double v209; // xmm0_8
__int64 v210; // rax
cocos2d::CCPoint v211; // rax
ListButtonBar *v212; // rbx
_BOOL8 v213; // rdx
BoomScrollLayer *m_scrollLayer; // rcx
cocos2d::CCArray *m_dynamicObjects; // rcx
BoomScrollLayer *v216; // rcx
ListButtonBarDelegate *m_delegate; // rcx
__int64 v218; // rax
float v219; // [rsp+28h] [rbp-E0h]
int v220; // [rsp+48h] [rbp-C0h]
__int16 v221; // [rsp+58h] [rbp-B0h] BYREF
char v222; // [rsp+5Ah] [rbp-AEh]
cocos2d::CCArray *v223; // [rsp+60h] [rbp-A8h]
CCMenuItemSpriteExtra *v224; // [rsp+68h] [rbp-A0h]
__int64 v225; // [rsp+70h] [rbp-98h]
CCMenuItemSpriteExtra *v226; // [rsp+78h] [rbp-90h] BYREF
float v227; // [rsp+80h] [rbp-88h]
void *Src; // [rsp+88h] [rbp-80h]
cocos2d::ccColor3B v229; // [rsp+98h] [rbp-70h] BYREF
ShopType v230; // [rsp+A8h] [rbp-60h]
void **v231; // [rsp+B0h] [rbp-58h] BYREF
float v232; // [rsp+B8h] [rbp-50h]
float v233; // [rsp+BCh] [rbp-4Ch]
cocos2d::CCSize v234; // [rsp+C0h] [rbp-48h] BYREF
void *v235; // [rsp+C8h] [rbp-40h]
CCMenuItemSpriteExtra *v236; // [rsp+D0h] [rbp-38h]
cocos2d::CCRect v237; // [rsp+D8h] [rbp-30h] BYREF
void *Block[2]; // [rsp+E8h] [rbp-20h] BYREF
unsigned __int64 v239; // [rsp+F8h] [rbp-10h]
unsigned __int64 v240; // [rsp+100h] [rbp-8h]
void *v241[2]; // [rsp+108h] [rbp+0h] BYREF
__int64 v242; // [rsp+118h] [rbp+10h]
unsigned __int64 v243; // [rsp+120h] [rbp+18h]
__int64 v244; // [rsp+128h] [rbp+20h] BYREF
__int64 v245; // [rsp+130h] [rbp+28h]
__int64 v246; // [rsp+138h] [rbp+30h]
__int64 v247; // [rsp+140h] [rbp+38h]
void *v248[2]; // [rsp+148h] [rbp+40h] BYREF
__int64 v249; // [rsp+158h] [rbp+50h]
unsigned __int64 v250; // [rsp+160h] [rbp+58h]
void *v251[2]; // [rsp+168h] [rbp+60h] BYREF
__int64 v252; // [rsp+178h] [rbp+70h]
unsigned __int64 v253; // [rsp+180h] [rbp+78h]
__int128 v254; // [rsp+188h] [rbp+80h] BYREF
__int64 v255; // [rsp+198h] [rbp+90h]
unsigned __int64 v256; // [rsp+1A0h] [rbp+98h]
__int128 v257; // [rsp+1A8h] [rbp+A0h] BYREF
__int64 v258; // [rsp+1B8h] [rbp+B0h]
unsigned __int64 v259; // [rsp+1C0h] [rbp+B8h]
__m128i v260; // [rsp+1C8h] [rbp+C0h] BYREF
unsigned __int64 v261; // [rsp+1E0h] [rbp+D8h]
__int128 v262; // [rsp+1E8h] [rbp+E0h]
__int64 v263; // [rsp+1F8h] [rbp+F0h]
__int64 v264; // [rsp+200h] [rbp+F8h]
v230 = a2;
result = cocos2d::CCLayer::init(a1);
if ( !result )
return result;
v7 = cocos2d::CCDirector::sharedDirector(v6);
v8 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 144LL))(v7);
cocos2d::CCTouchDispatcher::registerForcePrio(v8, a1, 2);
a1->m_type = a2;
v249 = 14;
v250 = 15;
strcpy((char *)v248, "shopBG_001.png");
HIBYTE(v248[1]) = 0;
*(_OWORD *)v251 = 0;
v252 = 0;
v253 = 15;
v251[0] = sub_14003AA10(0x20u);
v252 = 17;
v9 = 31;
v253 = 31;
strcpy((char *)v251[0], "storeDesk_001.png");
*(_OWORD *)v241 = 0;
v241[0] = sub_14003AA10(0x20u);
v242 = 16;
v243 = 31;
strcpy((char *)v241[0], "shopSign_001.png");
sub_14003CCE0((void **)&a1->m_sheetName, "GJ_ShopSheet01", 0xEu);
v245 = 0;
v13 = 8;
v246 = 8;
v14 = 15;
v247 = 15;
v15 = 0x33706D2E706F6873LL;
v244 = 0x33706D2E706F6873LL;
v16 = 0x7FFFFFFFFFFFFFFFLL;
switch ( a1->m_type )
{
case Secret:
v242 = 17;
memmove(v241[0], "shopSign2_001.png", 0x11u);
*((_BYTE *)v241[0] + 17) = 0;
v246 = 14;
memmove(&v244, "secretShop.mp3", 0xEu);
BYTE6(v245) = 0;
goto LABEL_41;
case Community:
v242 = 17;
memmove(v241[0], "shopSign3_001.png", 0x11u);
*((_BYTE *)v241[0] + 17) = 0;
v33 = "shop3.ogg";
goto LABEL_40;
case Mechanic:
sub_14003CCE0((void **)&a1->m_sheetName, "GJ_ShopSheet02", 0xEu);
v39 = v250;
if ( v250 < 0x11 )
{
v41 = v250 >> 1;
if ( v250 <= 0x7FFFFFFFFFFFFFFFLL - (v250 >> 1) )
{
v42 = 31;
if ( v41 + v250 > 0x1F )
v42 = v41 + v250;
}
else
{
v42 = 0x7FFFFFFFFFFFFFFFLL;
}
v43 = (cocos2d::CCArray *)sub_14003AA10(v42 + 1);
v223 = v43;
v249 = 17;
v250 = v42;
*(_OWORD *)&v43->__vftable = *(_OWORD *)"shopBG_02_001.png";
LOWORD(v43->m_nTag) = (unsigned __int8)aShopbg02001Png[16];
if ( v39 > 0xF )
{
v44 = v248[0];
if ( v39 + 1 >= 0x1000 )
{
v44 = *((void **)v248[0] - 1);
if ( (unsigned __int64)((char *)v248[0] - (char *)v44 - 8) > 0x1F )
goto LABEL_83;
}
j_j_free(v44);
v43 = v223;
}
v248[0] = v43;
}
else
{
v40 = v248[0];
v249 = 17;
memmove(v248[0], "shopBG_02_001.png", 0x11u);
v40[17] = 0;
}
v45 = v253;
if ( v253 < 0x14 )
{
v47 = v253 >> 1;
if ( v253 <= 0x7FFFFFFFFFFFFFFFLL - (v253 >> 1) )
{
v48 = 31;
if ( v47 + v253 > 0x1F )
v48 = v47 + v253;
}
else
{
v48 = 0x7FFFFFFFFFFFFFFFLL;
}
v49 = (cocos2d::CCArray *)sub_14003AA10(v48 + 1);
v223 = v49;
v252 = 20;
v253 = v48;
strcpy((char *)v49, "storeDesk_02_001.png");
if ( v45 > 0xF )
{
v50 = v251[0];
if ( v45 + 1 >= 0x1000 )
{
v50 = *((void **)v251[0] - 1);
if ( (unsigned __int64)((char *)v251[0] - (char *)v50 - 8) > 0x1F )
goto LABEL_83;
}
j_j_free(v50);
v49 = v223;
}
v251[0] = v49;
}
else
{
v46 = v251[0];
v252 = 20;
memmove(v251[0], "storeDesk_02_001.png", 0x14u);
v46[20] = 0;
}
v51 = v243;
if ( v243 >= 0x11 )
{
v242 = 17;
memmove(v241[0], "shopSign4_001.png", 0x11u);
*((_BYTE *)v241[0] + 17) = 0;
v33 = "shop4.mp3";
goto LABEL_40;
}
v52 = v243 >> 1;
if ( v243 <= 0x7FFFFFFFFFFFFFFFLL - (v243 >> 1) )
{
if ( v243 + v52 > 0x1F )
v9 = v243 + v52;
}
else
{
v9 = 0x7FFFFFFFFFFFFFFFLL;
}
v53 = sub_14003AA10(v9 + 1);
v242 = 17;
v243 = v9;
*(_OWORD *)v53 = *(_OWORD *)"shopSign4_001.png";
*((_WORD *)v53 + 8) = (unsigned __int8)aShopsign4001Pn[16];
if ( v51 > 0xF )
{
v54 = v241[0];
if ( v51 + 1 >= 0x1000 )
{
v54 = *((void **)v241[0] - 1);
if ( (unsigned __int64)((char *)v241[0] - (char *)v54 - 8) > 0x1F )
goto LABEL_83;
}
j_j_free(v54);
}
v241[0] = v53;
v33 = "shop4.mp3";
goto LABEL_40;
}
if ( a1->m_type != Diamond )
goto LABEL_42;
sub_14003CCE0((void **)&a1->m_sheetName, "GJ_ShopSheet03", 0xEu);
v17 = v250;
if ( v250 < 0x11 )
{
v19 = v250 >> 1;
if ( v250 <= 0x7FFFFFFFFFFFFFFFLL - (v250 >> 1) )
{
v20 = 31;
if ( v19 + v250 > 0x1F )
v20 = v19 + v250;
}
else
{
v20 = 0x7FFFFFFFFFFFFFFFLL;
}
v21 = (cocos2d::CCArray *)sub_14003AA10(v20 + 1);
v223 = v21;
v249 = 17;
v250 = v20;
*(_OWORD *)&v21->__vftable = *(_OWORD *)"shopBG_03_001.png";
LOWORD(v21->m_nTag) = (unsigned __int8)aShopbg03001Png[16];
if ( v17 > 0xF )
{
v22 = v248[0];
if ( v17 + 1 >= 0x1000 )
{
v22 = *((void **)v248[0] - 1);
if ( (unsigned __int64)((char *)v248[0] - (char *)v22 - 8) > 0x1F )
goto LABEL_83;
}
j_j_free(v22);
v21 = v223;
}
v248[0] = v21;
}
else
{
v18 = v248[0];
v249 = 17;
memmove(v248[0], "shopBG_03_001.png", 0x11u);
v18[17] = 0;
}
v23 = v253;
if ( v253 < 0x14 )
{
v25 = v253 >> 1;
if ( v253 <= 0x7FFFFFFFFFFFFFFFLL - (v253 >> 1) )
{
v26 = 31;
if ( v25 + v253 > 0x1F )
v26 = v25 + v253;
}
else
{
v26 = 0x7FFFFFFFFFFFFFFFLL;
}
v27 = (cocos2d::CCArray *)sub_14003AA10(v26 + 1);
v223 = v27;
v252 = 20;
v253 = v26;
strcpy((char *)v27, "storeDesk_03_001.png");
if ( v23 > 0xF )
{
v28 = v251[0];
if ( v23 + 1 >= 0x1000 )
{
v28 = *((void **)v251[0] - 1);
if ( (unsigned __int64)((char *)v251[0] - (char *)v28 - 8) > 0x1F )
goto LABEL_83;
}
j_j_free(v28);
v27 = v223;
}
v251[0] = v27;
}
else
{
v24 = v251[0];
v252 = 20;
memmove(v251[0], "storeDesk_03_001.png", 0x14u);
v24[20] = 0;
}
v29 = v243;
if ( v243 < 0x11 )
{
v30 = v243 >> 1;
if ( v243 <= 0x7FFFFFFFFFFFFFFFLL - (v243 >> 1) )
{
if ( v243 + v30 > 0x1F )
v9 = v243 + v30;
}
else
{
v9 = 0x7FFFFFFFFFFFFFFFLL;
}
v31 = sub_14003AA10(v9 + 1);
v242 = 17;
v243 = v9;
*(_OWORD *)v31 = *(_OWORD *)"shopSign5_001.png";
*((_WORD *)v31 + 8) = (unsigned __int8)aShopsign5001Pn[16];
if ( v29 <= 0xF )
goto LABEL_38;
v32 = v241[0];
if ( v29 + 1 < 0x1000
|| (v32 = *((void **)v241[0] - 1), (unsigned __int64)((char *)v241[0] - (char *)v32 - 8) <= 0x1F) )
{
j_j_free(v32);
LABEL_38:
v241[0] = v31;
goto LABEL_39;
}
LABEL_83:
invalid_parameter_noinfo_noreturn();
}
v242 = 17;
memmove(v241[0], "shopSign5_001.png", 0x11u);
*((_BYTE *)v241[0] + 17) = 0;
LABEL_39:
v33 = "shop5.ogg";
LABEL_40:
v246 = 9;
memmove(&v244, v33, 9u);
BYTE1(v245) = 0;
LABEL_41:
v14 = v247;
v13 = v246;
v15 = v244;
LABEL_42:
p_m_sheetName = &a1->m_sheetName;
m_size = (cocos2d::CCArray *)a1->m_sheetName.m_data.m_size;
v223 = m_size;
if ( (unsigned __int64)(0x7FFFFFFFFFFFFFFFLL - (_QWORD)m_size) < 4 )
sub_140007B50(m_size, v10, v11, v12);
Src = &a1->m_sheetName;
if ( a1->m_sheetName.m_data.m_capacity > 0xF )
Src = p_m_sheetName->m_data.m_bigStorage;
*(_OWORD *)Block = 0;
v239 = 0;
v240 = 0;
v36 = (cocos2d::CCPoint)((char *)&m_size->__vftable + 4);
v226 = (CCMenuItemSpriteExtra *)((char *)&m_size->__vftable + 4);
v37 = 15;
v38 = Block;
v231 = Block;
if ( (unsigned __int64)&m_size->__vftable + 4 > 0xF )
{
v37 = *(unsigned __int64 *)&v36 | 0xF;
if ( (*(unsigned __int64 *)&v36 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
if ( v37 < 0x16 )
v37 = 22;
}
else
{
v37 = 0x7FFFFFFFFFFFFFFFLL;
}
v38 = (void **)sub_14003AA10(v37 + 1);
v231 = v38;
Block[0] = v38;
m_size = v223;
v36 = (cocos2d::CCPoint)v226;
}
v239 = (unsigned __int64)v36;
v240 = v37;
memcpy(v38, Src, (size_t)m_size);
v55 = v231;
v56 = v223;
*(_DWORD *)((char *)&v223->__vftable + (_QWORD)v231) = *(_DWORD *)".png";
*((_BYTE *)&v56->__vftable + (_QWORD)v55 + 4) = 0;
v57 = Block;
if ( v240 > 0xF )
v57 = (void **)Block[0];
v58 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v58, (const char *)v57, 0);
v61 = v240;
if ( v240 > 0xF )
{
v62 = Block[0];
if ( v240 + 1 >= 0x1000 )
{
v62 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v62 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v62);
}
v63 = a1->m_sheetName.m_data.m_size;
v231 = (void **)v63;
if ( 0x7FFFFFFFFFFFFFFFLL - v63 < 6 )
sub_140007B50(v63, v61, v59, v60);
if ( a1->m_sheetName.m_data.m_capacity > 0xF )
p_m_sheetName = (std::string *)p_m_sheetName->m_data.m_bigStorage;
v64 = 0.0;
*(_OWORD *)Block = 0;
v239 = 0;
v240 = 0;
v65 = (cocos2d::CCPoint)(v63 + 6);
v226 = (CCMenuItemSpriteExtra *)(v63 + 6);
v66 = 15;
v67 = (cocos2d::CCArray *)Block;
v223 = (cocos2d::CCArray *)Block;
if ( v63 + 6 > 0xF )
{
v66 = *(unsigned __int64 *)&v65 | 0xF;
if ( (*(unsigned __int64 *)&v65 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
if ( v66 < 0x16 )
v66 = 22;
}
else
{
v66 = 0x7FFFFFFFFFFFFFFFLL;
}
v67 = (cocos2d::CCArray *)sub_14003AA10(v66 + 1);
v223 = v67;
Block[0] = v67;
v63 = (std::size_t)v231;
v65 = (cocos2d::CCPoint)v226;
}
v239 = (unsigned __int64)v65;
v240 = v66;
memcpy(v67, p_m_sheetName, v63);
v68 = v223;
v69 = v231;
*(_DWORD *)((char *)v231 + (_QWORD)v223) = *(_DWORD *)".plist";
strcpy((char *)v69 + (_QWORD)v68 + 4, "st");
v70 = Block;
if ( v240 > 0xF )
v70 = (void **)Block[0];
v71 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*(unsigned int *)".plist");
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v71, (const char *)v70);
v72 = v240;
if ( v240 > 0xF )
{
v73 = Block[0];
if ( v240 + 1 >= 0x1000 )
{
v73 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v73 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v73);
}
LOBYTE(v72) = 1;
a1->setKeypadEnabled(a1, v72);
LOBYTE(v74) = 1;
a1->setKeyboardEnabled(a1, v74);
LOBYTE(v75) = 1;
a1->setTouchEnabled(a1, v75);
LOBYTE(v76) = 1;
a1->setMouseEnabled(a1, v76);
v78 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v77);
cocos2d::CCDirector::getWinSize(v78);
if ( a1->m_type == Community )
{
v79 = v248;
if ( v250 > 0xF )
v79 = (void **)v248[0];
v254 = 0;
v255 = 0;
v256 = 0;
v80 = -1;
do
++v80;
while ( *((_BYTE *)v79 + v80) );
sub_14003A930(&v254, v79, v80);
v81 = sub_140048500((__int64)&v254);
Src = v81;
sub_14003A830((__int64)&v254);
v82 = -110.0;
do
v82 = v82 + 360.0;
while ( v82 < 0.0 );
v64 = (float)(v82 / 360.0) * 6.283185307179586;
v81->m_hue = v64;
CCSpriteWithHue::updateColorMatrix(v81);
v221 = 240;
v222 = -16;
v81->setColor(&v81->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v221);
}
else
{
v83 = (const char *)v248;
if ( v250 > 0xF )
v83 = (const char *)v248[0];
v81 = (CCSpriteWithHue *)cocos2d::CCSprite::createWithSpriteFrameName(v83);
Src = v81;
}
v84 = v81->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v64, 0.0);
v84->setAnchorPoint(v81, v85);
a1->addChild_0(a1, v81, -2);
((void (__fastcall *)(CCSpriteWithHue *))v81->setScaleX)(v81);
v86 = ((float (__fastcall *)(CCSpriteWithHue *))v81->setScaleY)(v81);
v87 = v81->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v88 = cocos2d::CCPoint::CCPoint(v86, -2.5);
v87->setPosition_0(v81, v89);
v90 = v241;
if ( v243 > 0xF )
v90 = (void **)v241[0];
v91 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v90);
v92 = v91->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v88, (float)(v227 * 0.5) - 70.0);
v92->setPosition_0(v91, v93);
a1->addChild_1(a1, v91);
v94 = operator new(0x300u);
v224 = (CCMenuItemSpriteExtra *)v94;
CCAnimatedSprite::CCAnimatedSprite((CCAnimatedSprite *)v94);
*(_QWORD *)v94 = &AnimatedShopKeeper::`vftable';
*((_QWORD *)v94 + 40) = &AnimatedShopKeeper::`vftable';
*((_QWORD *)v94 + 43) = &AnimatedShopKeeper::`vftable';
*((_QWORD *)v94 + 93) = 0;
*((_DWORD *)v94 + 188) = 0;
*((_WORD *)v94 + 378) = 0;
*((_QWORD *)v94 + 95) = 0;
v95 = v230;
*((_DWORD *)v94 + 186) = v230;
v96 = v95 - 1;
if ( v96 )
{
v97 = v96 - 1;
if ( v97 )
{
v98 = v97 - 1;
if ( v98 )
{
if ( v98 == 1 )
v99 = "GJShopKeeper5";
else
v99 = "GJShopKeeper";
}
else
{
v99 = "GJShopKeeper4";
}
}
else
{
v99 = "GJShopKeeper3";
}
}
else
{
v99 = "GJShopKeeper2";
}
if ( CCAnimatedSprite::initWithType((CCAnimatedSprite *)v94, v99, nullptr, 0) )
{
*((_DWORD *)v94 + 188) = (int)(float)((float)((float)((float)rand() / 32767.0) * 5.0) + 10.0);
v100 = rand();
*((_DWORD *)v94 + 187) = (int)(float)((float)((float)((float)v100 / 32767.0) + (float)((float)v100 / 32767.0)) + 1.0);
v101 = *((SpriteAnimationManager **)v94 + 83);
SpriteAnimationManager::overridePrio(v101);
m_paSprite = v101->m_sprite->m_paSprite;
if ( m_paSprite )
cocos2d::CCNode::stopAllActions(m_paSprite);
m_fbfSprite = v101->m_sprite->m_fbfSprite;
if ( m_fbfSprite )
cocos2d::CCNode::stopAllActions(m_fbfSprite);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v94);
}
else
{
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v94 + 8LL))(v94, 1);
v94 = nullptr;
}
a1->m_shopKeeper = (AnimatedShopKeeper *)v94;
v104 = ((float (__fastcall *)(GJShopLayer *, void *, __int64))a1->addChild_0)(a1, v94, 3);
v105 = a1->m_shopKeeper->__vftable;
cocos2d::CCPoint::CCPoint(v104, (float)((float)(v227 * 0.5) + 100.0) + 0.0);
v105->setPosition_0(a1->m_shopKeeper, v106);
v107 = cocos2d::CCCallFunc::create(a1->m_shopKeeper, AnimatedShopKeeper::startAnimating);
v108 = cocos2d::CCDelayTime::create(0.1);
v109 = cocos2d::CCSequence::create(v108, v107, 0);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_shopKeeper, (cocos2d::CCPoint)v109, v110, v2, v219);
if ( a1->m_type == Community )
{
v111 = v251;
if ( v253 > 0xF )
v111 = (void **)v251[0];
*(_OWORD *)Block = 0;
v239 = 0;
v240 = 0;
v112 = -1;
do
++v112;
while ( *((_BYTE *)v111 + v112) );
sub_14003A930(Block, v111, v112);
v113 = sub_140048500((__int64)Block);
v223 = (cocos2d::CCArray *)v113;
sub_14003A830((__int64)Block);
v114 = -120.0;
do
v114 = v114 + 360.0;
while ( v114 < 0.0 );
v115 = (float)(v114 / 360.0) * 6.283185307179586;
v113->m_hue = v115;
CCSpriteWithHue::updateColorMatrix(v113);
}
else
{
v116 = v251;
if ( v253 > 0xF )
v116 = (void **)v251[0];
v113 = (CCSpriteWithHue *)cocos2d::CCSprite::createWithSpriteFrameName((const char *)v116);
v223 = (cocos2d::CCArray *)v113;
}
v117 = ((float (__fastcall *)(GJShopLayer *, CCSpriteWithHue *, __int64))a1->addChild_0)(a1, v113, 1);
v118 = v113->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v117, v227 * 0.5);
v118->setPosition_0(v113, v119);
((void (__fastcall *)(CCSpriteWithHue *))v113->setScaleX)(v113);
if ( v230 != Secret )
{
if ( v230 == Mechanic )
{
v221 = -20561;
v222 = -81;
(**((void (__fastcall ***)(char *, __int16 *))Src + 40))((char *)Src + 320, &v221);
goto LABEL_163;
}
if ( v230 )
{
if ( v230 == Community )
{
v126 = cocos2d::CCMenu::create(v120);
v127 = ((float (__fastcall *)(GJShopLayer *, __int64, __int64))a1->addChild_0)(a1, v126, 0xFFFFFFFFLL);
v128 = *(_QWORD *)v126;
cocos2d::CCPoint::CCPoint(v127, (float)(v227 - 40.0) - 0.0);
(*(void (__fastcall **)(__int64, __int64))(v128 + 184))(v126, v129);
v130 = cocos2d::CCSprite::createWithSpriteFrameName("communityCreditsBtn_001.png");
v131 = CCMenuItemSpriteExtra::create(
v130,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)GJShopLayer::onCommunityCredits);
HIDWORD(v131->m_pfnSelector.adj) = 1067030938;
(*(void (__fastcall **)(__int64, CCMenuItemSpriteExtra *))(*(_QWORD *)v126 + 448LL))(v126, v131);
}
goto LABEL_163;
}
v121 = cocos2d::CCSprite::createWithSpriteFrameName("plushies_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v121->setScale_0)(v121);
v224 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v122 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v224);
if ( v122 )
{
if ( CCMenuItemSpriteExtra::init(v122, v121, nullptr, a1, (cocos2d::SEL_MenuHandler *)guard_check_icall_nop) )
{
cocos2d::CCObject::autorelease(v122);
LABEL_160:
LOWORD(v122->m_scaleMultiplier) = 256;
v123 = cocos2d::CCMenu::createWithItem(v122);
v124 = ((float (__fastcall *)(GJShopLayer *, struct cocos2d::CCMenu *, _QWORD))a1->addChild_0)(a1, v123, 0);
cocos2d::CCPoint::CCPoint(v124, -130.0);
v125 = ((__int64 (__fastcall *)(cocos2d::CCArray *))v223->__vftable[2].getTag)(v223);
cocos2d::CCPoint::operator+(v125, &v226);
v123->setPosition_0(v123, (const cocos2d::CCPoint *)&v226);
v123->setEnabled(v123, 0);
goto LABEL_163;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v122->~CCMenuItemSpriteExtra)(v122, 1);
}
v122 = nullptr;
goto LABEL_160;
}
v221 = -256;
v222 = -1;
(**((void (__fastcall ***)(char *, __int16 *))Src + 40))((char *)Src + 320, &v221);
v221 = -256;
v222 = -1;
v113->setColor(&v113->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v221);
LABEL_163:
v132 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v133 = CCMenuItemSpriteExtra::create(v132, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJShopLayer::onBack);
v226 = v133;
HIDWORD(v133->m_pfnSelector.adj) = 1070386381;
v134 = cocos2d::CCMenu::create(v133, 0);
a1->addChild_0(a1, v134, 1);
v135 = v134->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v137 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v136);
cocos2d::CCDirector::getScreenTop(v137);
v139 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v138);
v140 = cocos2d::CCDirector::getScreenLeft(v139) + 24.0;
cocos2d::CCPoint::CCPoint(v140, v140);
v135->setPosition_0(v134, v141);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v143, v142) + 197) )
GameToolbox::addBackButton(a1, v226);
v224 = (CCMenuItemSpriteExtra *)Block;
*(_OWORD *)Block = 0;
v239 = 0;
v240 = 0;
v148 = &v244;
if ( v14 > 0xF )
v148 = (__int64 *)v15;
if ( v13 > 0x7FFFFFFFFFFFFFFFLL )
sub_140007B50(v145, v144, v146, v147);
v240 = 15;
if ( v13 > 0xF )
{
if ( (v13 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
v16 = v13 | 0xF;
if ( (v13 | 0xF) < 0x16 )
v16 = 22;
}
Block[0] = sub_14003AA10(v16 + 1);
v239 = v13;
v240 = v16;
memcpy(Block[0], v148, v13 + 1);
}
else
{
v239 = v13;
*(_OWORD *)Block = *(_OWORD *)v148;
}
v149 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v226 = (CCMenuItemSpriteExtra *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine((FMODAudioEngine *)v226);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v149 = (FMODAudioEngine *)qword_1406C2E88;
}
FMODAudioEngine::playMusic(v149, (__int64)Block, 1, 0.0);
v150 = (GameStatsManager *)qword_1406C2EE8;
if ( a1->m_type == Diamond )
{
if ( !qword_1406C2EE8 )
{
v224 = (CCMenuItemSpriteExtra *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v224);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v150 = (GameStatsManager *)qword_1406C2EE8;
}
v151 = (const char *)&word_14055A524;
}
else
{
if ( !qword_1406C2EE8 )
{
v224 = (CCMenuItemSpriteExtra *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v224);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v150 = (GameStatsManager *)qword_1406C2EE8;
}
v151 = "14";
}
Stat = GameStatsManager::getStat(v150, v151);
v153 = (CCMenuItemSpriteExtra *)operator new(0x238u);
v224 = v153;
cocos2d::CCLabelBMFont::CCLabelBMFont((cocos2d::CCLabelBMFont *)v153);
v153->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (CCMenuItemSpriteExtra_vtbl *)&CCCounterLabel::`vftable';
v153->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&CCCounterLabel::`vftable';
v153->m_pfnSelector.ptr = (void (__cdecl *)(cocos2d::CCObject *))&CCCounterLabel::`vftable';
v153->m_pfnSelector.adj = (size_t)&CCCounterLabel::`vftable';
*(_QWORD *)&v153[1].m_uID = 0;
v153[1].m_nTag = 0;
LOBYTE(v153[1].m_uReference) = 0;
v153[1].m_uAutoReleaseCount = 10;
LOBYTE(v153[1].m_eObjType) = 0;
v153[1].m_uIndexInArray = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v226);
if ( cocos2d::CCLabelBMFont::initWithString(
(cocos2d::CCLabelBMFont *)v153,
" ",
(const char *)&qword_14052A4D8,
-1.0,
kCCTextAlignmentLeft,
v154) )
{
v153[1].m_uIndexInArray = 0;
v153[1].m_nLuaID = Stat;
v153[1].m_nTag = Stat;
CCCounterLabel::updateString((CCCounterLabel *)v153);
cocos2d::CCObject::autorelease(v153);
}
else
{
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v153->~CCMenuItemSpriteExtra)(v153, 1);
v153 = nullptr;
}
a1->m_currencyLabel = (CCCounterLabel *)v153;
v155 = ((float (__fastcall *)(GJShopLayer *, CCMenuItemSpriteExtra *, __int64))a1->addChild_0)(a1, v153, 3);
v156 = a1->m_currencyLabel->__vftable;
cocos2d::CCPoint::CCPoint(v155, (float)(v227 - 34.0) - 0.0);
v158 = ((float (__fastcall *)(CCCounterLabel *, __int64))v156->setPosition_0)(a1->m_currencyLabel, v157);
v159 = a1->m_currencyLabel->__vftable;
cocos2d::CCPoint::CCPoint(v158, 1.0);
v159->setAnchorPoint(a1->m_currencyLabel, v160);
((void (__fastcall *)(CCCounterLabel *))a1->m_currencyLabel->setScale_0)(a1->m_currencyLabel);
v161 = &xmmword_14053DCE8;
if ( a1->m_type == Diamond )
v161 = (__int128 *)"currencyDiamondIcon_001.png";
v257 = 0;
v258 = 0;
v259 = 0;
v162 = -1;
do
++v162;
while ( *((_BYTE *)v161 + v162) );
sub_14003A930(&v257, v161, v162);
v163 = (const char *)&v257;
if ( v259 > 0xF )
v163 = (const char *)v257;
v164 = cocos2d::CCSprite::createWithSpriteFrameName(v163);
v165 = ((float (__fastcall *)(GJShopLayer *, struct cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v164, 3);
cocos2d::CCPoint::CCPoint(v165, 13.0);
v166 = a1->m_currencyLabel->getPosition_0(a1->m_currencyLabel);
cocos2d::CCPoint::operator+(v166, &v226);
v164->setPosition_0(v164, (const cocos2d::CCPoint *)&v226);
v167 = cocos2d::CCParticleSystemQuad::create("keyEffect.plist", 0);
v167->setTotalParticles(v167, 8u);
*(_OWORD *)Block = xmmword_140624300;
v167->setStartColor(v167, (const cocos2d::ccColor4F *)Block);
*(_OWORD *)Block = xmmword_1406241F0;
v167->setEndColor(v167, (const cocos2d::ccColor4F *)Block);
*(_OWORD *)Block = 0;
v167->setStartColorVar(v167, (const cocos2d::ccColor4F *)Block);
*(_OWORD *)Block = 0;
v167->setEndColorVar(v167, (const cocos2d::ccColor4F *)Block);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v167->setLife)(v167);
v168 = ((float (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v167->setLifeVar)(v167);
v169 = v167->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v170 = cocos2d::CCPoint::CCPoint(v168, 12.0);
v169->setPosVar(v167, v171);
a1->addChild_0(a1, v167, 100);
v172 = v167->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v173 = (__int64)v164->getPosition_0(v164);
v172->setPosition_0(v167, (const cocos2d::CCPoint *)v173);
v167->setPositionType(v167, kCCPositionTypeGrouped);
cocos2d::CCParticleSystem::resetSystem(v167);
v223 = (cocos2d::CCArray *)cocos2d::CCArray::create(v174);
v176 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v224 = (CCMenuItemSpriteExtra *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v224);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v176 = qword_1406C2EE8;
}
v177 = *(cocos2d::CCArray **)(v176 + 520);
v178 = (cocos2d::CCArray *)cocos2d::CCArray::create(v175);
v224 = (CCMenuItemSpriteExtra *)v178;
v179 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v226 = (CCMenuItemSpriteExtra *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v226);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v179 = (GameManager *)qword_1406C2ED8;
}
UGV = GameManager::getUGV(v179, (const char *)&word_140531E88);
for ( i = 0; i < cocos2d::CCArray::count(v177); ++i )
{
v183 = cocos2d::CCArray::objectAtIndex(v177, i);
m_type = a1->m_type;
if ( m_type == v183[6].m_uIndexInArray && (m_type != Secret || UGV || v183[5].m_unknown2 - v183[5].m_nZOrder != 20) )
cocos2d::CCArray::addObject(v178, v183);
}
v185 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v182);
a1->m_shopItems = v185;
cocos2d::CCObject::retain(v185);
cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png");
v226 = (CCMenuItemSpriteExtra *)cocos2d::CCArray::create(v186);
v187 = 0;
LODWORD(Src) = 0;
if ( cocos2d::CCArray::count(v178) )
{
do
{
v188 = cocos2d::CCArray::objectAtIndex(v178, v187);
v189 = v188[5].m_unknown5 - LODWORD(v188[6].__vftable);
v190 = v188[6].m_uID - v188[6].m_nLuaID;
LODWORD(v170) = 0;
v262 = 0;
v263 = 0;
v264 = 15;
LOBYTE(v262) = 0;
v191 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v235 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v235);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v191 = (GameStatsManager *)qword_1406C2EE8;
}
isStoreItemUnlocked = GameStatsManager::isStoreItemUnlocked(v191, v188[5].m_unknown2 - v188[5].m_nZOrder);
LOBYTE(v225) = isStoreItemUnlocked;
v194 = (unsigned int)(v190 - 8) > 1 && v190 != 1;
StoreItem = GJItemIcon::createStoreItem(v190, v189, isStoreItemUnlocked, v193);
((void (__fastcall *)(GJItemIcon *))StoreItem->setScale_0)(StoreItem);
v236 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v196 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v236);
if ( v196 )
{
if ( CCMenuItemSpriteExtra::init(
v196,
StoreItem,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)GJShopLayer::onSelectItem) )
{
cocos2d::CCObject::autorelease(v196);
goto LABEL_215;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v196->~CCMenuItemSpriteExtra)(v196, 1);
}
v196 = nullptr;
LABEL_215:
HIDWORD(v196->m_pfnSelector.adj) = 0x40000000;
cocos2d::CCArray::addObject(v223, v196);
v196->setTag(v196, v188[5].m_unknown2 - v188[5].m_nZOrder);
StoreItem->setTag(StoreItem, v190);
if ( v194 )
cocos2d::CCArray::addObject((cocos2d::CCArray *)v226, v196);
if ( !(_BYTE)v225 )
{
GameToolbox::pointsToString(&v260, v188[6].m_uReference - v188[6].m_uAutoReleaseCount);
v198 = &v260;
if ( v261 > 0xF )
v198 = (__m128i *)v260.m128i_i64[0];
v199 = cocos2d::CCLabelBMFont::create(v198->m128i_i8, (const char *)&qword_14052A4D8);
StoreItem->addChild_1(StoreItem, v199);
v200 = v199->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v201 = (float *)StoreItem->getContentSize(StoreItem);
cocos2d::CCPoint::CCPoint(0.0, (float)(*v201 * 0.5) - 4.0);
v200->setPosition_0(v199, v202);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v199->setScale_0)(v199);
v199->setTag(v199, 1234);
v203 = &xmmword_14053DCE8;
v204 = v230;
if ( v230 == Diamond )
v203 = (__int128 *)"currencyDiamondIcon_001.png";
v254 = 0;
v255 = 0;
v256 = 0;
v205 = -1;
do
++v205;
while ( *((_BYTE *)v203 + v205) );
sub_14003A930(&v254, v203, v205);
v206 = (const char *)&v254;
if ( v256 > 0xF )
v206 = (const char *)v254;
v207 = cocos2d::CCSprite::createWithSpriteFrameName(v206);
StoreItem->addChild_1(StoreItem, v207);
v208 = v199->getContentSize(v199)->width * 0.5;
v209 = ((double (__fastcall *)(struct cocos2d::CCLabelBMFont *))v199->getScale)(v199);
cocos2d::CCPoint::CCPoint(
(float)(v204 == Diamond),
(float)((float)(*(float *)&v209 * v208) + 6.0) + (float)(v204 == Diamond));
v210 = (__int64)v199->getPosition_0(v199);
cocos2d::CCPoint::operator+(v210, &v231);
v170 = ((double (__fastcall *)(struct cocos2d::CCSprite *, void ***))v207->setPosition_0)(v207, &v231);
((void (__fastcall *)(struct cocos2d::CCSprite *))v207->setScale_0)(v207);
v207->setTag(v207, 1234);
sub_14003A830((__int64)&v254);
sub_14003A830((__int64)&v260);
goto LABEL_240;
}
v196->setEnabled(v196, 0);
switch ( a1->m_type )
{
case Secret:
v221 = 7690;
goto LABEL_229;
case Community:
v221 = 5665;
v197 = 66;
break;
case Mechanic:
v221 = 5140;
v197 = 40;
break;
case Diamond:
v221 = 7700;
v197 = 50;
break;
case Paths:
v221 = 12850;
v197 = 50;
break;
default:
v221 = 7740;
LABEL_229:
v197 = 20;
break;
}
*(_WORD *)&v229.r = v221;
v229.b = v197;
GJItemIcon::darkenStoreItem(StoreItem, &v229);
LABEL_240:
cocos2d::CCDictionary::setObject(a1->m_shopItems, v196, v188[5].m_unknown2 - v188[5].m_nZOrder);
LODWORD(Src) = (_DWORD)Src + 1;
v187 = (unsigned int)Src;
v178 = (cocos2d::CCArray *)v224;
}
while ( v187 < cocos2d::CCArray::count((cocos2d::CCArray *)v224) );
}
cocos2d::CCPoint::CCPoint(*(float *)&v170, v227 * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block);
v212 = ListButtonBar::create(v223, v211, 4, 2, 25.0, 15.0, 60.0, 221.0, v220);
a1->addChild_0(a1, v212, 100);
v212->m_useMoveAnimation = 1;
v212->m_scrollLayer->m_unkFloat2 = 0.60000002;
LOBYTE(v213) = 1;
v212->m_scrollLayer->setTouchEnabled(v212->m_scrollLayer, v213);
m_scrollLayer = v212->m_scrollLayer;
if ( m_scrollLayer->m_dynamic )
m_dynamicObjects = m_scrollLayer->m_dynamicObjects;
else
m_dynamicObjects = m_scrollLayer->m_pages;
cocos2d::CCArray::count(m_dynamicObjects);
v216 = v212->m_scrollLayer;
if ( v212->m_useMoveAnimation )
{
BoomScrollLayer::moveToPage(v216, 0);
}
else
{
BoomScrollLayer::instantMoveToPage(v216, -1);
BoomScrollLayer::instantMoveToPage(v212->m_scrollLayer, 0);
}
m_delegate = v212->m_delegate;
if ( m_delegate )
m_delegate->listButtonBarSwitchedPage(m_delegate, v212, 0);
v212->m_scrollLayer->m_doVisit = 1;
cocos2d::CCSize::CCSize(&v234, 406.0, 200.0);
cocos2d::CCRect::CCRect(
&v237,
v232 - (float)(v234.width * 0.5),
v233 - (float)(v234.height * 0.5),
v234.width,
v234.height);
cocos2d::CCRect::operator=(&v212->m_scrollLayer->m_clippingRect, v218);
sub_14003A830((__int64)&v257);
sub_14003A830((__int64)&v244);
sub_14003A830((__int64)v241);
sub_14003A830((__int64)v251);
sub_14003A830((__int64)v248);
return 1;
}