//
// ShardsPage::init from 0x4fb3a8 to 0x4fc568 (4544 bytes)
//
// 1 xrefs:
// > ShardsPage::create @ 0x4fb28c
//
// 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 ShardsPage::init(ShardsPage *a1)
{
cocos2d::CCDirector *v2; // r0
cocos2d::CCNode *v3; // r5
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCNode *v6; // r0
int v7; // r5
cocos2d::CCSprite *v8; // r6
float v9; // s15
float v10; // s14
void (__fastcall *v11)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v12; // r7
void (__fastcall *v13)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v14; // r7
void (__fastcall *v15)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v16; // r7
void (__fastcall *v17)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCDictionary *v18; // r0
cocos2d::CCSprite *v19; // r0
CCMenuItemSpriteExtra *v20; // r6
cocos2d::CCMenu *v21; // r0
float v22; // s15
float v23; // s19
cocos2d::CCMenu_vtbl *v24; // r3
cocos2d::CCMenu *v25; // r6
void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
intptr_t v27; // s15
cocos2d::CCArray *v28; // r11
GameStatsManager *v29; // r0
const char *v30; // r5
char *v31; // r1
GameStatsManager *v32; // r0
int Stat; // r0
GameStatsManager *v34; // r0
int v35; // r0
GameStatsManager *v36; // r0
GameStatsManager *v37; // r0
GameStatsManager *v38; // r0
char *v39; // r1
GameStatsManager *v40; // r0
GameStatsManager *v41; // r0
GameStatsManager *v42; // r0
GameStatsManager *v43; // r0
const char *v44; // r3
const char *v45; // r3
cocos2d::CCSprite *v46; // r7
void (__fastcall *v47)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCString *v48; // r0
cocos2d::CCLabelBMFont *v49; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r9
int v51; // r9
float *v52; // r0
cocos2d::CCSprite *v53; // r7
void (__fastcall *v54)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v55; // r9
cocos2d::CCString *v56; // r0
char *CString; // r0
GameManager *v58; // r6
GJItemIcon *v59; // r8
CCMenuItemSpriteExtra *v60; // r6
int v61; // r2
void (__fastcall *v62)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r9
int v63; // r0
float width; // s18
int v65; // r0
cocos2d::CCString *v66; // r0
cocos2d::CCLabelBMFont *v67; // r7
void (__fastcall *v68)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *v69)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
float v70; // r1
cocos2d::CCSprite *v71; // r6
void (__fastcall *v72)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v73; // r9
cocos2d::CCSprite *v74; // r6
void (__fastcall *v75)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // r7
float *v77; // r0
void (__fastcall *setScaleY)(cocos2d::CCSprite *__hidden, float); // r7
int v79; // r0
int v80; // r3
float v81; // s16
cocos2d::CCSprite *v82; // r6
void (__fastcall *v83)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *v84)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v85)(cocos2d::CCSprite *__hidden, float); // r7
float *v86; // r0
void (__fastcall *v87)(cocos2d::CCSprite *__hidden, float); // r7
int v88; // r0
cocos2d::CCMenu *v89; // r0
float v90; // s16
cocos2d::CCNode *v91; // r7
cocos2d::CCSprite *v92; // r0
CCMenuItemSpriteExtra *v93; // r0
cocos2d::CCNode_vtbl *v94; // r3
void (__fastcall *v95)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v96; // r0
float v97; // r0
cocos2d::CCSprite *v98; // r9
CCMenuItemSpriteExtra *v99; // r0
cocos2d::CCNode_vtbl *v100; // r3
CCMenuItemSpriteExtra *m_nextButton; // r9
void (__fastcall *v102)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCDirector *v103; // r0
float v104; // r0
cocos2d::CCSprite *v105; // r0
cocos2d::CCSprite *m_tierSprite; // r7
void (__fastcall *v107)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
float v109; // r2
float v110; // r3
cocos2d::ccColor3B v111; // [sp+Ch] [bp-D8h]
void (__fastcall *v112)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+10h] [bp-D4h]
void (__fastcall *v113)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+10h] [bp-D4h]
int i; // [sp+10h] [bp-D4h]
CCMenuItemSpriteExtra *m_prevButton; // [sp+10h] [bp-D4h]
int v116; // [sp+14h] [bp-D0h]
int v117; // [sp+18h] [bp-CCh]
int v118; // [sp+1Ch] [bp-C8h]
char v119; // [sp+20h] [bp-C4h]
int v120; // [sp+24h] [bp-C0h]
cocos2d::CCSprite *v121; // [sp+28h] [bp-BCh]
void (__fastcall *v122)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-B0h]
void (__fastcall *v123)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-B0h]
void (__fastcall *v124)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-B0h]
cocos2d::CCMenu *m_buttonMenu; // [sp+38h] [bp-ACh]
int v126; // [sp+58h] [bp-8Ch] BYREF
int v127; // [sp+5Ch] [bp-88h] BYREF
__int16 v128; // [sp+60h] [bp-84h] BYREF
char v129; // [sp+62h] [bp-82h]
__int16 v130; // [sp+64h] [bp-80h] BYREF
char v131; // [sp+66h] [bp-7Eh]
int v132; // [sp+68h] [bp-7Ch]
cocos2d::CCSprite *v133; // [sp+6Ch] [bp-78h] BYREF
cocos2d::CCSprite *v134; // [sp+70h] [bp-74h] BYREF
char *v135; // [sp+74h] [bp-70h] BYREF
char v136[4]; // [sp+78h] [bp-6Ch] BYREF
UnlockType v137; // [sp+7Ch] [bp-68h] BYREF
int v138; // [sp+80h] [bp-64h] BYREF
cocos2d::CCSize v139; // [sp+84h] [bp-60h] BYREF
cocos2d::CCPoint v140; // [sp+8Ch] [bp-58h] BYREF
cocos2d::CCPoint v141; // [sp+94h] [bp-50h] BYREF
_BYTE v142[8]; // [sp+9Ch] [bp-48h] BYREF
cocos2d::CCPoint v143; // [sp+A4h] [bp-40h] BYREF
cocos2d::CCPoint v144; // [sp+ACh] [bp-38h] BYREF
void (*v145)(ShardsPage *, cocos2d::CCObject *); // [sp+B4h] [bp-30h]
int v146; // [sp+B8h] [bp-2Ch]
void (*v147)(ShardsPage *, cocos2d::CCObject *); // [sp+BCh] [bp-28h]
int v148; // [sp+C0h] [bp-24h]
cocos2d::CCPoint v149; // [sp+C4h] [bp-20h] BYREF
cocos2d::CCRect v150; // [sp+CCh] [bp-18h] BYREF
cocos2d::CCSize v151; // 0:^0.8
cocos2d::CCRect v152; // 0:kr00_16.16
v120 = FLAlertLayer::init(a1, (cocos2d::_ccColor4B)150);
if ( v120 )
{
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v139, v2);
cocos2d::CCRect::CCRect(&v150, 0.0, 0.0, 80.0, 80.0);
v152.origin.x = v109;
v152.origin.y = v110;
v152.size = v151;
v3 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v150,
v152);
((void (__fastcall *)(cocos2d::CCNode *, int))v3->__vftable[1].~CCNode_0)(v3, 255);
setContentSize = v3->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v150, 420.0, 280.0);
setContentSize(v3, (const cocos2d::CCSize *)&v150);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v3, -1);
setPosition = v3->setPosition;
cocos2d::CCPoint::CCPoint(&v150.origin, v139.width * 0.5, v139.height * 0.5);
v6 = v3;
v7 = 0;
setPosition(v6, &v150.origin);
while ( 1 )
{
v8 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, 8);
if ( v7 == 2 )
{
cocos2d::CCSprite::setFlipX(v8, 1);
cocos2d::CCSprite::setFlipY(v8, 1);
v9 = 115.0;
}
else
{
if ( v7 != 3 )
{
if ( v7 == 1 )
{
cocos2d::CCSprite::setFlipY(v8, 1);
v9 = 115.0;
}
else
{
v9 = -115.0;
}
v10 = -185.0;
goto LABEL_12;
}
cocos2d::CCSprite::setFlipX(v8, 1);
v9 = -115.0;
}
v10 = 185.0;
LABEL_12:
++v7;
v11 = v8->setPosition;
cocos2d::CCPoint::CCPoint(&v150.origin, v10 + (float)(v139.width * 0.5), v9 + (float)(v139.height * 0.5));
v11(v8, &v150.origin);
if ( v7 == 4 )
{
cocos2d::CCPoint::CCPoint(&v140, v139.width * 0.5, (float)((float)(v139.height * 0.5) + 140.0) - 28.0);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("label_shards_001.png");
v13 = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v149, -80.0, 0.0);
cocos2d::CCPoint::operator+(&v150, &v140, &v149);
v13(v12, &v150.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v12);
v14 = cocos2d::CCSprite::createWithSpriteFrameName("label_of_001.png");
v15 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v149, 4.0, 0.0);
cocos2d::CCPoint::operator+(&v150, &v140, &v149);
v15(v14, &v150.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v14);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("label_power_001.png");
v17 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v149, 85.0, 0.0);
cocos2d::CCPoint::operator+(&v150, &v140, &v149);
v17(v16, &v150.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v16);
cocos2d::CCPoint::CCPoint(&v141, v139.width * 0.5, (float)(v139.height * 0.5) + 80.0);
v18 = cocos2d::CCDictionary::create();
a1->m_pages = v18;
cocos2d::CCObject::retain(v18);
v19 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v146 = 0;
v145 = ShardsPage::onClose;
v20 = CCMenuItemSpriteExtra::create(
v19,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ShardsPage::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v20, 1.6);
v21 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v20, nullptr);
v22 = (float)(v139.width * 0.5) - 210.0;
v23 = (float)(v139.height * 0.5) + 140.0;
v24 = v21->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v25 = v21;
a1->m_buttonMenu = v21;
v26 = v24->setPosition;
cocos2d::CCPoint::CCPoint(&v150.origin, v22 + 10.0, v23 - 10.0);
v26(v25, &v150.origin);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
v117 = -1;
v118 = -1;
v116 = 0;
v121 = cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png");
while ( 1 )
{
v27 = (int)floorf((float)(v116 / 3));
v28 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_pages, v27);
if ( !v28 )
{
v28 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(a1->m_pages, v28, v27);
}
v133 = (cocos2d::CCSprite *)&unk_ACDDA8;
v134 = (cocos2d::CCSprite *)&unk_ACDDA8;
v128 = -1;
v130 = -1;
v129 = -1;
v131 = -1;
sub_776584((int)&v135, (char *)&unk_939830);
switch ( v116 )
{
case 1:
sub_7753D4((int)&v133, "iceShardLabel_001.png");
sub_7753D4((int)&v134, "iceShardSmall_001.png");
v32 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v32, "19");
v128 = -156;
v30 = (const char *)Stat;
LOWORD(v126) = -27136;
BYTE2(v126) = -1;
v31 = "shardIce";
LOWORD(v127) = -256;
BYTE2(v127) = -1;
v129 = -1;
v130 = -256;
v131 = -1;
goto LABEL_22;
case 2:
sub_7753D4((int)&v133, "poisonShardLabel_001.png");
sub_7753D4((int)&v134, "poisonShardSmall_001.png");
v34 = GameStatsManager::sharedState();
v35 = GameStatsManager::getStat(v34, "17");
v128 = -181;
v129 = 75;
v30 = (const char *)v35;
LOWORD(v126) = -24576;
BYTE2(v126) = 0;
LOWORD(v127) = -256;
v31 = "shardPoison";
BYTE2(v127) = 0;
v130 = -256;
v131 = 0;
goto LABEL_22;
case 3:
sub_7753D4((int)&v133, "shadowShardLabel_001.png");
sub_7753D4((int)&v134, "shadowShardSmall_001.png");
v36 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v36, "16");
LOWORD(v126) = 150;
BYTE2(v126) = -56;
v31 = "shardShadow";
LOWORD(v127) = 13055;
BYTE2(v127) = -1;
v128 = 25855;
v129 = -1;
v130 = 255;
v131 = -1;
goto LABEL_22;
case 4:
sub_7753D4((int)&v133, "lavaShardLabel_001.png");
sub_7753D4((int)&v134, "lavaShardSmall_001.png");
v37 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v37, "20");
v129 = 50;
BYTE2(v127) = 25;
v31 = "shardLava";
LOWORD(v127) = 13055;
LOWORD(v126) = 175;
v128 = 13055;
BYTE2(v126) = 0;
v130 = 255;
v131 = 0;
goto LABEL_22;
case 5:
sub_7753D4((int)&v133, "bonusShardLabel_001.png");
sub_7753D4((int)&v134, "bonusShardSmall_001.png");
memset(&v126, 150, 3);
memset(&v127, 255, 3);
sub_7753D4((int)&v135, "shardBonus");
v30 = (const char *)v118;
goto LABEL_31;
case 6:
sub_7753D4((int)&v133, "shard0201ShardLabel_001.png");
sub_7753D4((int)&v134, "shard0201ShardSmall_001.png");
v38 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v38, "23");
LOWORD(v126) = 25251;
v39 = "shardEarth";
BYTE2(v126) = 70;
LOWORD(v127) = -7939;
BYTE2(v127) = -96;
goto LABEL_29;
case 7:
sub_7753D4((int)&v133, "shard0202ShardLabel_001.png");
sub_7753D4((int)&v134, "shard0202ShardSmall_001.png");
v40 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v40, "24");
LOWORD(v126) = 150;
LOWORD(v127) = 255;
v39 = "shardBlood";
BYTE2(v126) = 0;
BYTE2(v127) = 0;
goto LABEL_29;
case 8:
sub_7753D4((int)&v133, "shard0203ShardLabel_001.png");
sub_7753D4((int)&v134, "shard0203ShardSmall_001.png");
v41 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v41, "25");
memset(&v126, 128, 3);
v39 = "shardMetal";
memset(&v127, 255, 3);
goto LABEL_29;
case 9:
sub_7753D4((int)&v133, "shard0204ShardLabel_001.png");
sub_7753D4((int)&v134, "shard0204ShardSmall_001.png");
v42 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v42, "26");
LOWORD(v126) = -1281;
v39 = "shardLight";
LOWORD(v127) = -1;
BYTE2(v126) = 127;
BYTE2(v127) = -64;
goto LABEL_29;
case 10:
sub_7753D4((int)&v133, "shard0205ShardLabel_001.png");
sub_7753D4((int)&v134, "shard0205ShardSmall_001.png");
v43 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v43, "27");
v39 = "shardSoul";
strcpy((char *)&v126, "d");
BYTE2(v126) = -106;
LOWORD(v127) = 255;
BYTE2(v127) = 125;
LABEL_29:
sub_7753D4((int)&v135, v39);
if ( (int)v30 >= v117 )
goto LABEL_34;
v117 = (int)v30;
break;
case 11:
sub_7753D4((int)&v133, "bonusShardLabel_001.png");
sub_7753D4((int)&v134, "bonusShard2Small_001.png");
memset(&v126, 150, 3);
memset(&v127, 255, 3);
sub_7753D4((int)&v135, "shardBonusB");
v30 = (const char *)v117;
LABEL_34:
v45 = (const char *)v117;
if ( v117 == -1 )
v45 = v30;
v117 = (int)v45;
break;
default:
sub_7753D4((int)&v133, "fireShardLabel_001.png");
sub_7753D4((int)&v134, "fireShardSmall_001.png");
v29 = GameStatsManager::sharedState();
v30 = (const char *)GameStatsManager::getStat(v29, "18");
LOWORD(v126) = 19455;
BYTE2(v126) = 0;
v31 = "shardFire";
LOWORD(v127) = -14081;
BYTE2(v127) = 0;
v128 = -1;
v129 = 0;
v130 = -1;
v131 = 0;
LABEL_22:
sub_7753D4((int)&v135, v31);
if ( (int)v30 >= v118 )
{
LABEL_31:
v44 = (const char *)v118;
if ( v118 == -1 )
v44 = v30;
v118 = (int)v44;
}
else
{
v118 = (int)v30;
}
break;
}
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, (float)(-3 * v27 + v116) * -77.0);
cocos2d::CCPoint::operator+(v142, &v141, &v150);
v46 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v133);
a1->m_mainLayer->addChild(a1->m_mainLayer, v46);
v47 = v46->setPosition;
cocos2d::CCPoint::CCPoint(&v149, -20.0, 0.0);
cocos2d::CCPoint::operator+(&v150, v142, &v149);
v47(v46, &v150.origin);
cocos2d::CCArray::addObject(v28, v46);
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v30);
cocos2d::CCString::getCString(v48);
v49 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v49->setScale)(v49, 1055286886);
a1->m_mainLayer->addChild(a1->m_mainLayer, v49);
setAnchorPoint = v49->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
setAnchorPoint(v49, &v150.origin);
v112 = v49->setPosition;
v51 = (int)v46->getPosition(v46);
v52 = (float *)v46->getContentSize(v46);
cocos2d::CCPoint::CCPoint(&v149, (float)(*v52 * 0.5) + 5.0, 1.0);
cocos2d::CCPoint::operator+(&v150, v51, &v149);
v112(v49, &v150.origin);
cocos2d::CCArray::addObject(v28, v49);
v53 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v134);
a1->m_mainLayer->addChild(a1->m_mainLayer, v53);
v54 = v53->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
v54(v53, &v150.origin);
v113 = v53->setPosition;
v55 = (int)v49->getPosition(v49);
v49->getScaledContentSize((cocos2d::CCSize *)&v144, v49);
cocos2d::CCPoint::CCPoint(&v149, v144.x + 2.0, 0.0);
cocos2d::CCPoint::operator+(&v150, v55, &v149);
v113(v53, &v150.origin);
cocos2d::CCArray::addObject(v28, v53);
for ( i = 1; i != 6; ++i )
{
v119 = byte_9ACC70[i - 1];
v56 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"geometry.ach.%s%02d",
v135);
CString = (char *)cocos2d::CCString::getCString(v56);
sub_776584((int)v136, CString);
v137 = 0;
v138 = 0;
v58 = GameManager::sharedState();
sub_775C20(&v150);
GameManager::getUnlockForAchievement((int)v58, (const char **)&v150, &v138, (int *)&v137);
sub_774008(&v150);
if ( v137 > 0 )
{
*(_WORD *)&v111.r = -1;
v111.b = -1;
v59 = GJItemIcon::create(v137, v138, (cocos2d::ccColor3B)v126, (cocos2d::ccColor3B)v127, 0, 0, 0, v111);
((void (__fastcall *)(GJItemIcon *, int))v59->setScale)(v59, 1061997773);
if ( (int)v30 < v119 )
{
GJItemIcon::changeToLockedState(v59, 1.25);
LOWORD(v132) = 12375;
BYTE2(v132) = 29;
GJItemIcon::darkenStoreItem((int)v59, v132, v61);
}
v148 = 0;
v147 = ShardsPage::onIconInfo;
v60 = CCMenuItemSpriteExtra::create(
v59,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ShardsPage::onIconInfo, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v60);
v62 = v60->setContentSize;
v63 = (int)v121->getContentSize(v121);
v62(v60, (const cocos2d::CCSize *)v63);
v122 = v59->setPosition;
width = v60->getContentSize(v60)->width;
v65 = (int)v60->getContentSize(v60);
cocos2d::CCPoint::CCPoint(&v150.origin, width * 0.5, *(float *)(v65 + 4) * 0.5);
v122(v59, &v150.origin);
v60->setTag(v60, v116);
cocos2d::CCPoint::CCPoint(&v150.origin, (float)(i - 3) * 70.0, -30.0);
cocos2d::CCPoint::operator+(&v143, v142, &v150);
v123 = v60->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCNode::convertToWorldSpace(&v149, a1->m_mainLayer, &v143);
cocos2d::CCNode::convertToNodeSpace(&v150.origin, m_buttonMenu, &v149);
v123(v60, &v150.origin);
cocos2d::CCArray::addObject(v28, v60);
if ( (int)v30 < v119 )
{
v66 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)v119);
cocos2d::CCString::getCString(v66);
v67 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v67->setScale)(v67, 1050253722);
a1->m_mainLayer->addChild(a1->m_mainLayer, v67);
v68 = v67->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
v68(v67, &v150.origin);
v69 = v67->setPosition;
if ( v119 > 9 )
v70 = -10.0;
else
v70 = -8.0;
cocos2d::CCPoint::CCPoint(&v149, v70, -22.0);
cocos2d::CCPoint::operator+(&v150, &v143, &v149);
v69(v67, &v150.origin);
v67->setColor(v67, (const cocos2d::ccColor3B *)&v128);
cocos2d::CCArray::addObject(v28, v67);
v71 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v134);
a1->m_mainLayer->addChild(a1->m_mainLayer, v71);
((void (__fastcall *)(cocos2d::CCSprite *, int))v71->setScale)(v71, 1060320051);
v72 = v71->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
v72(v71, &v150.origin);
v124 = v71->setPosition;
v73 = (int)v67->getPosition(v67);
v67->getScaledContentSize((cocos2d::CCSize *)&v144, v67);
cocos2d::CCPoint::CCPoint(&v149, v144.x + 2.0, 0.0);
cocos2d::CCPoint::operator+(&v150, v73, &v149);
v124(v71, &v150.origin);
cocos2d::CCArray::addObject(v28, v71);
}
if ( i != 1 )
{
cocos2d::CCPoint::CCPoint(&v150.origin, -51.0, 0.0);
cocos2d::CCPoint::operator+(&v144, &v143, &v150);
v74 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
v75 = v74->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
v75(v74, &v150.origin);
v74->setPosition(v74, &v144);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v74, 0);
setScaleX = v74->setScaleX;
v77 = (float *)v74->getContentSize(v74);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))setScaleX)(v74, 32.0 / *v77);
setScaleY = v74->setScaleY;
v79 = (int)v74->getContentSize(v74);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))setScaleY)(v74, 5.0 / *(float *)(v79 + 4));
v74->setColor(v74, (const cocos2d::ccColor3B *)&unk_9ACC75);
v74->setOpacity(v74, 110);
cocos2d::CCArray::addObject(v28, v74);
if ( (unsigned int)(i - 2) > 3 )
v80 = 0;
else
v80 = *((char *)&word_9ACC6C + i + 10);
v81 = (float)(int)&v30[-v80] / (float)(v119 - v80);
if ( v81 >= 1.0 )
{
v81 = 1.0;
}
else if ( v81 <= 0.0 )
{
goto LABEL_58;
}
v82 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
v83 = v82->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v150.origin, 0.0, 0.5);
v83(v82, &v150.origin);
v84 = v82->setPosition;
cocos2d::CCPoint::CCPoint(&v149, 2.0, 0.0);
cocos2d::CCPoint::operator+(&v150, &v144, &v149);
v84(v82, &v150.origin);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v82, 1);
v85 = v82->setScaleX;
v86 = (float *)v82->getContentSize(v82);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v85)(v82, (float)(v81 * 28.0) / *v86);
v87 = v82->setScaleY;
v88 = (int)v82->getContentSize(v82);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v87)(v82, 2.0 / *(float *)(v88 + 4));
v82->setColor(v82, (const cocos2d::ccColor3B *)&v130);
cocos2d::CCArray::addObject(v28, v82);
}
}
LABEL_58:
sub_774008(v136);
}
sub_774008(&v135);
sub_774008(&v134);
sub_774008(&v133);
if ( ++v116 == 12 )
{
v89 = cocos2d::CCMenu::create();
v90 = v139.height * 0.5;
v91 = v89;
v92 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v149.y = 0.0;
LODWORD(v149.x) = ShardsPage::onSwitchPage;
v93 = CCMenuItemSpriteExtra::create(
v92,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ShardsPage::onSwitchPage, (unsigned int)a1));
v94 = v91->__vftable;
a1->m_prevButton = v93;
v94->addChild(v91, v93);
m_prevButton = a1->m_prevButton;
v95 = m_prevButton->setPosition;
v96 = cocos2d::CCDirector::sharedDirector();
v97 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v96));
cocos2d::CCPoint::CCPoint(&v144, v97 + 24.0, v90);
cocos2d::CCNode::convertToNodeSpace(&v150.origin, v91, &v144);
v95(m_prevButton, &v150.origin);
a1->m_prevButton->setTag(a1->m_prevButton, 0);
CCMenuItemSpriteExtra::setSizeMult(a1->m_prevButton, 1.4);
v98 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v98, 1);
LODWORD(v150.origin.x) = ShardsPage::onSwitchPage;
v150.origin.y = 0.0;
v99 = CCMenuItemSpriteExtra::create(
v98,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ShardsPage::onSwitchPage, (unsigned int)a1));
v100 = v91->__vftable;
a1->m_nextButton = v99;
v100->addChild(v91, v99);
m_nextButton = a1->m_nextButton;
v102 = m_nextButton->setPosition;
v103 = cocos2d::CCDirector::sharedDirector();
v104 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v103));
cocos2d::CCPoint::CCPoint(&v143, v104 - 24.0, v90);
cocos2d::CCNode::convertToNodeSpace(&v144, v91, &v143);
v102(m_nextButton, &v144);
a1->m_nextButton->setTag(a1->m_nextButton, 1);
CCMenuItemSpriteExtra::setSizeMult(a1->m_nextButton, 1.4);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v91, 10);
v105 = cocos2d::CCSprite::createWithSpriteFrameName("tier1Icon_001.png");
a1->m_tierSprite = v105;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v105, 10);
m_tierSprite = a1->m_tierSprite;
v107 = m_tierSprite->setPosition;
cocos2d::CCPoint::CCPoint(
&v144,
(float)((float)(v139.width * 0.5) + 210.0) - 18.0,
(float)((float)(v139.height * 0.5) + 140.0) - 18.0);
v107(m_tierSprite, &v144);
ShardsPage::goToPage(a1, 0);
return v120;
}
}
}
}
}
return v120;
}