//
// GameOptionsLayer::setupOptions from 0xa35d00 to 0xa363d0 (1744 bytes)
//
// 2 xrefs:
// > ??> @ 0xd9d38
// > ??> @ 0x1483480
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:59:50 +0000
//
__int64 __fastcall GameOptionsLayer::setupOptions(GameOptionsLayer *this)
{
cocos2d::CCDirector *v2; // x0
GameManager *v3; // x0
unsigned __int8 GameVariable; // w0
CCMenuItemToggler *v5; // x0
GameManager *v6; // x0
unsigned __int8 v7; // w0
CCMenuItemToggler *v8; // x0
__int64 v9; // x0
CCMenuItemToggler *v10; // x0
GameManager *v11; // x0
unsigned __int8 v12; // w0
CCMenuItemToggler *v13; // x0
GameManager *v14; // x0
unsigned __int8 v15; // w0
CCMenuItemToggler *v16; // x0
GameManager *v17; // x0
unsigned __int8 v18; // w0
CCMenuItemToggler *v19; // x0
GameManager *v20; // x0
unsigned __int8 v21; // w0
CCMenuItemToggler *v22; // x0
GameManager *v23; // x0
unsigned __int8 v24; // w0
CCMenuItemToggler *v25; // x0
GameManager *v26; // x0
unsigned __int8 v27; // w0
CCMenuItemToggler *v28; // x0
GameManager *v29; // x0
unsigned __int8 v30; // w0
CCMenuItemToggler *v31; // x0
cocos2d::CCArray *v32; // x25
GameStatsManager *v33; // x0
__int64 v34; // x0
unsigned __int8 isItemEnabled; // w28
cocos2d::CCNode *v36; // x27
float v37; // s10
float v38; // s9
__int64 v39; // x26
CCMenuItemToggler *v40; // x22
GameStatsManager *v41; // x0
__int64 v42; // x0
unsigned __int64 isItemUnlocked; // x0
GameManager *v44; // x0
GameManager *v45; // x0
cocos2d::CCNode *v46; // x24
const char *v47; // x1
__int64 v48; // x2
__int64 v49; // x3
bool v50; // w4
__int64 v51; // x5
const char *v52; // x6
__int64 v53; // x24
__int64 v54; // x24
void (__fastcall *v55)(__int64, __int64 *); // x25
const char *v56; // x1
__int64 v57; // x2
__int64 v58; // x3
bool v59; // w4
__int64 v60; // x5
const char *v61; // x6
__int64 v62; // x24
__int64 v63; // x24
void (__fastcall *v64)(__int64, __int64 *); // x19
cocos2d::CCObject *v66; // x25
GameManager *v67; // x0
GameManager *v68; // x0
unsigned __int8 v69; // w28
cocos2d::CCNode *v70; // x27
float v71; // s9
CCMenuItemToggler *v72; // x24
cocos2d::CCObject *v73; // x0
__int64 v74; // x25
__int64 v75; // [xsp+B8h] [xbp+88h] BYREF
float v76; // [xsp+C0h] [xbp+90h] BYREF
__int64 v77; // [xsp+C8h] [xbp+98h] BYREF
float v78; // [xsp+D0h] [xbp+A0h] BYREF
__int64 v79; // [xsp+D8h] [xbp+A8h] BYREF
GameStatsManager *v80; // [xsp+E0h] [xbp+B0h] BYREF
__int64 v81; // [xsp+E8h] [xbp+B8h]
void *v82; // [xsp+F0h] [xbp+C0h]
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v75, v2);
*((_DWORD *)this + 255) = 12;
*((_DWORD *)this + 268) = 1107296256;
*((_DWORD *)this + 253) = 1108606976;
v3 = (GameManager *)GameManager::sharedState((GameManager *)0x42140000);
GameVariable = GameManager::getGameVariable(v3, "0026");
v5 = GJOptionsLayer::addToggle(this, "Auto-Retry", 1, GameVariable, &byte_11B8890);
v6 = (GameManager *)GameManager::sharedState(v5);
v7 = GameManager::getGameVariable(v6, "0027");
v8 = GJOptionsLayer::addToggle(this, "Auto-Checkpoints", 2, v7, &byte_11B8890);
v9 = GameManager::sharedState(v8);
v10 = GJOptionsLayer::addToggle(this, "Show Progress Bar", 3, *(_BYTE *)(v9 + 924), &byte_11B8890);
v11 = (GameManager *)GameManager::sharedState(v10);
v12 = GameManager::getGameVariable(v11, "0040");
v13 = GJOptionsLayer::addToggle(this, "Show Percentage", 4, v12, &byte_11B8890);
v14 = (GameManager *)GameManager::sharedState(v13);
v15 = GameManager::getGameVariable(v14, "0145");
v16 = GJOptionsLayer::addToggle(this, "Show Time", 7, v15, &byte_11B8890);
v17 = (GameManager *)GameManager::sharedState(v16);
v18 = GameManager::getGameVariable(v17, "0144");
v19 = GJOptionsLayer::addToggle(this, "Audio Visualizer", 5, v18, &byte_11B8890);
v20 = (GameManager *)GameManager::sharedState(v19);
v21 = GameManager::getGameVariable(v20, "0109");
v22 = GJOptionsLayer::addToggle(this, "Show Info Label", 6, v21, &byte_11B8890);
v23 = (GameManager *)GameManager::sharedState(v22);
v24 = GameManager::getGameVariable(v23, "0146");
v25 = GJOptionsLayer::addToggle(this, "Disable Checkpoints", 8, v24, &byte_11B8890);
v26 = (GameManager *)GameManager::sharedState(v25);
v27 = GameManager::getGameVariable(v26, "0166");
v28 = GJOptionsLayer::addToggle(this, "Show Hitboxes", 9, v27, "Shows hitboxes while in practice mode.");
v29 = (GameManager *)GameManager::sharedState(v28);
v30 = GameManager::getGameVariable(v29, "0179");
v31 = GJOptionsLayer::addToggle(
this,
"Hitbox On Death",
11,
v30,
"Shows hitboxes upon death in both normal and practice mode.");
v32 = (cocos2d::CCArray *)cocos2d::CCArray::create(v31);
GJOptionsLayer::nextPosition(this, nullptr, &v76);
v80 = nullptr;
v81 = 0;
v82 = nullptr;
v33 = (GameStatsManager *)std::string::__init((__int64 *)&v80, "Practice Music Sync", 0x13u);
v34 = GameStatsManager::sharedState(v33);
isItemEnabled = GameStatsManager::isItemEnabled(v34, 0xCu, 0x11u);
v36 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, (const cocos2d::CCPoint *)&v76);
v37 = *((float *)this + 258);
v38 = *((float *)this + 259);
v39 = *((_QWORD *)this + 73);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v78, 8.0, 0.0);
v40 = GameToolbox::createToggleButton(
(__int64)&v80,
(const char *)GameOptionsLayer::onPracticeMusicSync,
0,
isItemEnabled,
v36,
(const cocos2d::CCPoint *)&v79,
(__int64)this,
v39,
0.8,
v37,
v38,
&v78,
"bigFont.fnt",
0,
0,
v32);
v41 = (GameStatsManager *)(unsigned __int8)v80;
if ( ((unsigned __int8)v80 & 1) != 0 )
operator delete(v82);
v42 = GameStatsManager::sharedState(v41);
isItemUnlocked = (unsigned __int8)GameStatsManager::isItemUnlocked(v42, 0xCu, 0x11u);
if ( !(_BYTE)isItemUnlocked )
{
v74 = cocos2d::CCArray::objectAtIndex(v32, 1u);
*((_BYTE *)v40 + 393) = 1;
LOWORD(v79) = -26986;
BYTE2(v79) = -106;
CCMenuItemToggler::setSpriteColor((__int64)v40, (__int64)&v79);
isItemUnlocked = (*(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v74 + 1072LL))(v74, &v79);
}
v44 = *(GameManager **)(GameManager::sharedState((GameManager *)isItemUnlocked) + 544);
if ( v44 )
{
v45 = *(GameManager **)(*(_QWORD *)(GameManager::sharedState(v44) + 544) + 1936LL);
if ( v45 )
{
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(GameManager::sharedState(v45) + 544) + 1936LL) + 1140LL) == 2 )
{
++*((_DWORD *)this + 256);
GJOptionsLayer::incrementCountForPage(this, nullptr);
v66 = GJOptionsLayer::layerForPage(this, nullptr);
GJOptionsLayer::nextPosition(this, nullptr, (float *)&v77);
v80 = nullptr;
v81 = 0;
v82 = nullptr;
v67 = (GameManager *)std::string::__init((__int64 *)&v80, "Ignore Damage", 0xDu);
v68 = (GameManager *)GameManager::sharedState(v67);
v69 = GameManager::getGameVariable(v68, "0173");
v70 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v79, (const cocos2d::CCPoint *)&v77);
v71 = *((float *)this + 259);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v78, 8.0, 0.0);
v72 = GameToolbox::createToggleButton(
(__int64)&v80,
(const char *)GJOptionsLayer::onToggle,
0,
v69,
v70,
(const cocos2d::CCPoint *)&v79,
(__int64)this,
(__int64)v66,
0.8,
0.5,
v71,
&v78,
"goldFont.fnt",
0,
0,
nullptr);
if ( ((unsigned __int8)v80 & 1) != 0 )
operator delete(v82);
(*(void (__fastcall **)(CCMenuItemToggler *, __int64))(*(_QWORD *)v72 + 72LL))(v72, 10);
CCMenuItemToggler::setSizeMult(v72, 1.0);
v73 = GJOptionsLayer::objectsForPage(this, nullptr);
cocos2d::CCArray::addObject(v73, v72);
(*(void (__fastcall **)(CCMenuItemToggler *, _QWORD))(*(_QWORD *)v72 + 344LL))(v72, 0);
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v66 + 344LL))(v66, 0);
}
}
}
v46 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v79,
*(float *)&v75 * 0.5,
26.0 - (float)((float)(*((float *)this + 184) * 0.5) - (float)(*((float *)&v75 + 1) * 0.5)));
cocos2d::CCNode::convertToNodeSpace(&v77, v46, (const cocos2d::CCPoint *)&v79);
v53 = ButtonSprite::create((ButtonSprite *)"Platformer UI", v47, v48, v49, v50, v51, v52);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v53 + 160LL))(v53, 0.7);
v54 = CCMenuItemSpriteExtra::create(v53, 0, (__int64)this, (__int64)GameOptionsLayer::onUIOptions, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v54);
v55 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v54 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v78, -80.0, 0.0);
cocos2d::CCPoint::operator+(&v79, &v77);
v55(v54, &v79);
v62 = ButtonSprite::create((ButtonSprite *)"Practice UI", v56, v57, v58, v59, v60, v61);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v62 + 160LL))(v62, 0.7);
v63 = CCMenuItemSpriteExtra::create(v62, 0, (__int64)this, (__int64)GameOptionsLayer::onUIPOptions, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v63);
v64 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v63 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v78, 80.0, 0.0);
cocos2d::CCPoint::operator+(&v79, &v77);
v64(v63, &v79);
return _stack_chk_guard;
}