//
// ShardsPage::init from 0x1003a1c08 to 0x1003a3128 (5408 bytes)
//
// 2 xrefs:
// > ShardsPage::create @ 0x1003a1bbc
// > ??> @ 0x10080c1f0
//
// 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)
{
ShardsPage *v1; // x25
_BOOL4 inited; // w0
cocos2d::CCDirector *v3; // x0
cocos2d::extension::CCScale9Sprite *v4; // x19
__n128 v5; // q0
__n128 v6; // q1
int i; // w20
cocos2d::CCSprite *v8; // x21
__n128 v9; // q0
__n128 v10; // q1
int v11; // w8
int v12; // w8
float v13; // w8
__n128 v14; // q0
__n128 v15; // q1
cocos2d::CCSprite *v16; // x19
__n128 v17; // q0
__n128 v18; // q1
double v19; // d0
cocos2d::CCSprite *v20; // x19
__n128 v21; // q0
__n128 v22; // q1
double v23; // d0
cocos2d::CCSprite *v24; // x19
__n128 v25; // q0
__n128 v26; // q1
double v27; // d0
__n128 v28; // q0
__n128 v29; // q1
cocos2d::CCDictionary *v30; // x0
cocos2d::CCSprite *v31; // x0
CCMenuItemSpriteExtra *v32; // x19
__int64 v33; // x1
__int64 v34; // x2
__int64 v35; // x3
__int64 v36; // x4
__int64 v37; // x5
__int64 v38; // x6
__int64 v39; // x7
cocos2d::CCMenu *v40; // x19
__n128 v41; // q0
__n128 v42; // q1
int v43; // w19
intptr_t v44; // x20
GameStatsManager *v45; // x0
__n128 v46; // q0
__n128 v47; // q1
__int64 v48; // x8
GameStatsManager *v49; // x0
__int64 v50; // x8
GameStatsManager *v51; // x0
GameStatsManager *v52; // x0
GameStatsManager *v53; // x0
GameStatsManager *v54; // x0
GameStatsManager *v55; // x0
GameStatsManager *v56; // x0
GameStatsManager *v57; // x0
GameStatsManager *v58; // x0
__int64 v59; // x8
int v60; // w8
int v61; // w8
std::string *v62; // x0
cocos2d::CCSprite *v63; // x22
__n128 v64; // q0
__n128 v65; // q1
double v66; // d0
ShardsPage *v67; // x27
cocos2d::CCString *v68; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v70; // x25
__n128 v71; // q0
__n128 v72; // q1
float32x2_t *v73; // x21
__n128 v74; // q0
__n128 v75; // q1
double v76; // d0
std::string *v77; // x0
cocos2d::CCSprite *v78; // x22
__n128 v79; // q0
__n128 v80; // q1
float32x2_t *v81; // x21
__n128 v82; // q0
__n128 v83; // q1
double v84; // d0
int v85; // w24
unsigned __int32 *v86; // x28
int *v87; // x26
_DWORD *v88; // x20
unsigned __int32 v89; // s12
int v90; // w23
std::string *v91; // x8
cocos2d::CCString *v92; // x0
char *v93; // x0
GameManager *v94; // x21
GJItemIcon *v95; // x22
CCMenuItemSpriteExtra *v96; // x25
__int64 v97; // x0
float v98; // s15
__int64 v99; // x0
__n128 v100; // q0
__n128 v101; // q1
__n128 v102; // q0
__n128 v103; // q1
cocos2d::CCNode *m_buttonMenu; // x21
__n128 v105; // q0
__n128 v106; // q1
cocos2d::CCString *v107; // x0
const char *v108; // x0
cocos2d::CCLabelBMFont *v109; // x25
__n128 v110; // q0
__n128 v111; // q1
__n128 v112; // q0
__n128 v113; // q1
double v114; // d0
std::string *v115; // x0
cocos2d::CCSprite *v116; // x22
__n128 v117; // q0
__n128 v118; // q1
float32x2_t *v119; // x21
__n128 v120; // q0
__n128 v121; // q1
double v122; // d0
cocos2d::CCSprite *v123; // x22
__n128 v124; // q0
__n128 v125; // q1
float *v126; // x0
__int64 v127; // x0
float v128; // s12
cocos2d::CCSprite *v129; // x22
__n128 v130; // q0
__n128 v131; // q1
__n128 v132; // q0
__n128 v133; // q1
double v134; // d0
float *v135; // x0
__int64 v136; // x0
cocos2d::CCMenu *v137; // x19
unsigned __int32 v138; // s8
float v139; // s11
cocos2d::CCSprite *v140; // x0
CCMenuItemSpriteExtra *v141; // x0
CCMenuItemSpriteExtra *m_prevButton; // x23
cocos2d::CCDirector *v143; // x0
__n128 v144; // q0
__n128 v145; // q1
cocos2d::CCSprite *v146; // x22
CCMenuItemSpriteExtra *v147; // x0
CCMenuItemSpriteExtra *m_nextButton; // x21
cocos2d::CCDirector *v149; // x0
__n128 v150; // q0
__n128 v151; // q1
cocos2d::CCSprite *v152; // x0
__n128 v153; // q0
cocos2d::CCSprite *m_tierSprite; // x19
__n128 v155; // q1
bool v157; // [xsp+14h] [xbp-1CCh]
int v158; // [xsp+28h] [xbp-1B8h]
int v159; // [xsp+2Ch] [xbp-1B4h]
unsigned __int64 v160; // [xsp+30h] [xbp-1B0h]
cocos2d::CCSprite *v161; // [xsp+38h] [xbp-1A8h]
__int64 v162; // [xsp+40h] [xbp-1A0h]
__int64 v163; // [xsp+48h] [xbp-198h]
int v164; // [xsp+54h] [xbp-18Ch]
__int64 v165; // [xsp+58h] [xbp-188h]
unsigned __int64 v166; // [xsp+60h] [xbp-180h]
unsigned __int64 v167; // [xsp+68h] [xbp-178h]
int Stat; // [xsp+70h] [xbp-170h]
cocos2d::CCObject *v169; // [xsp+78h] [xbp-168h]
float32x2_t v170; // [xsp+80h] [xbp-160h] BYREF
float32x2_t v171; // [xsp+88h] [xbp-158h] BYREF
void *__p[2]; // [xsp+90h] [xbp-150h] BYREF
__int64 v173; // [xsp+A0h] [xbp-140h]
__int64 v174; // [xsp+A8h] [xbp-138h] BYREF
void *v175[2]; // [xsp+B0h] [xbp-130h] BYREF
__int64 v176; // [xsp+C0h] [xbp-120h]
float32x2_t v177; // [xsp+C8h] [xbp-118h] BYREF
float32x2_t v178; // [xsp+D0h] [xbp-110h] BYREF
float32x2_t v179; // [xsp+D8h] [xbp-108h] BYREF
std::string v180; // [xsp+E0h] [xbp-100h] BYREF
__int16 v181; // [xsp+F8h] [xbp-E8h] BYREF
char v182; // [xsp+FAh] [xbp-E6h]
__int16 v183; // [xsp+FCh] [xbp-E4h] BYREF
char v184; // [xsp+FEh] [xbp-E2h]
std::string v185; // [xsp+100h] [xbp-E0h] BYREF
std::string v186; // [xsp+118h] [xbp-C8h] BYREF
float32x2_t v187; // [xsp+130h] [xbp-B0h] BYREF
float32x2_t v188; // [xsp+138h] [xbp-A8h] BYREF
float v189; // [xsp+140h] [xbp-A0h]
float v190; // [xsp+144h] [xbp-9Ch]
cocos2d::CCPoint v191; // 0:kr10_8.8
cocos2d::CCPoint v192; // 0:kr18_8.8
cocos2d::CCPoint v193; // 0:kr20_8.8
cocos2d::SEL_MenuHandler v194; // 0:x3.16
cocos2d::SEL_MenuHandler v195; // 0:x3.16
cocos2d::SEL_MenuHandler v196; // 0:x3.16
cocos2d::SEL_MenuHandler v197; // 0:x3.16
cocos2d::CCRect v198; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v1 = a1;
inited = FLAlertLayer::init_1(a1, 150);
if ( !inited )
return inited;
v157 = inited;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v3);
sub_100022990((float *)&v186, 0.0, 0.0, 80.0, 80.0);
v4 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v198);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v4->setOpacity)(v4, 255);
sub_100022988((float *)&v186, 420.0, 280.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, std::string *))v4->setContentSize)(v4, &v186);
v5 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))v1->m_mainLayer->addChild_0)(
v1->m_mainLayer,
v4,
0xFFFFFFFFLL);
v5.n128_f32[0] = v189 * 0.5;
v6.n128_f32[0] = v190 * 0.5;
sub_100022980(v5, v6, &v186);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, std::string *))v4->setPosition)(v4, &v186);
for ( i = 0; i != 4; ++i )
{
v8 = cocos2d::CCSprite::createWithSpriteFrameName("dailyLevelCorner_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))v1->m_mainLayer->addChild_0)(
v1->m_mainLayer,
v8,
8);
if ( i > 1 )
{
if ( i != 2 )
{
cocos2d::CCSprite::setFlipX(v8, 1);
v11 = 1127809024;
goto LABEL_11;
}
cocos2d::CCSprite::setFlipX(v8, 1);
cocos2d::CCSprite::setFlipY(v8, 1);
v12 = 1127809024;
LABEL_9:
v9.n128_u32[0] = v12;
v13 = 115.0;
goto LABEL_12;
}
if ( i )
{
cocos2d::CCSprite::setFlipY(v8, 1);
v12 = -1019674624;
goto LABEL_9;
}
v11 = -1019674624;
LABEL_11:
v9.n128_u32[0] = v11;
v13 = -115.0;
LABEL_12:
v9.n128_f32[0] = v9.n128_f32[0] + (float)(v189 * 0.5);
v10.n128_f32[0] = v13 + (float)(v190 * 0.5);
sub_100022980(v9, v10, &v186);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v8->setPosition)(v8, &v186);
}
v14.n128_f32[0] = v189 * 0.5;
v15.n128_f32[0] = (float)((float)(v190 * 0.5) + 140.0) + -28.0;
sub_100022980(v14, v15, &v188);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("label_shards_001.png");
v17.n128_u32[0] = -1029701632;
v18.n128_u32[0] = 0;
sub_100022980(v17, v18, &v185);
*(float32x2_t *)&v19 = sub_1000229DC(&v188, (float32x2_t *)&v185, (float32x2_t *)&v186);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *, double))v16->setPosition)(v16, &v186, v19);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v1->m_mainLayer->addChild)(v1->m_mainLayer, v16);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("label_of_001.png");
v21.n128_u32[0] = 4.0;
v22.n128_u32[0] = 0;
sub_100022980(v21, v22, &v185);
*(float32x2_t *)&v23 = sub_1000229DC(&v188, (float32x2_t *)&v185, (float32x2_t *)&v186);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *, double))v20->setPosition)(v20, &v186, v23);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v1->m_mainLayer->addChild)(v1->m_mainLayer, v20);
v24 = cocos2d::CCSprite::createWithSpriteFrameName("label_power_001.png");
v25.n128_u32[0] = 1118437376;
v26.n128_u32[0] = 0;
sub_100022980(v25, v26, &v185);
*(float32x2_t *)&v27 = sub_1000229DC(&v188, (float32x2_t *)&v185, (float32x2_t *)&v186);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *, double))v24->setPosition)(v24, &v186, v27);
v28 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v1->m_mainLayer->addChild)(
v1->m_mainLayer,
v24);
v28.n128_f32[0] = v189 * 0.5;
v29.n128_f32[0] = (float)(v190 * 0.5) + 80.0;
sub_100022980(v28, v29, &v187);
v30 = cocos2d::CCDictionary::create();
v1->m_pages = v30;
cocos2d::CCObject::retain(v30);
v31 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v194.ptr = (void (__cdecl *)(cocos2d::CCObject *))ShardsPage::onClose;
v194.adj = 0;
v32 = CCMenuItemSpriteExtra::create(v31, nullptr, v1, v194);
CCMenuItemSpriteExtra::setSizeMult(v32, 1.6);
v40 = sub_1001D7ED0(v32, v33, v34, v35, v36, v37, v38, v39, 0);
v1->m_buttonMenu = v40;
v41.n128_f32[0] = (float)((float)(v189 * 0.5) + -210.0) + 10.0;
v42.n128_f32[0] = (float)((float)(v190 * 0.5) + 140.0) + -10.0;
sub_100022980(v41, v42, &v186);
((void (__fastcall *)(cocos2d::CCMenu *, std::string *))v40->setPosition)(v40, &v186);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))v1->m_mainLayer->addChild_0)(
v1->m_mainLayer,
v1->m_buttonMenu,
10);
v161 = cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png");
v43 = 0;
v158 = -1;
v159 = -1;
do
{
v44 = (unsigned __int8)v43 / 3u;
v169 = cocos2d::CCDictionary::objectForKey(v1->m_pages, v44);
if ( !v169 )
{
v169 = sub_10024A15C();
cocos2d::CCDictionary::setObject(v1->m_pages, v169, v44);
}
memset(&v186, 0, sizeof(v186));
memset(&v185, 0, sizeof(v185));
v184 = -1;
v183 = -1;
v182 = -1;
v181 = -1;
sub_100009900(&v180, "");
if ( v43 <= 5 )
{
if ( v43 > 2 )
{
if ( v43 == 3 )
{
std::string::assign(&v186, "shadowShardLabel_001.png");
std::string::assign(&v185, "shadowShardSmall_001.png");
v55 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v55, "16");
v184 = -1;
v183 = 25855;
v182 = -1;
v181 = 255;
std::string::assign(&v180, "shardShadow");
v163 = 13107350;
v48 = 16724735;
}
else if ( v43 == 4 )
{
std::string::assign(&v186, "lavaShardLabel_001.png");
std::string::assign(&v185, "lavaShardSmall_001.png");
v51 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v51, "20");
v184 = 50;
v183 = 13055;
v182 = 0;
v181 = 255;
std::string::assign(&v180, "shardLava");
v163 = 175;
v48 = 1651455;
}
else
{
std::string::assign(&v186, "bonusShardLabel_001.png");
std::string::assign(&v185, "bonusShardSmall_001.png");
std::string::assign(&v180, "shardBonus");
Stat = v159;
v163 = 9868950;
v48 = 0xFFFFFF;
}
}
else if ( v43 )
{
if ( v43 == 1 )
{
std::string::assign(&v186, "iceShardLabel_001.png");
std::string::assign(&v185, "iceShardSmall_001.png");
v45 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v45, "19");
v184 = -1;
v183 = -156;
v182 = -1;
v181 = -256;
std::string::assign(&v180, "shardIce");
v163 = 16750080;
v48 = 16776960;
}
else
{
std::string::assign(&v186, "poisonShardLabel_001.png");
std::string::assign(&v185, "poisonShardSmall_001.png");
v57 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v57, "17");
v184 = 75;
v183 = -181;
v182 = 0;
v181 = -256;
std::string::assign(&v180, "shardPoison");
v163 = 40960;
v48 = 65280;
}
}
else
{
std::string::assign(&v186, "fireShardLabel_001.png");
std::string::assign(&v185, "fireShardSmall_001.png");
v53 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v53, "18");
v184 = 0;
v183 = -1;
v182 = 0;
v181 = -1;
std::string::assign(&v180, "shardFire");
v163 = 19455;
v48 = 51455;
}
v162 = v48;
if ( Stat >= v159 )
v60 = v159;
else
v60 = Stat;
if ( v159 == -1 )
v60 = Stat;
v159 = v60;
goto LABEL_52;
}
if ( v43 > 8 )
{
if ( v43 == 9 )
{
std::string::assign(&v186, "shard0204ShardLabel_001.png");
std::string::assign(&v185, "shard0204ShardSmall_001.png");
v56 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v56, "26");
std::string::assign(&v180, "shardLight");
v163 = 8387327;
v50 = 12648447;
goto LABEL_46;
}
if ( v43 != 10 )
{
std::string::assign(&v186, "bonusShardLabel_001.png");
std::string::assign(&v185, "bonusShard2Small_001.png");
std::string::assign(&v180, "shardBonusB");
Stat = v158;
v59 = 9868950;
goto LABEL_45;
}
std::string::assign(&v186, "shard0205ShardLabel_001.png");
std::string::assign(&v185, "shard0205ShardSmall_001.png");
v52 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v52, "27");
std::string::assign(&v180, "shardSoul");
v163 = 9830500;
v50 = 8192255;
}
else if ( v43 == 6 )
{
std::string::assign(&v186, "shard0201ShardLabel_001.png");
std::string::assign(&v185, "shard0201ShardSmall_001.png");
v54 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v54, "23");
std::string::assign(&v180, "shardEarth");
v163 = 4612771;
v50 = 10543357;
}
else
{
if ( v43 != 7 )
{
std::string::assign(&v186, "shard0203ShardLabel_001.png");
std::string::assign(&v185, "shard0203ShardSmall_001.png");
v58 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v58, "25");
std::string::assign(&v180, "shardMetal");
v59 = 8421504;
LABEL_45:
v163 = v59;
v50 = 0xFFFFFF;
goto LABEL_46;
}
std::string::assign(&v186, "shard0202ShardLabel_001.png");
std::string::assign(&v185, "shard0202ShardSmall_001.png");
v49 = GameStatsManager::sharedState();
Stat = GameStatsManager::getStat(v49, "24");
std::string::assign(&v180, "shardBlood");
v163 = 150;
v50 = 255;
}
LABEL_46:
v162 = v50;
if ( Stat >= v158 )
v61 = v158;
else
v61 = Stat;
if ( v158 == -1 )
v61 = Stat;
v158 = v61;
LABEL_52:
v47.n128_f32[0] = (float)(-3 * v44 + v43) * -77.0;
v46.n128_u32[0] = 0;
sub_100022980(v46, v47, v175);
sub_1000229DC(&v187, (float32x2_t *)v175, &v179);
if ( (v186.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v62 = &v186;
else
v62 = (std::string *)v186.__r_.__value_.__r.__words[0];
v63 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v62);
v64 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v1->m_mainLayer->addChild)(
v1->m_mainLayer,
v63);
v64.n128_u32[0] = -20.0;
v65.n128_u32[0] = 0;
sub_100022980(v64, v65, &v178);
*(float32x2_t *)&v66 = sub_1000229DC(&v179, &v178, (float32x2_t *)v175);
((void (__fastcall *)(cocos2d::CCSprite *, void **, double))v63->setPosition)(v63, v175, v66);
sub_10024A2D0((__int64)v169);
v67 = v1;
v68 = (cocos2d::CCString *)sub_100268F4C("%i", Stat);
CString = cocos2d::CCString::getCString(v68);
v70 = cocos2d::CCLabelBMFont::create_1(CString, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v70->setScale)(v70, 0.45);
v71 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v67->m_mainLayer->addChild)(
v67->m_mainLayer,
v70);
v71.n128_u32[0] = 0;
v72.n128_u32[0] = 0.5;
sub_100022980(v71, v72, v175);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v70->setAnchorPoint)(v70, v175);
v73 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v63->getPosition)(v63);
v74.n128_f32[0] = (float)(*(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v63->getContentSize)(v63) * 0.5)
+ 5.0;
v75.n128_u32[0] = 1.0;
sub_100022980(v74, v75, &v178);
*(float32x2_t *)&v76 = sub_1000229DC(v73, &v178, (float32x2_t *)v175);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **, double))v70->setPosition)(v70, v175, v76);
sub_10024A2D0((__int64)v169);
if ( (v185.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v77 = &v185;
else
v77 = (std::string *)v185.__r_.__value_.__r.__words[0];
v78 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v77);
v79 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v67->m_mainLayer->addChild)(
v67->m_mainLayer,
v78);
v79.n128_u32[0] = 0;
v80.n128_u32[0] = 0.5;
sub_100022980(v79, v80, v175);
((void (__fastcall *)(cocos2d::CCSprite *, void **))v78->setAnchorPoint)(v78, v175);
v81 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v70->getPosition)(v70);
((void (__fastcall *)(float32x2_t *__return_ptr, cocos2d::CCLabelBMFont *))v70->getScaledContentSize)(&v177, v70);
v82.n128_f32[0] = v177.f32[0] + 2.0;
v83.n128_u32[0] = 0;
sub_100022980(v82, v83, &v178);
*(float32x2_t *)&v84 = sub_1000229DC(v81, &v178, (float32x2_t *)v175);
((void (__fastcall *)(cocos2d::CCSprite *, void **, double))v78->setPosition)(v78, v175, v84);
sub_10024A2D0((__int64)v169);
v164 = v43;
v85 = -2;
v86 = (unsigned __int32 *)&unk_100645DE0;
v87 = (int *)&unk_100645DF4;
v88 = &algn_100645DB6[6];
v1 = v67;
do
{
if ( (unsigned int)(v85 + 3) > 5 )
{
v90 = 0;
v89 = -8.0;
}
else
{
v89 = *v86;
v90 = *v87;
}
v91 = &v180;
if ( (v180.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v91 = (std::string *)v180.__r_.__value_.__r.__words[0];
v92 = (cocos2d::CCString *)sub_100268F4C("geometry.ach.%s%02d", (const char *)v91, v85 + 3);
v93 = (char *)cocos2d::CCString::getCString(v92);
sub_100009900(v175, v93);
v174 = 0;
v94 = GameManager::sharedState();
if ( SHIBYTE(v176) < 0 )
{
sub_1000097D0(__p, v175[0], (unsigned __int64)v175[1]);
}
else
{
*(_OWORD *)__p = *(_OWORD *)v175;
v173 = v176;
}
GameManager::getUnlockForAchievement((__int64)v94, (const char *)__p, (int *)&v174, (int *)&v174 + 1);
if ( SHIBYTE(v173) < 0 )
operator delete(__p[0]);
if ( SHIDWORD(v174) >= 1 )
{
v166 = v166 & 0xFFFFFFFFFF000000LL | v162;
v167 = v167 & 0xFFFFFFFFFF000000LL | v163;
v165 |= 0xFFFFFFuLL;
v95 = GJItemIcon::create(
SHIDWORD(v174),
v174,
(cocos2d::ccColor3B)v167,
(cocos2d::ccColor3B)v166,
0,
0,
0,
(cocos2d::ccColor3B)v165);
((void (__fastcall *)(GJItemIcon *, float))v95->setScale)(v95, 0.8);
if ( Stat < v90 )
{
GJItemIcon::changeToLockedState(v95, 1.25);
v160 = v160 & 0xFFFFFFFFFF000000LL | 0x1D3057;
GJItemIcon::darkenStoreItem(v95, (cocos2d::ccColor3B)v160);
}
v195.ptr = (void (__cdecl *)(cocos2d::CCObject *))ShardsPage::onIconInfo;
v195.adj = 0;
v96 = CCMenuItemSpriteExtra::create(v95, nullptr, v1, v195);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v67->m_buttonMenu->addChild)(
v67->m_buttonMenu,
v96);
v97 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v161->getContentSize)(v161);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v96->setContentSize)(v96, v97);
v98 = *(float *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v96->getContentSize)(v96);
v99 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v96->getContentSize)(v96);
v100.n128_f32[0] = v98 * 0.5;
v101.n128_f32[0] = *(float *)(v99 + 4) * 0.5;
sub_100022980(v100, v101, &v178);
((void (__fastcall *)(GJItemIcon *, float32x2_t *))v95->setPosition)(v95, &v178);
v102 = ((__n128 (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v96->setTag)(v96, (unsigned int)v43);
v102.n128_f32[0] = (float)v85 * 70.0;
v103.n128_u32[0] = -30.0;
sub_100022980(v102, v103, &v177);
sub_1000229DC(&v179, &v177, &v178);
m_buttonMenu = v67->m_buttonMenu;
cocos2d::CCNode::convertToWorldSpace(v67->m_mainLayer, (const cocos2d::CCPoint *)&v178);
v191 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v171);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v96->setPosition)(
v96,
&v177,
v191.x,
v191.y);
sub_10024A2D0((__int64)v169);
if ( Stat < v90 )
{
v107 = (cocos2d::CCString *)sub_100268F4C("%i", v90);
v108 = cocos2d::CCString::getCString(v107);
v109 = cocos2d::CCLabelBMFont::create_1(v108, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v109->setScale)(v109, 0.3);
v110 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v67->m_mainLayer->addChild)(
v67->m_mainLayer,
v109);
v110.n128_u32[0] = 0;
v111.n128_u32[0] = 0.5;
sub_100022980(v110, v111, &v177);
v112 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v109->setAnchorPoint)(v109, &v177);
v113.n128_u32[0] = -22.0;
v112.n128_u32[0] = v89;
sub_100022980(v112, v113, &v171);
*(float32x2_t *)&v114 = sub_1000229DC(&v178, &v171, &v177);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v109->setPosition)(v109, &v177, v114);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int16 *))v109->setColor)(v109, &v183);
sub_10024A2D0((__int64)v169);
if ( (v185.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v115 = &v185;
else
v115 = (std::string *)v185.__r_.__value_.__r.__words[0];
v116 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v115);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v67->m_mainLayer->addChild)(
v67->m_mainLayer,
v116);
v117 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float))v116->setScale)(v116, 0.7);
v117.n128_u32[0] = 0;
v118.n128_u32[0] = 0.5;
sub_100022980(v117, v118, &v177);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v116->setAnchorPoint)(v116, &v177);
v119 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v109->getPosition)(v109);
((void (__fastcall *)(float32x2_t *__return_ptr, cocos2d::CCLabelBMFont *))v109->getScaledContentSize)(
&v170,
v109);
v120.n128_f32[0] = v170.f32[0] + 2.0;
v121.n128_u32[0] = 0;
sub_100022980(v120, v121, &v171);
*(float32x2_t *)&v122 = sub_1000229DC(v119, &v171, &v177);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, double))v116->setPosition)(v116, &v177, v122);
sub_10024A2D0((__int64)v169);
}
v1 = v67;
if ( (unsigned int)(v85 + 3) >= 2 )
{
v105.n128_u32[0] = -1035206656;
v106.n128_u32[0] = 0;
sub_100022980(v105, v106, &v171);
sub_1000229DC(&v178, &v171, &v177);
v123 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
v124.n128_u32[0] = 0;
v125.n128_u32[0] = 0.5;
sub_100022980(v124, v125, &v171);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v123->setAnchorPoint)(v123, &v171);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v123->setPosition)(v123, &v177);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, _QWORD))v67->m_mainLayer->addChild_0)(
v67->m_mainLayer,
v123,
0);
v126 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v123->getContentSize)(v123);
((void (__fastcall *)(cocos2d::CCSprite *, float))v123->setScaleX)(v123, 32.0 / *v126);
v127 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v123->getContentSize)(v123);
((void (__fastcall *)(cocos2d::CCSprite *, float))v123->setScaleY)(v123, 5.0 / *(float *)(v127 + 4));
((void (__fastcall *)(cocos2d::CCSprite *, void *))v123->setColor)(v123, &unk_100645DD0);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v123->setOpacity)(v123, 110);
sub_10024A2D0((__int64)v169);
v128 = fminf((float)(Stat - *v88) / (float)(v90 - *v88), 1.0);
if ( v128 > 0.0 )
{
v129 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare20_001.png");
v130.n128_u32[0] = 0;
v131.n128_u32[0] = 0.5;
sub_100022980(v130, v131, &v171);
v132 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v129->setAnchorPoint)(v129, &v171);
v132.n128_u32[0] = 2.0;
v133.n128_u32[0] = 0;
sub_100022980(v132, v133, &v170);
*(float32x2_t *)&v134 = sub_1000229DC(&v177, &v170, &v171);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, double))v129->setPosition)(v129, &v171, v134);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))v67->m_mainLayer->addChild_0)(
v67->m_mainLayer,
v129,
1);
v135 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v129->getContentSize)(v129);
((void (__fastcall *)(cocos2d::CCSprite *, float))v129->setScaleX)(v129, (float)(v128 * 28.0) / *v135);
v136 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v129->getContentSize)(v129);
((void (__fastcall *)(cocos2d::CCSprite *, float))v129->setScaleY)(v129, 2.0 / *(float *)(v136 + 4));
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v129->setColor)(v129, &v181);
sub_10024A2D0((__int64)v169);
}
}
}
if ( SHIBYTE(v176) < 0 )
operator delete(v175[0]);
++v88;
++v85;
++v87;
++v86;
}
while ( v85 != 3 );
if ( SHIBYTE(v180.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v180.__r_.__value_.__l.__data_);
if ( SHIBYTE(v185.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v185.__r_.__value_.__l.__data_);
if ( SHIBYTE(v186.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v186.__r_.__value_.__l.__data_);
++v43;
}
while ( v164 != 11 );
v137 = cocos2d::CCMenu::create();
*(float *)&v138 = v190 * 0.5;
if ( AppDelegate::get()->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] )
v139 = 49.0;
else
v139 = 24.0;
v140 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v196.ptr = (void (__cdecl *)(cocos2d::CCObject *))ShardsPage::onSwitchPage;
v196.adj = 0;
v141 = CCMenuItemSpriteExtra::create(v140, nullptr, v1, v196);
v1->m_prevButton = v141;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v137->addChild)(v137, v141);
m_prevButton = v1->m_prevButton;
v143 = cocos2d::CCDirector::sharedDirector();
v144.n128_f32[0] = v139 + sub_1001768D8((__int64)v143);
v145.n128_u32[0] = v138;
sub_100022980(v144, v145, &v185);
v192 = cocos2d::CCNode::convertToNodeSpace(v137, (const cocos2d::CCPoint *)&v185);
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, float, float))m_prevButton->setPosition)(
m_prevButton,
&v186,
v192.x,
v192.y);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v1->m_prevButton->setTag)(v1->m_prevButton, 0);
CCMenuItemSpriteExtra::setSizeMult(v1->m_prevButton, 1.4);
v146 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v146, 1);
v197.ptr = (void (__cdecl *)(cocos2d::CCObject *))ShardsPage::onSwitchPage;
v197.adj = 0;
v147 = CCMenuItemSpriteExtra::create(v146, nullptr, v1, v197);
v1->m_nextButton = v147;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v137->addChild)(v137, v147);
m_nextButton = v1->m_nextButton;
v149 = cocos2d::CCDirector::sharedDirector();
v150.n128_f32[0] = sub_1001768E0((__int64)v149) - v139;
v151.n128_u32[0] = v138;
sub_100022980(v150, v151, &v185);
v193 = cocos2d::CCNode::convertToNodeSpace(v137, (const cocos2d::CCPoint *)&v185);
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, float, float))m_nextButton->setPosition)(
m_nextButton,
&v186,
v193.x,
v193.y);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v1->m_nextButton->setTag)(v1->m_nextButton, 1);
CCMenuItemSpriteExtra::setSizeMult(v1->m_nextButton, 1.4);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))v1->m_mainLayer->addChild_0)(
v1->m_mainLayer,
v137,
10);
v152 = cocos2d::CCSprite::createWithSpriteFrameName("tier1Icon_001.png");
v1->m_tierSprite = v152;
v153 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))v1->m_mainLayer->addChild_0)(
v1->m_mainLayer,
v152,
10);
m_tierSprite = v1->m_tierSprite;
v153.n128_f32[0] = (float)((float)(v189 * 0.5) + 210.0) + -18.0;
v155.n128_f32[0] = (float)((float)(v190 * 0.5) + 140.0) + -18.0;
sub_100022980(v153, v155, &v186);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))m_tierSprite->setPosition)(m_tierSprite, &v186);
ShardsPage::goToPage(v1, 0);
LOBYTE(inited) = v157;
return inited;
}