//
// SupportLayer::customSetup from 0x1404c8560 to 0x1404c9115 (2997 bytes)
//
// 2 xrefs:
// > ??> @ 0x140621200
// > ??> @ 0x1406dd2d4
//
// 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=12
void SupportLayer::customSetup(SupportLayer *a1)
{
float v1; // xmm0_4
float v2; // xmm3_4
cocos2d::CCDirector *v4; // rax
ButtonSprite *v5; // rax
cocos2d::CCNode *v6; // rbx
CCMenuItemSpriteExtra *v7; // rsi
ButtonSprite *v8; // rax
cocos2d::CCNode *v9; // rbx
CCMenuItemSpriteExtra *v10; // r13
ButtonSprite *v11; // rax
cocos2d::CCNode *v12; // rbx
CCMenuItemSpriteExtra *v13; // r12
ButtonSprite *v14; // rax
cocos2d::CCNode *v15; // rbx
CCMenuItemSpriteExtra *v16; // r14
ButtonSprite *v17; // rbx
CCMenuItemSpriteExtra *v18; // rdi
struct cocos2d::CCMenu *v19; // rsi
cocos2d::CCMenu_vtbl *v20; // rbx
__int64 v21; // rax
float v22; // xmm0_4
ButtonSprite_vtbl *v23; // rbx
__int64 v24; // rax
float v25; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v26; // rbx
__int64 v27; // rax
float v28; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v29; // rbx
__int64 v30; // rax
float v31; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v32; // rbx
__int64 v33; // rax
float v34; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v35; // rbx
const cocos2d::CCPoint *v36; // rax
__int64 v37; // rbx
char v38; // bl
int v39; // r9d
__int64 v40; // rax
int v41; // r8d
GJAccountManager *v42; // rax
ButtonSprite *v43; // rbx
CCMenuItemSpriteExtra *v44; // r14
float v45; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v46; // rbx
struct cocos2d::CCPoint v47; // rax
__int64 v48; // rcx
ButtonSprite *v49; // rbx
CCMenuItemSpriteExtra *v50; // rdi
float v51; // xmm0_4
__int64 v52; // rax
float v53; // xmm6_4
float v54; // xmm7_4
__int64 v55; // rcx
cocos2d::CCNode *v56; // r12
struct cocos2d::CCSprite *v57; // rsi
float v58; // xmm0_4
cocos2d::CCSprite_vtbl *v59; // rbx
double v60; // xmm0_8
const cocos2d::CCPoint *v61; // rax
struct cocos2d::CCSprite *v62; // rax
CCMenuItemSpriteExtra *v63; // rdi
CCMenuItemSpriteExtra_vtbl *v64; // rbx
double v65; // xmm0_8
struct cocos2d::CCPoint v66; // rax
struct cocos2d::CCSprite *v67; // r14
cocos2d::CCSprite_vtbl *v68; // rbx
double v69; // xmm0_8
const cocos2d::CCPoint *v70; // rax
struct cocos2d::CCSprite *v71; // rax
CCMenuItemSpriteExtra *v72; // rdi
CCMenuItemSpriteExtra_vtbl *v73; // rbx
double v74; // xmm0_8
struct cocos2d::CCPoint v75; // rax
struct cocos2d::CCLabelBMFont *v76; // rdi
cocos2d::CCLabelBMFont_vtbl *v77; // rbx
const cocos2d::CCPoint *v78; // rax
AchievementManager *v79; // rbx
cocos2d::CCString *v80; // rax
int v81; // ebx
void *v82; // rcx
struct cocos2d::CCLabelBMFont *v83; // rdi
float v84; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v85; // rbx
const cocos2d::CCPoint *v86; // rax
struct cocos2d::CCFadeTo *v87; // rax
cocos2d::ccColor3B *v88; // r8
float v89; // [rsp+28h] [rbp-89h]
ButtonSprite *v90; // [rsp+58h] [rbp-59h]
ButtonSprite *v91; // [rsp+58h] [rbp-59h]
float v92; // [rsp+60h] [rbp-51h]
ButtonSprite *v93; // [rsp+68h] [rbp-49h]
ButtonSprite *v94; // [rsp+68h] [rbp-49h]
ButtonSprite *v95; // [rsp+68h] [rbp-49h]
ButtonSprite *v96; // [rsp+68h] [rbp-49h]
CCMenuItemSpriteExtra *v97; // [rsp+70h] [rbp-41h] BYREF
struct cocos2d::CCPoint v98; // [rsp+78h] [rbp-39h] BYREF
void *Block[2]; // [rsp+80h] [rbp-31h] BYREF
__int64 v100; // [rsp+90h] [rbp-21h]
unsigned __int64 v101; // [rsp+98h] [rbp-19h]
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v4);
v97 = (CCMenuItemSpriteExtra *)operator new(0x2C0u);
v5 = ButtonSprite::ButtonSprite((ButtonSprite *)v97);
v6 = v5;
if ( v5 )
{
if ( ButtonSprite::init_1(v5, "Links", 70, 0, 0.5, 1, (const char *)&qword_14052A4D8, "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v6);
}
else
{
((void (__fastcall *)(cocos2d::CCNode *, __int64))v6->~CCNode)(v6, 1);
v6 = nullptr;
}
}
v7 = CCMenuItemSpriteExtra::create(v6, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onLinks);
v97 = v7;
v93 = (ButtonSprite *)operator new(0x2C0u);
v8 = ButtonSprite::ButtonSprite(v93);
v9 = v8;
if ( v8 )
{
if ( ButtonSprite::init_1(v8, "Contact", 70, 0, 0.5, 1, (const char *)&qword_14052A4D8, "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
((void (__fastcall *)(cocos2d::CCNode *, __int64))v9->~CCNode)(v9, 1);
v9 = nullptr;
}
}
v10 = CCMenuItemSpriteExtra::create(v9, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onEmail);
v94 = (ButtonSprite *)operator new(0x2C0u);
v11 = ButtonSprite::ButtonSprite(v94);
v12 = v11;
if ( v11 )
{
if ( ButtonSprite::init_1(v11, "Privacy", 70, 0, 0.5, 1, (const char *)&qword_14052A4D8, "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v12);
}
else
{
((void (__fastcall *)(cocos2d::CCNode *, __int64))v12->~CCNode)(v12, 1);
v12 = nullptr;
}
}
v13 = CCMenuItemSpriteExtra::create(v12, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onPrivacy);
v95 = (ButtonSprite *)operator new(0x2C0u);
v14 = ButtonSprite::ButtonSprite(v95);
v15 = v14;
if ( v14 )
{
if ( ButtonSprite::init_1(v14, "ToS", 70, 0, 0.5, 1, (const char *)&qword_14052A4D8, "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v15);
}
else
{
((void (__fastcall *)(cocos2d::CCNode *, __int64))v15->~CCNode)(v15, 1);
v15 = nullptr;
}
}
v16 = CCMenuItemSpriteExtra::create(v15, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onTOS);
v96 = (ButtonSprite *)operator new(0x2C0u);
v17 = ButtonSprite::ButtonSprite(v96);
if ( v17 )
{
if ( ButtonSprite::init_1(v17, "SFX", 70, 0, 0.5, 1, (const char *)&qword_14052A4D8, "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v17);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v17->~ButtonSprite)(v17, 1);
v17 = nullptr;
}
}
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onSFX);
v19 = cocos2d::CCMenu::create(v7, v10, v13, v16, v18, 0);
v20 = v19->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v1, v92 * 0.5);
v22 = ((float (__fastcall *)(struct cocos2d::CCMenu *, __int64))v20->setPosition_0)(v19, v21);
v23 = (ButtonSprite_vtbl *)v97->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v22, -100.0);
v25 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v23->setPosition_0)(v97, v24);
v26 = v10->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v25, 0.0);
v28 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v26->setPosition_0)(v10, v27);
v29 = v18->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v28, 100.0);
v31 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v29->setPosition_0)(v18, v30);
v32 = v13->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v31, -50.0);
v34 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v32->setPosition_0)(v13, v33);
v35 = v16->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v34, 50.0);
v35->setPosition_0(v16, v36);
v97 = (CCMenuItemSpriteExtra *)Block;
v100 = 15;
v101 = 15;
qmemcpy(Block, "Low Detail Mod", 14);
HIWORD(Block[1]) = (unsigned __int8)aLowDetailMode[14];
v37 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v98 = (struct cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v98);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v37 = qword_1406C2ED8;
}
v38 = *(_BYTE *)(v37 + 917);
cocos2d::CCPoint::CCPoint(2.0958539e-19, (float)(v92 * 0.5) - 160.0);
LOBYTE(v39) = v38 == 0;
SupportLayer::createToggleButton((_DWORD)a1, (unsigned int)Block, v41, v39, (__int64)v19, v40);
v42 = GJAccountManager::sharedState();
if ( v42->m_accountID - v42->m_unkInt1 > 0 )
{
v90 = (ButtonSprite *)operator new(0x2C0u);
v43 = ButtonSprite::ButtonSprite(v90);
if ( v43 )
{
if ( ButtonSprite::init_1(
v43,
"Req",
220,
0,
0.40000001,
0,
(const char *)&qword_14052A4D8,
"GJ_button_04.png",
25.0) )
{
cocos2d::CCObject::autorelease(v43);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v43->~ButtonSprite)(v43, 1);
v43 = nullptr;
}
}
v44 = CCMenuItemSpriteExtra::create(v43, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onRequestAccess);
v45 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v19->addChild_1)(v19, v44);
v46 = v44->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v45, (float)(v92 * 0.5) + 150.0);
v47 = cocos2d::CCNode::convertToNodeSpace(v19, &v98);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v46->setPosition_0)(v44, v47);
if ( (float)((float)rand() / 32767.0) > 0.89999998 )
{
*(_OWORD *)Block = 0;
v100 = 4;
v101 = 15;
strcpy((char *)Block, "0023");
v48 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v98 = (struct cocos2d::CCPoint)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(*(_QWORD *)&v98);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v48 = qword_1406C2EE8;
}
if ( !GameStatsManager::isSpecialChestUnlocked(v48, Block) )
{
v91 = (ButtonSprite *)operator new(0x2C0u);
v49 = ButtonSprite::ButtonSprite(v91);
if ( v49 )
{
if ( ButtonSprite::init_1(v49, "?", 220, 0, 0.60000002, 0, "goldFont.fnt", "GJ_button_05.png", 25.0) )
{
cocos2d::CCObject::autorelease(v49);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v49->~ButtonSprite)(v49, 1);
v49 = nullptr;
}
}
v50 = CCMenuItemSpriteExtra::create(v49, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onGetReward);
v51 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v19->addChild_1)(v19, v50);
cocos2d::CCPoint::CCPoint(v51, -50.0);
v52 = (__int64)v44->getPosition_0(v44);
cocos2d::CCPoint::operator+(v52, &v97);
v50->setPosition_0(v50, (const cocos2d::CCPoint *)&v97);
}
}
}
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v19, 1);
v53 = (float)(v92 * 0.5) - 55.0;
v54 = (float)(v92 * 0.5) + 45.0;
v56 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v55);
v57 = cocos2d::CCSprite::createWithSpriteFrameName("developedBy_001.png");
v58 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCSprite *))a1->m_mainLayer->addChild_1)(
a1->m_mainLayer,
v57);
v59 = v57->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v60 = cocos2d::CCPoint::CCPoint(v58, v53);
v59->setPosition_0(v57, v61);
v62 = cocos2d::CCSprite::createWithSpriteFrameName("robtoplogo_small.png");
v63 = CCMenuItemSpriteExtra::create(v62, nullptr, a1, (cocos2d::SEL_MenuHandler *)MenuLayer::onRobTop);
v56->addChild_1(v56, v63);
v64 = v63->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v57->getPosition_0(v57);
v65 = cocos2d::CCPoint::CCPoint(*(float *)&v60, v54);
v66 = cocos2d::CCNode::convertToNodeSpace(v56, &v98);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v64->setPosition_0)(v63, v66);
v67 = cocos2d::CCSprite::createWithSpriteFrameName("poweredBy_001.png");
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v67);
v68 = v67->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v57->getPosition_0(v57);
v69 = cocos2d::CCPoint::CCPoint(*(float *)&v65, v53);
v68->setPosition_0(v67, v70);
v71 = cocos2d::CCSprite::createWithSpriteFrameName("cocos2DxLogo.png");
v72 = CCMenuItemSpriteExtra::create(v71, nullptr, a1, (cocos2d::SEL_MenuHandler *)SupportLayer::onCocos2d);
v56->addChild_1(v56, v72);
v73 = v72->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v67->getPosition_0(v67);
v74 = cocos2d::CCPoint::CCPoint(*(float *)&v69, v54);
v75 = cocos2d::CCNode::convertToNodeSpace(v56, &v98);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v73->setPosition_0)(v72, v75);
v76 = cocos2d::CCLabelBMFont::create("FMOD Studio by Firelight Technologies Pty Ltd.", "goldFont.fnt");
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v76->setScale_0)(v76);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v76);
v77 = v76->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v67->getPosition_0(v67);
cocos2d::CCPoint::CCPoint(*(float *)&v74, v92 * 0.5);
v77->setPosition_0(v76, v78);
v79 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v100 = 0;
v101 = 15;
Block[0] = sub_14003AA10(0x20u);
v100 = 21;
v101 = 31;
strcpy((char *)Block[0], "geometry.ach.secret08");
v80 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v79->m_reportedAchievements, Block);
v81 = cocos2d::CCString::intValue(v80);
if ( v101 > 0xF )
{
v82 = Block[0];
if ( v101 + 1 >= 0x1000 )
{
v82 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v82 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v82);
}
if ( v81 < 100 )
{
v83 = cocos2d::CCLabelBMFont::create("\"blockbite\"", "chatFont.fnt");
a1->addChild_0(a1, v83, 3);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v83->setScale_0)(v83);
v83->setColor(&v83->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&unk_140529C98);
v84 = ((float (__fastcall *)(cocos2d::CCRGBAProtocol *, _QWORD))v83->setOpacity)(&v83->cocos2d::CCRGBAProtocol, 0);
v85 = v83->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v84, v92 - 32.0);
v85->setPosition_0(v83, v86);
v87 = cocos2d::CCFadeTo::create(10.0, 0x64u);
cocos2d::CCNode::runAction((CCLightFlash *)v83, (cocos2d::CCPoint)v87, v88, v2, v89);
}
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v56, 2);
}