//
// ShardsPage::init from 0x1004c5b30 to 0x1004c7307 (6103 bytes)
//
// 2 xrefs:
// > ShardsPage::create @ 0x1004c5af6
// > ??> @ 0x100950180
//
// 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 ShardsPage::init(ShardsPage *a1)
{
bool result; // al
cocos2d::extension::CCScale9Sprite *v3; // rbx
cocos2d::CCLayer *m_mainLayer; // rdi
cocos2d::CCLayer_vtbl *v5; // rax
cocos2d::CCSprite *v6; // rbx
cocos2d::CCSprite *v7; // rbx
cocos2d::CCSprite *v8; // rbx
cocos2d::CCSprite *v9; // rbx
cocos2d::CCSprite *v10; // r14
cocos2d::CCSprite *v11; // r14
cocos2d::CCSprite *v12; // r14
ShardsPage *v13; // r12
cocos2d::CCDictionary *v14; // rax
cocos2d::CCSprite *v15; // rax
CCMenuItemSpriteExtra *v16; // rax
int v17; // edx
int v18; // ecx
int v19; // r8d
int v20; // r9d
__int64 v21; // rbx
unsigned int v22; // ebx
cocos2d::CCDictionary *m_pages; // rdi
intptr_t v24; // rsi
cocos2d::CCObject *v25; // rax
cocos2d::CCDictionary *v26; // rdi
GameStatsManager *v27; // rax
GameStatsManager *v28; // rax
GameStatsManager *v29; // rax
GameStatsManager *v30; // rax
GameStatsManager *v31; // rax
GameStatsManager *v32; // rax
GameStatsManager *v33; // rax
int v34; // eax
GameStatsManager *v35; // rax
GameStatsManager *v36; // rax
GameStatsManager *v37; // rax
int v38; // eax
const char *data; // rdi
cocos2d::CCSprite *v40; // r14
cocos2d::CCString *v41; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v43; // r12
unsigned __int64 *v44; // rbx
float *v45; // rax
const char *v46; // rdi
cocos2d::CCSprite *v47; // rbx
unsigned __int64 *v48; // r14
int v49; // r12d
__int64 v50; // rcx
__int64 v51; // xmm0_8
cocos2d::CCString *v52; // rax
const char *v53; // rbx
size_t v54; // rax
size_t v55; // r14
char *v56; // r15
size_t v57; // r13
GameManager *v58; // rbx
char v59; // r13
GJItemIcon *v60; // rbx
CCMenuItemSpriteExtra *v61; // r14
__int64 v62; // rax
__int64 v63; // rax
const cocos2d::CCPoint *m_buttonMenu; // rbx
cocos2d::CCString *v65; // rax
const char *v66; // rax
cocos2d::CCLabelBMFont *v67; // r14
const char *v68; // rdi
cocos2d::CCSprite *v69; // rbx
unsigned __int64 *v70; // r15
cocos2d::CCSprite *v71; // rbx
float *v72; // rax
__int64 v73; // rax
cocos2d::CCSprite *v74; // r14
float *v75; // rax
__int64 v76; // rax
cocos2d::CCMenu *v77; // r14
cocos2d::CCSprite *v78; // rax
CCMenuItemSpriteExtra *v79; // rax
CCMenuItemSpriteExtra *m_prevButton; // r15
cocos2d::CCDirector *v81; // rax
float v82; // xmm0_4
cocos2d::CCSprite *v83; // rbx
CCMenuItemSpriteExtra *v84; // rax
CCMenuItemSpriteExtra *m_nextButton; // rbx
cocos2d::CCDirector *v86; // rax
cocos2d::CCSprite *v87; // rax
cocos2d::CCSprite *m_tierSprite; // rbx
char v89; // [rsp+0h] [rbp-160h]
unsigned __int64 v90; // [rsp+18h] [rbp-148h] BYREF
unsigned __int64 v91; // [rsp+20h] [rbp-140h] BYREF
cocos2d::CCSprite *v92; // [rsp+28h] [rbp-138h]
__int128 v93; // [rsp+30h] [rbp-130h] BYREF
void *__p; // [rsp+40h] [rbp-120h]
unsigned __int64 v95; // [rsp+48h] [rbp-118h] BYREF
__int64 v96; // [rsp+50h] [rbp-110h]
unsigned __int64 v97; // [rsp+58h] [rbp-108h] BYREF
unsigned int v98; // [rsp+60h] [rbp-100h]
float v99; // [rsp+64h] [rbp-FCh]
__int128 __dst; // [rsp+68h] [rbp-F8h] BYREF
void *v101; // [rsp+78h] [rbp-E8h]
unsigned __int64 v102; // [rsp+84h] [rbp-DCh] BYREF
UnlockType v103; // [rsp+8Ch] [rbp-D4h] BYREF
int v104; // [rsp+90h] [rbp-D0h] BYREF
float v105; // [rsp+94h] [rbp-CCh]
std::string v106; // [rsp+98h] [rbp-C8h] BYREF
unsigned int v107; // [rsp+B4h] [rbp-ACh]
int v108; // [rsp+B8h] [rbp-A8h]
int v109; // [rsp+BCh] [rbp-A4h]
std::string v110; // [rsp+C0h] [rbp-A0h] BYREF
cocos2d::CCObject *v111; // [rsp+D8h] [rbp-88h]
std::string v112; // [rsp+E0h] [rbp-80h] BYREF
unsigned __int64 v113; // [rsp+F8h] [rbp-68h] BYREF
ShardsPage *v114; // [rsp+100h] [rbp-60h]
unsigned __int64 v115; // [rsp+10Ch] [rbp-54h] BYREF
bool v116; // [rsp+117h] [rbp-49h]
float v117; // [rsp+118h] [rbp-48h] BYREF
float v118; // [rsp+11Ch] [rbp-44h]
float v119; // [rsp+120h] [rbp-40h]
int v120; // [rsp+124h] [rbp-3Ch]
int v121; // [rsp+128h] [rbp-38h]
__int16 v122; // [rsp+12Ch] [rbp-34h] BYREF
char v123; // [rsp+12Eh] [rbp-32h]
__int16 v124; // [rsp+130h] [rbp-30h] BYREF
char v125; // [rsp+132h] [rbp-2Eh]
int Stat; // [rsp+134h] [rbp-2Ch]
double v127; // 0:xmm0_8.8
double v128; // 0:xmm0_8.8
double v129; // 0:xmm0_8.8
cocos2d::CCRect v130; // 0:xmm0_8.8,8:xmm1_8.8
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
v116 = result;
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v117);
v130.origin = 0;
v130.size = 0;
sub_10028CC00((__int64)&v112, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v3 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", v130);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v3->setOpacity)(v3, 255);
sub_10028CBF0((float *)&v112, 420.0, 280.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, std::string *))v3->setContentSize)(v3, &v112);
m_mainLayer = a1->m_mainLayer;
v5 = m_mainLayer->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v108 = -1;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))v5->addChild_0)(
m_mainLayer,
v3,
0xFFFFFFFFLL);
sub_10028CBE0((float *)&v112, v117 * 0.5, v118 * 0.5);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, std::string *))v3->setPosition)(v3, &v112);
v6 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v6,
8);
sub_10028CBE0((float *)&v112, (float)(v117 * 0.5) + -185.0, (float)(v118 * 0.5) + -115.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v6->setPosition)(v6, &v112);
v7 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v7,
8);
cocos2d::CCSprite::setFlipY(v7, 1);
sub_10028CBE0((float *)&v112, (float)(v117 * 0.5) + -185.0, (float)(v118 * 0.5) + 115.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v7->setPosition)(v7, &v112);
v8 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v8,
8);
cocos2d::CCSprite::setFlipX(v8, 1);
cocos2d::CCSprite::setFlipY(v8, 1);
sub_10028CBE0((float *)&v112, (float)(v117 * 0.5) + 185.0, (float)(v118 * 0.5) + 115.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v8->setPosition)(v8, &v112);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v9,
8);
cocos2d::CCSprite::setFlipX(v9, 1);
sub_10028CBE0((float *)&v112, (float)(v117 * 0.5) + 185.0, (float)(v118 * 0.5) + -115.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v9->setPosition)(v9, &v112);
sub_10028CBE0((float *)&v90, v117 * 0.5, (float)((float)(v118 * 0.5) + 140.0) + -28.0);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("label_shards_001.png");
sub_10028CBE0((float *)&v110, -80.0, 0.0);
sub_10028CCE0((double *)&v112, &v90, (unsigned __int64 *)&v110);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v10->setPosition)(v10, &v112);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v10);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("label_of_001.png");
sub_10028CBE0((float *)&v110, 4.0, 0.0);
v114 = a1;
sub_10028CCE0((double *)&v112, &v90, (unsigned __int64 *)&v110);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v11->setPosition)(v11, &v112);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v114->m_mainLayer->addChild)(v114->m_mainLayer, v11);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("label_power_001.png");
sub_10028CBE0((float *)&v110, 85.0, 0.0);
sub_10028CCE0((double *)&v112, &v90, (unsigned __int64 *)&v110);
v13 = v114;
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v12->setPosition)(v12, &v112);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v13->m_mainLayer->addChild)(v13->m_mainLayer, v12);
sub_10028CBE0((float *)&v91, v117 * 0.5, (float)(v118 * 0.5) + 80.0);
v14 = cocos2d::CCDictionary::create();
v13->m_pages = v14;
cocos2d::CCObject::retain(v14);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v16 = CCMenuItemSpriteExtra::create(
v15,
nullptr,
v13,
(cocos2d::SEL_MenuHandler)(unsigned __int64)ShardsPage::onClose);
LODWORD(v9) = (_DWORD)v16;
CCMenuItemSpriteExtra::setSizeMult(v16, 1.6);
v21 = sub_100792C50((_DWORD)v9, 0, v17, v18, v19, v20);
v13->m_buttonMenu = (cocos2d::CCMenu *)v21;
sub_10028CBE0(
(float *)&v112,
(float)((float)(v117 * 0.5) + -210.0) + 10.0,
(float)((float)(v118 * 0.5) + 140.0) + -10.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v21 + 184LL))(v21, &v112);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))v13->m_mainLayer->addChild_0)(
v13->m_mainLayer,
v13->m_buttonMenu,
10);
v92 = cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png");
v109 = -1;
v22 = 0;
while ( 1 )
{
m_pages = v13->m_pages;
v24 = (unsigned __int8)v22 / 3u;
v111 = cocos2d::CCDictionary::objectForKey(m_pages, v24);
if ( !v111 )
{
v25 = (cocos2d::CCObject *)sub_10071F9E0(m_pages, v24);
v26 = v13->m_pages;
v111 = v25;
cocos2d::CCDictionary::setObject(v26, v25, (unsigned __int8)v22 / 3u);
}
memset(&v112, 0, sizeof(v112));
memset(&v110, 0, sizeof(v110));
v123 = -1;
v122 = -1;
v125 = -1;
v124 = -1;
*(_WORD *)&v106.__r_.__value_.__l.0 = 0;
v107 = v22;
switch ( v22 )
{
case 0u:
std::string::assign(&v112, "fireShardLabel_001.png");
std::string::assign(&v110, "fireShardSmall_001.png");
v27 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v27, "18");
v123 = 0;
v122 = -1;
v125 = 0;
v124 = -1;
std::string::assign(&v106, "shardFire");
v120 = 51455;
v121 = 19455;
goto LABEL_16;
case 1u:
std::string::assign(&v112, "iceShardLabel_001.png");
std::string::assign(&v110, "iceShardSmall_001.png");
v33 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v33, "19");
v123 = -1;
v122 = -156;
v125 = -1;
v124 = -256;
std::string::assign(&v106, "shardIce");
v120 = 16776960;
v121 = 16750080;
goto LABEL_16;
case 2u:
std::string::assign(&v112, "poisonShardLabel_001.png");
std::string::assign(&v110, "poisonShardSmall_001.png");
v30 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v30, "17");
v123 = 75;
v122 = -181;
v125 = 0;
v124 = -256;
std::string::assign(&v106, "shardPoison");
v120 = 65280;
v121 = 40960;
goto LABEL_16;
case 3u:
std::string::assign(&v112, "shadowShardLabel_001.png");
std::string::assign(&v110, "shadowShardSmall_001.png");
v31 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v31, "16");
v123 = -1;
v122 = 25855;
v125 = -1;
v124 = 255;
std::string::assign(&v106, "shardShadow");
v120 = 16724735;
v121 = 13107350;
goto LABEL_16;
case 4u:
std::string::assign(&v112, "lavaShardLabel_001.png");
std::string::assign(&v110, "lavaShardSmall_001.png");
v28 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v28, "20");
v123 = 50;
v122 = 13055;
v125 = 0;
v124 = 255;
std::string::assign(&v106, "shardLava");
v120 = 1651455;
v121 = 175;
goto LABEL_16;
case 5u:
std::string::assign(&v112, "bonusShardLabel_001.png");
std::string::assign(&v110, "bonusShardSmall_001.png");
std::string::assign(&v106, "shardBonus");
v120 = 0xFFFFFF;
v121 = 9868950;
Stat = v108;
LABEL_16:
v34 = v108;
if ( Stat < v108 )
v34 = Stat;
if ( v108 == -1 )
v34 = Stat;
v108 = v34;
goto LABEL_29;
case 6u:
std::string::assign(&v112, "shard0201ShardLabel_001.png");
std::string::assign(&v110, "shard0201ShardSmall_001.png");
v35 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v35, "23");
std::string::assign(&v106, "shardEarth");
v120 = 10543357;
v121 = 4612771;
goto LABEL_24;
case 7u:
std::string::assign(&v112, "shard0202ShardLabel_001.png");
std::string::assign(&v110, "shard0202ShardSmall_001.png");
v32 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v32, "24");
std::string::assign(&v106, "shardBlood");
v120 = 255;
v121 = 150;
goto LABEL_24;
case 8u:
std::string::assign(&v112, "shard0203ShardLabel_001.png");
std::string::assign(&v110, "shard0203ShardSmall_001.png");
v37 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v37, "25");
std::string::assign(&v106, "shardMetal");
v120 = 0xFFFFFF;
v121 = 8421504;
goto LABEL_24;
case 9u:
std::string::assign(&v112, "shard0204ShardLabel_001.png");
std::string::assign(&v110, "shard0204ShardSmall_001.png");
v29 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v29, "26");
std::string::assign(&v106, "shardLight");
v120 = 12648447;
v121 = 8387327;
goto LABEL_24;
case 0xAu:
std::string::assign(&v112, "shard0205ShardLabel_001.png");
std::string::assign(&v110, "shard0205ShardSmall_001.png");
v36 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v36, "27");
std::string::assign(&v106, "shardSoul");
v120 = 8192255;
v121 = 9830500;
goto LABEL_24;
case 0xBu:
std::string::assign(&v112, "bonusShardLabel_001.png");
std::string::assign(&v110, "bonusShard2Small_001.png");
std::string::assign(&v106, "shardBonusB");
v120 = 0xFFFFFF;
v121 = 9868950;
Stat = v109;
LABEL_24:
v38 = v109;
if ( Stat < v109 )
v38 = Stat;
if ( v109 == -1 )
v38 = Stat;
v109 = v38;
LABEL_29:
sub_10028CBE0((float *)&__dst, 0.0, (float)(int)(v107 - 3 * ((unsigned __int8)v22 / 3u)) * -77.0);
sub_10028CCE0((double *)&v95, &v91, (unsigned __int64 *)&__dst);
data = v112.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v112.__r_.__value_.__s.0 & 1) != 0 )
data = v112.__r_.__value_.__l.__data_;
v40 = cocos2d::CCSprite::createWithSpriteFrameName(data);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v13->m_mainLayer->addChild)(
v13->m_mainLayer,
v40);
sub_10028CBE0((float *)&v102, -20.0, 0.0);
sub_10028CCE0((double *)&__dst, &v95, &v102);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v40->setPosition)(v40, &__dst);
sub_10071FCD0(v111, v40);
v41 = (cocos2d::CCString *)sub_1007AB580("%i", v89);
CString = cocos2d::CCString::getCString(v41);
v43 = cocos2d::CCLabelBMFont::create_3(CString, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v43->setScale)(v43, 0.44999999);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v114->m_mainLayer->addChild)(
v114->m_mainLayer,
v43);
sub_10028CBE0((float *)&__dst, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int128 *))v43->setAnchorPoint)(v43, &__dst);
v44 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v40->getPosition)(v40);
v45 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v40->getContentSize)(v40);
sub_10028CBE0((float *)&v102, (float)(*v45 * 0.5) + 5.0, 1.0);
sub_10028CCE0((double *)&__dst, v44, &v102);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int128 *))v43->setPosition)(v43, &__dst);
sub_10071FCD0(v111, v43);
v46 = v110.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v110.__r_.__value_.__s.0 & 1) != 0 )
v46 = v110.__r_.__value_.__l.__data_;
v47 = cocos2d::CCSprite::createWithSpriteFrameName(v46);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v114->m_mainLayer->addChild)(
v114->m_mainLayer,
v47);
sub_10028CBE0((float *)&__dst, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v47->setAnchorPoint)(v47, &__dst);
v48 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v43->getPosition)(v43);
((void (__fastcall *)(unsigned __int64 *, cocos2d::CCLabelBMFont *))v43->getScaledContentSize)(&v115, v43);
sub_10028CBE0((float *)&v102, *(float *)&v115 + 2.0, 0.0);
sub_10028CCE0((double *)&__dst, v48, &v102);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v47->setPosition)(v47, &__dst);
sub_10071FCD0(v111, v47);
v49 = -2;
v50 = 0;
break;
}
do
{
v119 = 0.0;
v51 = 3238002688LL;
v105 = -8.0;
if ( (unsigned int)(v49 + 3) <= 5 )
{
v51 = *(unsigned int *)((char *)&unk_10081D870 + v50);
v105 = *(float *)((char *)&unk_10081D870 + v50);
v119 = *(float *)((char *)&unk_10081D884 + v50);
}
v96 = v50;
v98 = v49 + 3;
v52 = (cocos2d::CCString *)sub_1007AB580("geometry.ach.%s%02d", v89);
v53 = cocos2d::CCString::getCString(v52);
v54 = strlen(v53);
if ( v54 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v51);
v55 = v54;
if ( v54 >= 0x17 )
{
v57 = (v54 | 7) + 1;
if ( (v54 | 7) == 0x17 )
v57 = 26;
v56 = (char *)operator new(v57);
v101 = v56;
*(_QWORD *)&__dst = v57 | 1;
*((_QWORD *)&__dst + 1) = v55;
LABEL_44:
memmove(v56, v53, v55);
goto LABEL_45;
}
LOBYTE(__dst) = 2 * v54;
v56 = (char *)&__dst + 1;
if ( v54 )
goto LABEL_44;
LABEL_45:
v56[v55] = 0;
v103 = 0;
v104 = 0;
v58 = GameManager::sharedState();
v59 = __dst & 1;
if ( (__dst & 1) != 0 )
{
sub_100006B70(&v93, v101, *((unsigned __int64 *)&__dst + 1), *(double *)&v51);
}
else
{
__p = v101;
v51 = __dst;
v93 = __dst;
}
GameManager::getUnlockForAchievement(*(double *)&v51, (__int64)v58, (__int64)&v93, &v104, (int *)&v103);
if ( (v93 & 1) != 0 )
operator delete(__p);
if ( v103 > 0 )
{
v60 = GJItemIcon::create(
v103,
v104,
(cocos2d::ccColor3B)v121,
(cocos2d::ccColor3B)v120,
0,
0,
0,
(cocos2d::ccColor3B)-1);
((void (__fastcall *)(GJItemIcon *, float))v60->setScale)(v60, 0.80000001);
if ( Stat < SLODWORD(v119) )
{
GJItemIcon::changeToLockedState(v60, 1.25);
GJItemIcon::darkenStoreItem(v60, (cocos2d::ccColor3B)1912919);
}
v61 = CCMenuItemSpriteExtra::create(
v60,
nullptr,
v114,
(cocos2d::SEL_MenuHandler)(unsigned __int64)ShardsPage::onIconInfo);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v114->m_buttonMenu->addChild)(
v114->m_buttonMenu,
v61);
v62 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v92->getContentSize)(v92);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v61->setContentSize)(v61, v62);
v99 = *(float *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v61->getContentSize)(v61);
v63 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v61->getContentSize)(v61);
sub_10028CBE0((float *)&v102, v99 * 0.5, *(float *)(v63 + 4) * 0.5);
((void (__fastcall *)(GJItemIcon *, unsigned __int64 *))v60->setPosition)(v60, &v102);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v61->setTag)(v61, v107);
sub_10028CBE0((float *)&v115, (float)v49 * 70.0, -30.0);
sub_10028CCE0((double *)&v102, &v95, &v115);
m_buttonMenu = (const cocos2d::CCPoint *)v114->m_buttonMenu;
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v113, (const cocos2d::CCPoint *)v114->m_mainLayer);
*(cocos2d::CCPoint *)&v127 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v115, m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, unsigned __int64 *, double))v61->setPosition)(v61, &v115, v127);
sub_10071FCD0(v111, v61);
if ( Stat < SLODWORD(v119) )
{
v65 = (cocos2d::CCString *)sub_1007AB580("%i", v89);
v66 = cocos2d::CCString::getCString(v65);
v67 = cocos2d::CCLabelBMFont::create_3(v66, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v67->setScale)(v67, 0.30000001);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v114->m_mainLayer->addChild)(
v114->m_mainLayer,
v67);
sub_10028CBE0((float *)&v115, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v67->setAnchorPoint)(v67, &v115);
sub_10028CBE0((float *)&v113, v105, -22.0);
sub_10028CCE0((double *)&v115, &v102, &v113);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v67->setPosition)(v67, &v115);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int16 *))v67->setColor)(v67, &v122);
sub_10071FCD0(v111, v67);
v68 = v110.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v110.__r_.__value_.__s.0 & 1) != 0 )
v68 = v110.__r_.__value_.__l.__data_;
v69 = cocos2d::CCSprite::createWithSpriteFrameName(v68);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v114->m_mainLayer->addChild)(
v114->m_mainLayer,
v69);
((void (__fastcall *)(cocos2d::CCSprite *, float))v69->setScale)(v69, 0.69999999);
sub_10028CBE0((float *)&v115, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v69->setAnchorPoint)(v69, &v115);
v70 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v67->getPosition)(v67);
((void (__fastcall *)(unsigned __int64 *, cocos2d::CCLabelBMFont *))v67->getScaledContentSize)(&v97, v67);
sub_10028CBE0((float *)&v113, *(float *)&v97 + 2.0, 0.0);
sub_10028CCE0((double *)&v115, v70, &v113);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v69->setPosition)(v69, &v115);
sub_10071FCD0(v111, v69);
}
if ( v98 >= 2 )
{
sub_10028CBE0((float *)&v113, -51.0, 0.0);
sub_10028CCE0((double *)&v115, &v102, &v113);
v71 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
sub_10028CBE0((float *)&v113, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v71->setAnchorPoint)(v71, &v113);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v71->setPosition)(v71, &v115);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, _QWORD))v114->m_mainLayer->addChild_0)(
v114->m_mainLayer,
v71,
0);
v72 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v71->getContentSize)(v71);
((void (__fastcall *)(cocos2d::CCSprite *, float))v71->setScaleX)(v71, 32.0 / *v72);
v73 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v71->getContentSize)(v71);
((void (__fastcall *)(cocos2d::CCSprite *, float))v71->setScaleY)(v71, 5.0 / *(float *)(v73 + 4));
((void (__fastcall *)(cocos2d::CCSprite *, void *))v71->setColor)(v71, &unk_10081D860);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v71->setOpacity)(v71, 110);
sub_10071FCD0(v111, v71);
v119 = fminf(
(float)(Stat - *(_DWORD *)((char *)&unk_10081D850 + v96 - 4))
/ (float)(LODWORD(v119) - *(_DWORD *)((char *)&unk_10081D850 + v96 - 4)),
1.0);
if ( v119 > 0.0 )
{
v74 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
sub_10028CBE0((float *)&v113, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v74->setAnchorPoint)(v74, &v113);
sub_10028CBE0((float *)&v97, 2.0, 0.0);
sub_10028CCE0((double *)&v113, &v115, &v97);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v74->setPosition)(v74, &v113);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))v114->m_mainLayer->addChild_0)(
v114->m_mainLayer,
v74,
1);
v75 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v74->getContentSize)(v74);
((void (__fastcall *)(cocos2d::CCSprite *, float))v74->setScaleX)(v74, (float)(v119 * 28.0) / *v75);
v76 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v74->getContentSize)(v74);
((void (__fastcall *)(cocos2d::CCSprite *, float))v74->setScaleY)(v74, 2.0 / *(float *)(v76 + 4));
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v74->setColor)(v74, &v124);
sub_10071FCD0(v111, v74);
}
}
}
if ( v59 )
operator delete(v101);
v50 = v96 + 4;
++v49;
}
while ( v49 != 3 );
if ( (*(_BYTE *)&v106.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v106.__r_.__value_.__l.__data_);
v13 = v114;
if ( (*(_BYTE *)&v110.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_67;
LABEL_64:
if ( (*(_BYTE *)&v112.__r_.__value_.__s.0 & 1) != 0 )
LABEL_68:
operator delete(v112.__r_.__value_.__l.__data_);
}
else
{
v13 = v114;
if ( (*(_BYTE *)&v110.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_64;
LABEL_67:
operator delete(v110.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v112.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_68;
}
v22 = v107 + 1;
if ( v107 == 11 )
{
v77 = cocos2d::CCMenu::create();
v119 = v118 * 0.5;
v78 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v79 = CCMenuItemSpriteExtra::create(
v78,
nullptr,
v13,
(cocos2d::SEL_MenuHandler)(unsigned __int64)ShardsPage::onSwitchPage);
v13->m_prevButton = v79;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v77->addChild)(v77, v79);
m_prevButton = v13->m_prevButton;
v81 = cocos2d::CCDirector::sharedDirector();
v82 = sub_100484D90((__int64)v81);
sub_10028CBE0((float *)&v110, v82 + 24.0, v119);
*(cocos2d::CCPoint *)&v128 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v112,
(const cocos2d::CCPoint *)v77);
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, double))m_prevButton->setPosition)(
m_prevButton,
&v112,
v128);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v13->m_prevButton->setTag)(v13->m_prevButton, 0);
CCMenuItemSpriteExtra::setSizeMult(v13->m_prevButton, 1.4);
v83 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v83, 1);
v84 = CCMenuItemSpriteExtra::create(
v83,
nullptr,
v13,
(cocos2d::SEL_MenuHandler)(unsigned __int64)ShardsPage::onSwitchPage);
v13->m_nextButton = v84;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v77->addChild)(v77, v84);
m_nextButton = v13->m_nextButton;
v86 = cocos2d::CCDirector::sharedDirector();
*(float *)&v128 = sub_100484DA0((__int64)v86);
sub_10028CBE0((float *)&v110, *(float *)&v128 + -24.0, v119);
*(cocos2d::CCPoint *)&v129 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v112,
(const cocos2d::CCPoint *)v77);
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, double))m_nextButton->setPosition)(
m_nextButton,
&v112,
v129);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v13->m_nextButton->setTag)(v13->m_nextButton, 1);
CCMenuItemSpriteExtra::setSizeMult(v13->m_nextButton, 1.4);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))v13->m_mainLayer->addChild_0)(
v13->m_mainLayer,
v77,
10);
v87 = cocos2d::CCSprite::createWithSpriteFrameName("tier1Icon_001.png");
v13->m_tierSprite = v87;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))v13->m_mainLayer->addChild_0)(
v13->m_mainLayer,
v87,
10);
m_tierSprite = v13->m_tierSprite;
sub_10028CBE0(
(float *)&v112,
(float)((float)(v117 * 0.5) + 210.0) + -18.0,
(float)((float)(0.5 * v118) + 140.0) + -18.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))m_tierSprite->setPosition)(m_tierSprite, &v112);
ShardsPage::goToPage(v13, 0);
return v116;
}
}
}
return result;
}