//
// GJGarageLayer::init from 0x140273050 to 0x140274a64 (6676 bytes)
//
// 4 xrefs:
// > GJGarageLayer::scene @ 0x140273006
// > GJGarageLayer::scene @ 0x140272ff7
// > ??> @ 0x14056ae50
// > ??> @ 0x1406d0ef0
//
// 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=27
bool GJGarageLayer::init(GJGarageLayer *a1)
{
float v1; // xmm0_4
bool result; // al
_BOOL8 v4; // rdx
__int64 v5; // rax
_BOOL8 v6; // rdx
__int64 v7; // rcx
cocos2d::CCDirector *v8; // rax
struct cocos2d::CCSprite *v9; // rdi
cocos2d::CCSprite_vtbl *v10; // rbx
const cocos2d::CCPoint *v11; // rax
float v12; // xmm0_4
cocos2d::CCSprite_vtbl *v13; // rbx
double v14; // xmm0_8
const cocos2d::CCPoint *v15; // rax
struct cocos2d::CCSprite *v16; // rdi
cocos2d::CCSprite_vtbl *v17; // rbx
const cocos2d::CCPoint *v18; // rax
cocos2d::CCSprite_vtbl *v19; // rbx
__int64 v20; // rcx
cocos2d::CCDirector *v21; // rax
__int64 v22; // rcx
cocos2d::CCDirector *v23; // rax
float v24; // xmm0_4
double v25; // xmm0_8
const cocos2d::CCPoint *v26; // rax
size_t v27; // r14
struct cocos2d::CCSprite *v28; // rdi
cocos2d::CCSprite_vtbl *v29; // rbx
const cocos2d::CCPoint *v30; // rax
cocos2d::CCSprite_vtbl *v31; // rbx
__int64 v32; // rcx
cocos2d::CCDirector *v33; // rax
__int64 v34; // rcx
cocos2d::CCDirector *v35; // rax
float v36; // xmm0_4
double v37; // xmm0_8
const cocos2d::CCPoint *v38; // rax
struct cocos2d::CCSprite *v39; // rdi
cocos2d::CCSprite_vtbl *v40; // rbx
const cocos2d::CCPoint *v41; // rax
cocos2d::CCSprite_vtbl *v42; // rbx
__int64 v43; // rcx
cocos2d::CCDirector *v44; // rax
__int64 v45; // rcx
cocos2d::CCDirector *v46; // rax
float v47; // xmm0_4
const cocos2d::CCPoint *v48; // rax
GJAccountManager *v49; // rax
const char *v50; // r9
int m_accountID; // edx
int m_unkInt1; // ecx
const char *v53; // rax
CCTextInputNode *v54; // rax
CCTextInputNode_vtbl *v55; // rbx
cocos2d::CCDirector *v56; // rax
float v57; // xmm0_4
const cocos2d::CCPoint *v58; // rax
CCTextInputNode *m_usernameInput; // rcx
CCTextInputNode *v60; // rcx
std::string *p_m_allowedChars; // rcx
__int64 *v62; // rdx
GJAccountManager *v63; // rax
GJAccountManager *v64; // rax
__int128 *v65; // rdx
struct cocos2d::CCSprite *v66; // rdi
const struct cocos2d::CCSize *v67; // rax
double v68; // xmm0_8
const cocos2d::CCPoint *v69; // rax
__int64 v70; // rdx
void **v71; // rcx
size_t v72; // rdi
size_t v73; // r8
__int64 v74; // rbx
__int64 v75; // rdx
__int128 *p_Buf2; // rdx
__int64 v77; // rax
struct cocos2d::CCSprite *v78; // rdi
float v79; // xmm0_4
const cocos2d::CCPoint *v80; // rax
struct cocos2d::CCSprite *v81; // rdi
float v82; // xmm0_4
cocos2d::CCSprite_vtbl *v83; // rbx
const cocos2d::CCPoint *v84; // rax
__int64 v85; // rax
SimplePlayer *v86; // rax
SimplePlayer *m_playerObject; // rbx
GJRobotSprite *v88; // rax
double v89; // xmm0_8
__int64 v90; // rax
_DWORD *v91; // r8
int v92; // edx
IconType v93; // r8d
struct cocos2d::CCSprite *v94; // rax
CCMenuItemSpriteExtra *v95; // r13
struct cocos2d::CCMenu *v96; // r12
cocos2d::CCMenu_vtbl *v97; // rbx
__int64 v98; // rcx
cocos2d::CCDirector *v99; // rax
__int64 v100; // rcx
cocos2d::CCDirector *v101; // rax
float v102; // xmm0_4
const cocos2d::CCPoint *v103; // rax
struct cocos2d::CCSprite *v104; // rax
CCMenuItemSpriteExtra *v105; // rdi
__int64 v106; // rax
__int64 v107; // rax
double v108; // xmm0_8
__int64 v109; // rax
float v110; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v111; // rbx
struct cocos2d::CCPoint v112; // rax
struct cocos2d::CCSprite *v113; // rax
CCMenuItemSpriteExtra *v114; // rdi
float v115; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v116; // rbx
struct cocos2d::CCPoint v117; // rax
struct cocos2d::CCSprite *v118; // rax
CCMenuItemSpriteExtra *v119; // rdi
float v120; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v121; // rbx
struct cocos2d::CCPoint v122; // rax
struct cocos2d::CCSprite *v123; // r15
cocos2d::CCSprite_vtbl *v124; // rbx
__int64 v125; // rcx
cocos2d::CCDirector *v126; // rax
__int64 v127; // rcx
cocos2d::CCDirector *v128; // rax
float v129; // xmm0_4
const cocos2d::CCPoint *v130; // rax
GameStatsManager *v131; // rcx
int Stat; // eax
cocos2d::CCString *v133; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v135; // rdi
float v136; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v137; // rbx
__int64 v138; // rax
float v139; // xmm0_4
__int64 v140; // rax
struct cocos2d::CCSprite *v141; // r14
float v142; // xmm0_4
__int64 v143; // rax
GameStatsManager *v144; // rcx
int v145; // eax
cocos2d::CCString *v146; // rax
const char *v147; // rax
struct cocos2d::CCLabelBMFont *v148; // rdi
float v149; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v150; // rbx
__int64 v151; // rax
float v152; // xmm0_4
__int64 v153; // rax
struct cocos2d::CCSprite *v154; // r15
float v155; // xmm0_4
__int64 v156; // rax
GameStatsManager *v157; // rcx
int v158; // eax
cocos2d::CCString *v159; // rax
const char *v160; // rax
struct cocos2d::CCLabelBMFont *v161; // rdi
float v162; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v163; // rbx
__int64 v164; // rax
float v165; // xmm0_4
__int64 v166; // rax
struct cocos2d::CCSprite *v167; // r14
float v168; // xmm0_4
__int64 v169; // rax
GameStatsManager *v170; // rcx
int v171; // eax
cocos2d::CCString *v172; // rax
const char *v173; // rax
struct cocos2d::CCLabelBMFont *v174; // rdi
float v175; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v176; // rbx
__int64 v177; // rax
float v178; // xmm0_4
__int64 v179; // rax
struct cocos2d::CCSprite *v180; // r15
float v181; // xmm0_4
__int64 v182; // rax
GameStatsManager *v183; // rcx
int v184; // eax
cocos2d::CCString *v185; // rax
const char *v186; // rax
struct cocos2d::CCLabelBMFont *v187; // rdi
float v188; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v189; // rbx
__int64 v190; // rax
float v191; // xmm0_4
__int64 v192; // rax
struct cocos2d::CCSprite *v193; // r14
float v194; // xmm0_4
__int64 v195; // rax
GameStatsManager *v196; // rcx
int v197; // eax
cocos2d::CCString *v198; // rax
const char *v199; // rax
struct cocos2d::CCLabelBMFont *v200; // rdi
float v201; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v202; // rbx
__int64 v203; // rax
float v204; // xmm0_4
__int64 v205; // rax
struct cocos2d::CCSprite *v206; // r15
float v207; // xmm0_4
__int64 v208; // rax
GameStatsManager *v209; // rcx
int v210; // eax
cocos2d::CCString *v211; // rax
const char *v212; // rax
struct cocos2d::CCLabelBMFont *v213; // rdi
float v214; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v215; // rbx
__int64 v216; // rax
float v217; // xmm0_4
__int64 v218; // rax
__int64 v219; // rdx
__int64 v220; // rcx
struct cocos2d::CCSprite *v221; // rbx
CCMenuItemSpriteExtra *v222; // rdi
CCMenuItemSpriteExtra_vtbl *v223; // rbx
__int64 v224; // rcx
cocos2d::CCDirector *v225; // rax
__int64 v226; // rcx
cocos2d::CCDirector *v227; // rax
float v228; // xmm0_4
struct cocos2d::CCPoint v229; // rax
int v230; // [rsp+28h] [rbp-E0h]
__int64 *v231; // [rsp+38h] [rbp-D0h] BYREF
void *v232; // [rsp+40h] [rbp-C8h]
__int64 v233; // [rsp+48h] [rbp-C0h] BYREF
__int64 v234; // [rsp+50h] [rbp-B8h]
struct cocos2d::CCPoint v235; // [rsp+58h] [rbp-B0h] BYREF
__int64 Src[3]; // [rsp+60h] [rbp-A8h] BYREF
size_t Size; // [rsp+78h] [rbp-90h]
unsigned __int64 v238; // [rsp+80h] [rbp-88h]
void *Buf1[2]; // [rsp+88h] [rbp-80h] BYREF
size_t v240; // [rsp+98h] [rbp-70h]
unsigned __int64 v241; // [rsp+A0h] [rbp-68h]
__int128 Buf2; // [rsp+A8h] [rbp-60h] BYREF
__int64 v243; // [rsp+B8h] [rbp-50h]
unsigned __int64 v244; // [rsp+C0h] [rbp-48h]
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v231 = (__int64 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v231);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
*(_BYTE *)(v5 + 560) = 1;
*(_DWORD *)(v5 + 700) = 0;
LOBYTE(v4) = 1;
a1->setKeypadEnabled(a1, v4);
LOBYTE(v6) = 1;
a1->setKeyboardEnabled(a1, v6);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8);
v9 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v10 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v1, 0.0);
v10->setAnchorPoint(v9, v11);
a1->addChild_0(a1, v9, -2);
((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setScaleX)(v9);
v12 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v9->setScaleY)(v9);
v13 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = cocos2d::CCPoint::CCPoint(v12, -5.0);
v13->setPosition_0(v9, v15);
LOWORD(v233) = -26986;
BYTE2(v233) = -106;
v9->setColor(&v9->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v233);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v17 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v14, 0.0);
v17->setAnchorPoint(v16, v18);
v19 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v21 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v20);
cocos2d::CCDirector::getScreenTop(v21);
v23 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v22);
v24 = cocos2d::CCDirector::getScreenLeft(v23) - 1.0;
v25 = cocos2d::CCPoint::CCPoint(v24, v24);
v19->setPosition_0(v16, v26);
cocos2d::CCSprite::setFlipY(v16, 1);
v27 = -1;
a1->addChild_0(a1, v16, -1);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v29 = v28->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v25, 0.0);
v29->setAnchorPoint(v28, v30);
v31 = v28->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v33 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v32);
cocos2d::CCDirector::getScreenBottom(v33);
v35 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v34);
v36 = cocos2d::CCDirector::getScreenLeft(v35) - 1.0;
v37 = cocos2d::CCPoint::CCPoint(v36, v36);
v31->setPosition_0(v28, v38);
a1->addChild_0(a1, v28, 1);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v40 = v39->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v37, 1.0);
v40->setAnchorPoint(v39, v41);
v42 = v39->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v44 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v43);
cocos2d::CCDirector::getScreenBottom(v44);
v46 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v45);
v47 = cocos2d::CCDirector::getScreenRight(v46) + 1.0;
cocos2d::CCPoint::CCPoint(v47, v47);
v42->setPosition_0(v39, v48);
cocos2d::CCSprite::setFlipX(v39, 1);
a1->addChild_0(a1, v39, 1);
v49 = GJAccountManager::sharedState();
m_accountID = v49->m_accountID;
m_unkInt1 = v49->m_unkInt1;
v53 = (const char *)&qword_14052A4D8;
if ( m_accountID != m_unkInt1 )
v53 = "goldFont.fnt";
v54 = CCTextInputNode::create(180.0, 50.0, "Player", v50, v230, v53);
a1->m_usernameInput = v54;
a1->addChild_0(a1, v54, 20);
a1->m_usernameInput->m_delegate = &a1->TextInputDelegate;
v55 = a1->m_usernameInput->__vftable;
v56 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(&a1->TextInputDelegate);
v57 = cocos2d::CCDirector::getScreenTop(v56) - 34.0;
cocos2d::CCPoint::CCPoint(v57, *(float *)&v234 * 0.5);
v55->setPosition_0(a1->m_usernameInput, v58);
a1->m_usernameInput->m_textField->setVisible(a1->m_usernameInput->m_textField, 0);
a1->m_usernameInput->m_maxLabelLength = 15;
LOWORD(v233) = -21896;
m_usernameInput = a1->m_usernameInput;
*(_WORD *)&m_usernameInput->m_placeholderColor.r = -21896;
m_usernameInput->m_placeholderColor.b = -16;
CCTextInputNode::refreshLabel(m_usernameInput);
v60 = a1->m_usernameInput;
v60->m_placeholderScale = 0.69999999;
CCTextInputNode::refreshLabel(v60);
*(_OWORD *)&Src[1] = 0;
Size = 0;
v238 = 15;
Src[1] = (__int64)sub_14003AA10(0x40u);
Size = 62;
v238 = 63;
strcpy((char *)Src[1], "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
v231 = &Src[1];
p_m_allowedChars = &a1->m_usernameInput->m_allowedChars;
if ( p_m_allowedChars != (std::string *)&Src[1] )
{
v62 = &Src[1];
if ( v238 > 0xF )
v62 = (__int64 *)Src[1];
sub_14003CCE0((void **)p_m_allowedChars, v62, Size);
}
sub_14003A830((__int64)&Src[1]);
v63 = GJAccountManager::sharedState();
if ( v63->m_accountID == v63->m_unkInt1 )
{
Buf2 = 0;
v243 = 0;
v244 = 15;
LOBYTE(Buf2) = 0;
v70 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v70 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)Buf1, v70 + 616);
v71 = Buf1;
if ( v241 > 0xF )
v71 = (void **)Buf1[0];
v72 = v240;
v73 = v240;
if ( v240 )
v73 = 0;
LODWORD(v74) = memcmp(v71, &Buf2, v73);
if ( !(_DWORD)v74 )
v74 = v72 != 0;
sub_14003A830((__int64)Buf1);
if ( (_DWORD)v74 )
{
v75 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v75 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)&Buf2, v75 + 616);
p_Buf2 = &Buf2;
if ( v244 > 0xF )
p_Buf2 = (__int128 *)Buf2;
*(_OWORD *)Buf1 = 0;
v240 = 0;
v241 = 0;
do
++v27;
while ( *((_BYTE *)p_Buf2 + v27) );
sub_14003A930(Buf1, p_Buf2, v27);
CCTextInputNode::setString((__int64)a1->m_usernameInput, Buf1);
sub_14003A830((__int64)&Buf2);
}
v77 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v77 = qword_1406C2ED8;
}
if ( !*(_BYTE *)(v77 + 921) )
{
v78 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_nameTxt_001.png");
v79 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCSprite *))a1->addChild_1)(a1, v78);
cocos2d::CCPoint::CCPoint(v79, 115.0);
v80 = a1->m_usernameInput->getPosition_0(a1->m_usernameInput);
cocos2d::CCPoint::operator+(v80, &v231);
v78->setPosition_0(v78, (const cocos2d::CCPoint *)&v231);
}
}
else
{
v64 = GJAccountManager::sharedState();
sub_14003BDB0((__int64)&Buf2, (__int64)&v64->m_username);
v65 = &Buf2;
if ( v244 > 0xF )
v65 = (__int128 *)Buf2;
*(_OWORD *)Buf1 = 0;
v240 = 0;
v241 = 0;
do
++v27;
while ( *((_BYTE *)v65 + v27) );
sub_14003A930(Buf1, v65, v27);
CCTextInputNode::setString((__int64)a1->m_usernameInput, Buf1);
sub_14003A830((__int64)&Buf2);
a1->m_usernameInput->setTouchEnabled(a1->m_usernameInput, 0);
v66 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_14053DE08);
a1->addChild_0(a1, v66, 2);
v67 = a1->m_usernameInput->m_textLabel->getContentSize(a1->m_usernameInput->m_textLabel);
v68 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v233, v67);
cocos2d::CCPoint::CCPoint(*(float *)&v68, (float)(*(float *)&v233 * 0.5) + 8.0);
v69 = a1->m_usernameInput->getPosition_0(a1->m_usernameInput);
cocos2d::CCPoint::operator+(v69, &v231);
v66->setPosition_0(v66, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCSprite *))v66->setScale_0)(v66);
}
v81 = cocos2d::CCSprite::createWithSpriteFrameName("floorLine_001.png");
v82 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCSprite *, _QWORD))a1->addChild_0)(a1, v81, 0);
v83 = v81->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v82, *(float *)&v234 * 0.5);
v83->setPosition_0(v81, v84);
v233 = 0x100000302LL;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v81->setBlendFunc)(
&v81->cocos2d::CCTextureProtocol,
0x100000302LL);
v85 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v85 = qword_1406C2ED8;
}
v86 = SimplePlayer::create(*(_DWORD *)(v85 + 708) - *(_DWORD *)(v85 + 712));
a1->m_playerObject = v86;
a1->addChild_0(a1, v86, 0);
m_playerObject = a1->m_playerObject;
if ( !m_playerObject->m_robotSprite )
{
v88 = GJRobotSprite::create(1);
m_playerObject->m_robotSprite = v88;
m_playerObject->addChild_1(m_playerObject, v88);
m_playerObject->m_robotSprite->setVisible(m_playerObject->m_robotSprite, 0);
}
SimplePlayer::createSpiderSprite(a1->m_playerObject, 1);
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
((void (__fastcall *)(SimplePlayer *))a1->m_playerObject->setScale_0)(a1->m_playerObject);
v89 = ((double (__fastcall *)(SimplePlayer *))a1->m_playerObject->getScale)(a1->m_playerObject);
cocos2d::CCPoint::CCPoint((float)((float)(*(float *)&v89 * 30.0) * 0.5) + 1.0, 0.0);
v90 = (__int64)v81->getPosition_0(v81);
cocos2d::CCPoint::operator+(v90, &v231);
a1->m_playerObject->setPosition_0(a1->m_playerObject, (const cocos2d::CCPoint *)&v231);
GJGarageLayer::updatePlayerColors(a1);
v91 = (_DWORD *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v91 = (_DWORD *)qword_1406C2ED8;
}
switch ( v91[227] )
{
case 1:
v92 = v91[180] - v91[181];
v93 = Ship;
goto LABEL_53;
case 2:
v92 = v91[183] - v91[184];
v93 = Ball;
goto LABEL_53;
case 3:
v92 = v91[186] - v91[187];
v93 = Ufo;
goto LABEL_53;
case 4:
v92 = v91[189] - v91[190];
v93 = Wave;
goto LABEL_53;
case 5:
v92 = v91[192] - v91[193];
v93 = Robot;
goto LABEL_53;
case 6:
v92 = v91[195] - v91[196];
v93 = Spider;
goto LABEL_53;
case 7:
v92 = v91[198] - v91[199];
v93 = Swing;
goto LABEL_53;
case 8:
v92 = v91[219] - v91[220];
v93 = Jetpack;
LABEL_53:
SimplePlayer::updatePlayerFrame(a1->m_playerObject, v92, v93);
break;
default:
break;
}
GJGarageLayer::setupIconSelect(a1);
v94 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v95 = CCMenuItemSpriteExtra::create(v94, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJGarageLayer::onBack);
HIDWORD(v95->m_pfnSelector.adj) = 1070386381;
v96 = cocos2d::CCMenu::create(v95, 0);
a1->addChild_0(a1, v96, 1);
v97 = v96->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v99 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v98);
cocos2d::CCDirector::getScreenTop(v99);
v101 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v100);
v102 = cocos2d::CCDirector::getScreenLeft(v101) + 24.0;
cocos2d::CCPoint::CCPoint(v102, v102);
v97->setPosition_0(v96, v103);
v104 = cocos2d::CCSprite::createWithSpriteFrameName("shopRope_001.png");
v105 = CCMenuItemSpriteExtra::create(v104, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJGarageLayer::onShop);
v106 = (__int64)v105->getNormalImage(v105);
v107 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v106 + 200LL))(v106);
v108 = cocos2d::CCPoint::operator=(&v105->m_unselectedDuration, v107);
LODWORD(v105->m_duration) = 1;
cocos2d::CCPoint::CCPoint(*(float *)&v108, 0.0);
cocos2d::CCPoint::operator=((char *)&v105->m_selectSound.m_data.m_capacity + 4, v109);
v105->m_offset.x = 0.30000001;
v105->m_offset.y = 0.30000001;
v110 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v96->addChild_1)(v96, v105);
v111 = v105->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v110, (float)(*(float *)&v234 * 0.5) - 135.0);
v112 = cocos2d::CCNode::convertToNodeSpace(v96, (const struct cocos2d::CCPoint *)&v231);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v111->setPosition_0)(v105, v112);
v113 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_shardsBtn_001.png");
v114 = CCMenuItemSpriteExtra::create(v113, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJGarageLayer::onShards);
v115 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v96->addChild_1)(v96, v114);
v116 = v114->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v115, 30.0);
v117 = cocos2d::CCNode::convertToNodeSpace(v96, (const struct cocos2d::CCPoint *)&v231);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v116->setPosition_0)(v114, v117);
v118 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_paintBtn_001.png");
v119 = CCMenuItemSpriteExtra::create(v118, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJGarageLayer::onPaint);
v120 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v96->addChild_1)(v96, v119);
v121 = v119->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v120, 30.0);
v122 = cocos2d::CCNode::convertToNodeSpace(v96, (const struct cocos2d::CCPoint *)&v231);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v121->setPosition_0)(v119, v122);
v123 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_starsIcon_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v123->setScale_0)(v123);
a1->addChild_1(a1, v123);
v124 = v123->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v126 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v125);
cocos2d::CCDirector::getScreenTop(v126);
v128 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v127);
v129 = (float)(cocos2d::CCDirector::getScreenRight(v128) - 18.0) - 0.0;
cocos2d::CCPoint::CCPoint(v129, v129);
v124->setPosition_0(v123, v130);
v131 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v231 = (__int64 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v231);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v131 = (GameStatsManager *)qword_1406C2EE8;
}
Stat = GameStatsManager::getStat(v131, "6");
v133 = cocos2d::CCString::createWithFormat("%i", Stat);
CString = cocos2d::CCString::getCString(v133);
v135 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_14052A4D8);
v136 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v135);
v137 = v135->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v136, 1.0);
v139 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v137->setAnchorPoint)(v135, v138);
cocos2d::CCPoint::CCPoint(v139, -12.0);
v140 = (__int64)v123->getPosition_0(v123);
cocos2d::CCPoint::operator+(v140, &v231);
v135->setPosition_0(v135, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v135->setScale_0)(v135);
v141 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_140547148);
((void (__fastcall *)(struct cocos2d::CCSprite *))v141->setScale_0)(v141);
v142 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCSprite *))a1->addChild_1)(a1, v141);
cocos2d::CCPoint::CCPoint(v142, 0.0);
v143 = (__int64)v123->getPosition_0(v123);
cocos2d::CCPoint::operator+(v143, &v231);
v141->setPosition_0(v141, (const cocos2d::CCPoint *)&v231);
v144 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v233 = (__int64)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v233);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v144 = (GameStatsManager *)qword_1406C2EE8;
}
v145 = GameStatsManager::getStat(v144, "28");
v146 = cocos2d::CCString::createWithFormat("%i", v145);
v147 = cocos2d::CCString::getCString(v146);
v148 = cocos2d::CCLabelBMFont::create(v147, (const char *)&qword_14052A4D8);
v149 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v148);
v150 = v148->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v149, 1.0);
v152 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v150->setAnchorPoint)(v148, v151);
cocos2d::CCPoint::CCPoint(v152, -12.0);
v153 = (__int64)v141->getPosition_0(v141);
cocos2d::CCPoint::operator+(v153, &v231);
v148->setPosition_0(v148, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v148->setScale_0)(v148);
v154 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_coinsIcon_001.png");
v155 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCSprite *))a1->addChild_1)(a1, v154);
cocos2d::CCPoint::CCPoint(v155, 0.0);
v156 = (__int64)v141->getPosition_0(v141);
cocos2d::CCPoint::operator+(v156, &v231);
v154->setPosition_0(v154, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCSprite *))v154->setScale_0)(v154);
v157 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v232 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v157 = (GameStatsManager *)qword_1406C2EE8;
}
v158 = GameStatsManager::getStat(v157, "8");
v159 = cocos2d::CCString::createWithFormat("%i", v158);
v160 = cocos2d::CCString::getCString(v159);
v161 = cocos2d::CCLabelBMFont::create(v160, (const char *)&qword_14052A4D8);
v162 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v161);
v163 = v161->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v162, 1.0);
v165 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v163->setAnchorPoint)(v161, v164);
cocos2d::CCPoint::CCPoint(v165, -12.0);
v166 = (__int64)v154->getPosition_0(v154);
cocos2d::CCPoint::operator+(v166, &v231);
v161->setPosition_0(v161, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v161->setScale_0)(v161);
v167 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_coinsIcon2_001.png");
v168 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCSprite *))a1->addChild_1)(a1, v167);
cocos2d::CCPoint::CCPoint(v168, 0.0);
v169 = (__int64)v154->getPosition_0(v154);
cocos2d::CCPoint::operator+(v169, &v231);
v167->setPosition_0(v167, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCSprite *))v167->setScale_0)(v167);
v170 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v232 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v170 = (GameStatsManager *)qword_1406C2EE8;
}
v171 = GameStatsManager::getStat(v170, "12");
v172 = cocos2d::CCString::createWithFormat("%i", v171);
v173 = cocos2d::CCString::getCString(v172);
v174 = cocos2d::CCLabelBMFont::create(v173, (const char *)&qword_14052A4D8);
v175 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v174);
v176 = v174->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v175, 1.0);
v178 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v176->setAnchorPoint)(v174, v177);
cocos2d::CCPoint::CCPoint(v178, -12.0);
v179 = (__int64)v167->getPosition_0(v167);
cocos2d::CCPoint::operator+(v179, &v231);
v174->setPosition_0(v174, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v174->setScale_0)(v174);
v180 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_14053DCE8);
a1->addChild_1(a1, v180);
v181 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v180->setScale_0)(v180);
cocos2d::CCPoint::CCPoint(v181, 0.0);
v182 = (__int64)v167->getPosition_0(v167);
cocos2d::CCPoint::operator+(v182, &v231);
v180->setPosition_0(v180, (const cocos2d::CCPoint *)&v231);
v183 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v232 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v232);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v183 = (GameStatsManager *)qword_1406C2EE8;
}
v184 = GameStatsManager::getStat(v183, "14");
v185 = cocos2d::CCString::createWithFormat("%i", v184);
v186 = cocos2d::CCString::getCString(v185);
v187 = cocos2d::CCLabelBMFont::create(v186, (const char *)&qword_14052A4D8);
v188 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v187);
v189 = v187->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v188, 1.0);
v191 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v189->setAnchorPoint)(v187, v190);
cocos2d::CCPoint::CCPoint(v191, -12.0);
v192 = (__int64)v180->getPosition_0(v180);
cocos2d::CCPoint::operator+(v192, &v231);
v187->setPosition_0(v187, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v187->setScale_0)(v187);
v193 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_diamondsIcon_001.png");
a1->addChild_1(a1, v193);
v194 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v193->setScale_0)(v193);
cocos2d::CCPoint::CCPoint(v194, 0.0);
v195 = (__int64)v180->getPosition_0(v180);
cocos2d::CCPoint::operator+(v195, &v231);
v193->setPosition_0(v193, (const cocos2d::CCPoint *)&v231);
v196 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v235 = (struct cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(*(_QWORD *)&v235);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v196 = (GameStatsManager *)qword_1406C2EE8;
}
v197 = GameStatsManager::getStat(v196, "13");
v198 = cocos2d::CCString::createWithFormat("%i", v197);
v199 = cocos2d::CCString::getCString(v198);
v200 = cocos2d::CCLabelBMFont::create(v199, (const char *)&qword_14052A4D8);
v201 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v200);
v202 = v200->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v201, 1.0);
v204 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v202->setAnchorPoint)(v200, v203);
cocos2d::CCPoint::CCPoint(v204, -12.0);
v205 = (__int64)v193->getPosition_0(v193);
cocos2d::CCPoint::operator+(v205, &v231);
v200->setPosition_0(v200, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v200->setScale_0)(v200);
v206 = cocos2d::CCSprite::createWithSpriteFrameName("currencyDiamondIcon_001.png");
a1->addChild_1(a1, v206);
v207 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v206->setScale_0)(v206);
cocos2d::CCPoint::CCPoint(v207, 0.0);
v208 = (__int64)v193->getPosition_0(v193);
cocos2d::CCPoint::operator+(v208, &v231);
v206->setPosition_0(v206, (const cocos2d::CCPoint *)&v231);
v209 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
Src[0] = (__int64)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(Src[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v209 = (GameStatsManager *)qword_1406C2EE8;
}
v210 = GameStatsManager::getStat(v209, (const char *)&word_14055A524);
v211 = cocos2d::CCString::createWithFormat("%i", v210);
v212 = cocos2d::CCString::getCString(v211);
v213 = cocos2d::CCLabelBMFont::create(v212, (const char *)&qword_14052A4D8);
v214 = ((float (__fastcall *)(GJGarageLayer *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v213);
v215 = v213->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v214, 1.0);
v217 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v215->setAnchorPoint)(v213, v216);
cocos2d::CCPoint::CCPoint(v217, -12.0);
v218 = (__int64)v206->getPosition_0(v206);
cocos2d::CCPoint::operator+(v218, &v231);
v213->setPosition_0(v213, (const cocos2d::CCPoint *)&v231);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v213->setScale_0)(v213);
v220 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Src[0] = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Src[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v220 = qword_1406C2ED8;
}
if ( *(_DWORD *)(v220 + 652) != *(_DWORD *)(v220 + 656) )
{
v221 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v221->setScale_0)(v221);
v222 = CCMenuItemSpriteExtra::create(v221, nullptr, a1, (cocos2d::SEL_MenuHandler *)GJGarageLayer::onInfo);
HIDWORD(v222->m_pfnSelector.adj) = 0x40000000;
v223 = v222->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v225 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v224);
cocos2d::CCDirector::getScreenTop(v225);
v227 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v226);
v228 = cocos2d::CCDirector::getScreenRight(v227) - 15.0;
cocos2d::CCPoint::CCPoint(v228, v228);
v229 = cocos2d::CCNode::convertToNodeSpace(v96, &v235);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v223->setPosition_0)(v222, v229);
}
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v220, v219) + 197) )
GameToolbox::addBackButton(a1, v95);
return 1;
}
return result;
}