//
// SupportLayer::customSetup from 0x100398970 to 0x100399232 (2242 bytes)
//
// 1 xrefs:
// > ??> @ 0x100922300
//
// 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
//
void __fastcall SupportLayer::customSetup(SupportLayer *a1)
{
ButtonSprite *v1; // rax
CCMenuItemSpriteExtra *v2; // rax
int v3; // r14d
ButtonSprite *v4; // rax
ButtonSprite *v5; // rax
CCMenuItemSpriteExtra *v6; // rax
int v7; // r12d
ButtonSprite *v8; // rax
CCMenuItemSpriteExtra *v9; // rax
int v10; // r15d
ButtonSprite *v11; // rax
CCMenuItemSpriteExtra *v12; // rbx
const cocos2d::CCPoint *v13; // r12
GJAccountManager *v14; // rax
ButtonSprite *v15; // rax
CCMenuItemSpriteExtra *v16; // r14
double v17; // xmm0_8
GameStatsManager *v18; // rax
bool isSpecialChestUnlocked; // bl
ButtonSprite *v20; // rax
CCMenuItemSpriteExtra *v21; // rbx
unsigned __int64 *v22; // r14
cocos2d::CCMenu *v23; // r14
cocos2d::CCSprite *v24; // rbx
cocos2d::CCSprite *v25; // rax
CCMenuItemSpriteExtra *v26; // r15
__int64 v27; // rax
cocos2d::CCSprite *v28; // r15
__int64 v29; // rax
cocos2d::CCSprite *v30; // rax
CCMenuItemSpriteExtra *v31; // rbx
__int64 v32; // rax
SupportLayer *v33; // r12
cocos2d::CCLabelBMFont *v34; // rbx
__int64 v35; // rax
AchievementManager *v36; // rax
cocos2d::CCLabelBMFont *v37; // rbx
cocos2d::CCFadeTo *v38; // rax
CCMenuItemSpriteExtra *v39; // [rsp+18h] [rbp-98h]
char v40; // [rsp+20h] [rbp-90h] BYREF
char v41[15]; // [rsp+21h] [rbp-8Fh] BYREF
void *v42; // [rsp+30h] [rbp-80h]
char v43; // [rsp+38h] [rbp-78h] BYREF
_BYTE v44[23]; // [rsp+39h] [rbp-77h] BYREF
unsigned __int64 v45; // [rsp+50h] [rbp-60h] BYREF
CCMenuItemSpriteExtra *v46; // [rsp+58h] [rbp-58h]
SupportLayer *v47; // [rsp+60h] [rbp-50h]
void *v48; // [rsp+68h] [rbp-48h]
float v49; // [rsp+74h] [rbp-3Ch]
float v50; // [rsp+78h] [rbp-38h] BYREF
float v51; // [rsp+7Ch] [rbp-34h]
double v52[6]; // [rsp+80h] [rbp-30h] BYREF
double v53; // 0:xmm0_8.8
double v54; // 0:xmm0_8.8
double v55; // 0:xmm0_8.8
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v50);
v1 = ButtonSprite::create_1("Links", 70, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
v2 = CCMenuItemSpriteExtra::create(v1, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onLinks);
v3 = (int)v2;
v39 = v2;
v4 = ButtonSprite::create_1("Contact", 70, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
v46 = CCMenuItemSpriteExtra::create(
v4,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onEmail);
v5 = ButtonSprite::create_1("Privacy", 70, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
v6 = CCMenuItemSpriteExtra::create(
v5,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onPrivacy);
v7 = (int)v6;
v48 = v6;
v8 = ButtonSprite::create_1("ToS", 70, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
v9 = CCMenuItemSpriteExtra::create(v8, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onTOS);
v10 = (int)v9;
v47 = (SupportLayer *)v9;
v11 = ButtonSprite::create_1("SFX", 70, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onSFX);
v13 = (const cocos2d::CCPoint *)sub_100792C50(v3, (_DWORD)v46, v7, v10, (_DWORD)v12, 0);
sub_10028CBE0((float *)v52, v50 * 0.5, (float)(v51 * 0.5) + 60.0);
(*(void (__fastcall **)(const cocos2d::CCPoint *, double *))(*(_QWORD *)v13 + 184LL))(v13, v52);
sub_10028CBE0((float *)v52, -100.0, 20.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *))v39->setPosition)(v39, v52);
sub_10028CBE0((float *)v52, 0.0, 20.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *))v46->setPosition)(v46, v52);
sub_10028CBE0((float *)v52, 100.0, 20.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *))v12->setPosition)(v12, v52);
sub_10028CBE0((float *)v52, -50.0, -20.0);
(*(void (__fastcall **)(void *, double *))(*(_QWORD *)v48 + 184LL))(v48, v52);
sub_10028CBE0((float *)v52, 50.0, -20.0);
((void (__fastcall *)(SupportLayer *, double *))v47->setPosition)(v47, v52);
v43 = 30;
strcpy(v44, "Low Detail Mode");
LOBYTE(v10) = GameManager::sharedState()->m_performanceMode;
sub_10028CBE0((float *)v52, (float)(v50 * 0.5) + -160.0, (float)(v51 * 0.5) + -90.0);
SupportLayer::createToggleButton(
(_DWORD)a1,
(unsigned int)&v43,
(unsigned int)SupportLayer::onLowDetail,
0,
(unsigned __int8)v10 ^ 1,
(_DWORD)v13,
(__int64)v52,
0);
if ( (v43 & 1) != 0 )
operator delete(*(void **)&v44[15]);
v14 = GJAccountManager::sharedState();
if ( v14->m_accountID > v14->m_unkInt1 )
{
v15 = ButtonSprite::create_1("Req", 220, 0, 0.40000001, 0, "bigFont.fnt", "GJ_button_04.png", 25.0);
v16 = CCMenuItemSpriteExtra::create(
v15,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onRequestAccess);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v13 + 440LL))(v13, v16);
sub_10028CBE0((float *)&v45, (float)(v50 * 0.5) + 150.0, (float)(v51 * 0.5) + -90.0);
*(cocos2d::CCPoint *)&v53 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, v13);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v16->setPosition)(v16, v52, v53);
HIDWORD(v17) = 0;
*(float *)&v17 = (float)rand() * 4.6566129e-10;
if ( *(float *)&v17 > 0.89999998 )
{
v18 = GameStatsManager::sharedState();
v40 = 8;
strcpy(v41, "0023");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v18, (__int64)&v40, v17);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( !isSpecialChestUnlocked )
{
v20 = ButtonSprite::create_1("?", 220, 0, 0.60000002, 0, "goldFont.fnt", "GJ_button_05.png", 25.0);
v21 = CCMenuItemSpriteExtra::create(
v20,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onGetReward);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemSpriteExtra *))(*(_QWORD *)v13 + 440LL))(v13, v21);
v22 = (unsigned __int64 *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v16->getPosition)(v16);
sub_10028CBE0((float *)&v45, -50.0, 0.0);
sub_10028CCE0(v52, v22, &v45);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *))v21->setPosition)(v21, v52);
}
}
}
((void (__fastcall *)(cocos2d::CCLayer *, const cocos2d::CCPoint *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v13,
1);
v49 = 0.5;
*(float *)&v46 = (float)(v50 * 0.5) + -55.0;
*(float *)&v48 = (float)(v50 * 0.5) + 45.0;
v23 = cocos2d::CCMenu::create();
v24 = cocos2d::CCSprite::createWithSpriteFrameName("developedBy_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v24);
sub_10028CBE0((float *)v52, *(float *)&v46, (float)(v51 * 0.5) + 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, double *))v24->setPosition)(v24, v52);
v25 = cocos2d::CCSprite::createWithSpriteFrameName("robtoplogo_small.png");
v26 = CCMenuItemSpriteExtra::create(
v25,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onRobTop);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v23->addChild)(v23, v26);
v27 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v24->getPosition)(v24);
sub_10028CBE0((float *)&v45, *(float *)&v48, *(float *)(v27 + 4));
v47 = a1;
*(cocos2d::CCPoint *)&v54 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, (const cocos2d::CCPoint *)v23);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v26->setPosition)(v26, v52, v54);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("poweredBy_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v47->m_mainLayer->addChild)(v47->m_mainLayer, v28);
v29 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v24->getPosition)(v24);
sub_10028CBE0((float *)v52, *(float *)&v46, *(float *)(v29 + 4) + -35.0);
((void (__fastcall *)(cocos2d::CCSprite *, double *))v28->setPosition)(v28, v52);
v30 = cocos2d::CCSprite::createWithSpriteFrameName("cocos2DxLogo.png");
v31 = CCMenuItemSpriteExtra::create(
v30,
nullptr,
v47,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SupportLayer::onCocos2d);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v23->addChild)(v23, v31);
v32 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v28->getPosition)(v28);
sub_10028CBE0((float *)&v45, *(float *)&v48, *(float *)(v32 + 4));
v48 = v23;
*(cocos2d::CCPoint *)&v55 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, (const cocos2d::CCPoint *)v23);
v33 = v47;
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v31->setPosition)(v31, v52, v55);
v34 = cocos2d::CCLabelBMFont::create_3("FMOD Studio by Firelight Technologies Pty Ltd.", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v34->setScale)(v34, 0.34999999);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v33->m_mainLayer->addChild)(v33->m_mainLayer, v34);
v49 = v49 * v50;
v35 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v28->getPosition)(v28);
sub_10028CBE0((float *)v52, v49, *(float *)(v35 + 4) + -26.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v34->setPosition)(v34, v52);
v36 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v36, "geometry.ach.secret08") )
{
v37 = cocos2d::CCLabelBMFont::create_3("\"blockbite\"", "chatFont.fnt");
((void (__fastcall *)(SupportLayer *, cocos2d::CCLabelBMFont *, __int64))v33->addChild_0)(v33, v37, 3);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v37->setScale)(v37, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v37->setColor)(v37, &unk_10081A573);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v37->setOpacity)(v37, 0);
sub_10028CBE0((float *)v52, v50 + -32.0, 8.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v37->setPosition)(v37, v52);
v38 = cocos2d::CCFadeTo::create(10.0, 0x64u);
cocos2d::CCNode::runAction(v37, v38);
}
((void (__fastcall *)(cocos2d::CCLayer *, void *, __int64))v33->m_mainLayer->addChild_0)(v33->m_mainLayer, v48, 2);
}