//
// LevelOptionsLayer::setupOptions from 0xb651e8 to 0xb65630 (1096 bytes)
//
// 2 xrefs:
// > ??> @ 0xe03f8
// > ??> @ 0x14c5500
//
// 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 13:02:14 +0000
//
__int64 __fastcall LevelOptionsLayer::setupOptions(LevelOptionsLayer *this)
{
cocos2d::CCDirector *v2; // x0
unsigned __int8 *v3; // x0
__int64 v4; // x0
__int64 v6; // x23
cocos2d::CCNode *v7; // x25
void (__fastcall *v8)(__int64, __int64 *); // x24
const char *v9; // x1
__int64 v10; // x23
__int64 v11; // x23
cocos2d::CCNode *v12; // x24
float v13; // s0
float v14; // s1
void (__fastcall *v15)(__int64, __int64 *); // x19
__int64 v16; // [xsp+90h] [xbp+60h] BYREF
_BYTE v17[8]; // [xsp+98h] [xbp+68h] BYREF
__int64 v18; // [xsp+A0h] [xbp+70h] BYREF
__int64 v19[2]; // [xsp+A8h] [xbp+78h] BYREF
void *v20; // [xsp+B8h] [xbp+88h]
__int64 v21; // [xsp+C0h] [xbp+90h] BYREF
__int64 v22; // [xsp+C8h] [xbp+98h]
void *v23; // [xsp+D0h] [xbp+A0h]
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v16, v2);
GJOptionsLayer::addToggle(this, "Mini Mode", 0, *(_BYTE *)(*((_QWORD *)this + 140) + 336LL), &byte_11B8890);
GJOptionsLayer::addToggle(this, "Dual Mode", 1, *(_BYTE *)(*((_QWORD *)this + 140) + 337LL), &byte_11B8890);
v3 = *((unsigned __int8 **)this + 140);
if ( !v3[368] )
{
GJOptionsLayer::addToggle(
this,
"2-Player Mode",
2,
v3[340],
"Players are controlled separately.\n"
"Player 1: Left side\n"
"Player 2: Right side\n"
"(You can change the controls in the options menu)");
v3 = *((unsigned __int8 **)this + 140);
}
GJOptionsLayer::addToggle(this, "Mirror Mode", 4, v3[338], &byte_11B8890);
GJOptionsLayer::addToggle(this, "Flip\nGravity", 5, *(_BYTE *)(*((_QWORD *)this + 140) + 369LL), &byte_11B8890);
GJOptionsLayer::addToggle(this, "Rotate\nGameplay", 6, *(_BYTE *)(*((_QWORD *)this + 140) + 339LL), &byte_11B8890);
GJOptionsLayer::addToggle(this, "Reverse\nGameplay", 7, *(_BYTE *)(*((_QWORD *)this + 140) + 370LL), &byte_11B8890);
v4 = *((_QWORD *)this + 140);
if ( !*(_BYTE *)(v4 + 368) )
{
GJOptionsLayer::addToggle(
this,
"No Time\nPenalty",
20,
*(_BYTE *)(v4 + 430),
"In platformer mode you automatically lose 1000 points per second. Toggle to disable this penalty.");
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, "Spawn Group:", 0xCu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v18,
(float)(*(float *)&v16 * 0.5) + 50.0,
(float)(*((float *)&v16 + 1) * 0.5) + -100.0);
SetupTriggerPopup::createValueControlAdvanced(
(cocos2d::CCArray **)this,
13,
(char *)&v21,
(__int64)&v18,
1,
3,
6,
1,
0.7,
0.0,
9999.0,
0,
0,
0,
2,
0);
if ( (v21 & 1) != 0 )
operator delete(v23);
v19[0] = 0;
v19[1] = 0;
v20 = nullptr;
std::string::__init(v19, "Spawn Group", 0xBu);
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(
&v21,
"Lets you set a target position for player spawn.\n"
"If the group contains multiple objects a random target will be selected.",
0x79u);
v6 = InfoAlertButton::create((char *)v19, (char *)&v21, 0.5);
if ( (v21 & 1) != 0 )
operator delete(v23);
if ( (v19[0] & 1) != 0 )
operator delete(v20);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v6);
v7 = *((cocos2d::CCNode **)this + 69);
v8 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v6 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v17,
(float)((float)(*(float *)&v16 * 0.5) + 50.0) - 55.0,
(float)((float)(*((float *)&v16 + 1) * 0.5) + -100.0) + 24.0);
cocos2d::CCNode::convertToNodeSpace(&v18, v7, (const cocos2d::CCPoint *)v17);
v8(v6, &v18);
v10 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsBtn_001.png", v9);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 0.6);
v11 = CCMenuItemSpriteExtra::create(v10, 0, (__int64)this, (__int64)LevelOptionsLayer::onSettings, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v11);
v12 = *((cocos2d::CCNode **)this + 69);
v13 = *((float *)this + 183) * 0.5;
v14 = *((float *)this + 184) * 0.5;
v15 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v17,
(float)(v13 + (float)(*(float *)&v16 * 0.5)) - 25.0,
(float)(v14 + (float)(*((float *)&v16 + 1) * 0.5)) - 25.0);
cocos2d::CCNode::convertToNodeSpace(&v18, v12, (const cocos2d::CCPoint *)v17);
v15(v11, &v18);
}
return _stack_chk_guard;
}