//
// LevelOptionsLayer::setupOptions from 0xa34aec to 0xa35004 (1304 bytes)
//
// 2 xrefs:
// > ??> @ 0xab138
// > ??> @ 0x11dcc50
//
// 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 LevelOptionsLayer::setupOptions(LevelOptionsLayer *a1)
{
cocos2d::CCDirector *v2; // x0
LevelSettingsObject *m_settingsObject; // x0
LevelSettingsObject *v4; // x0
float v5; // s3
float v6; // s4
void *v7; // x0
cocos2d::CCNode *v8; // x24
void *v9; // x0
void *v10; // x0
cocos2d::CCMenu *m_buttonMenu; // x25
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCSprite *v13; // x23
CCMenuItemSpriteExtra *v14; // x23
cocos2d::CCMenu *v15; // x24
float v16; // s0
float v17; // s1
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x19
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
__int64 v25; // [xsp+30h] [xbp+0h] BYREF
float v26; // [xsp+B0h] [xbp+80h]
float v27; // [xsp+B4h] [xbp+84h]
cocos2d::CCPoint v28; // [xsp+B8h] [xbp+88h] BYREF
__int64 v29; // [xsp+C0h] [xbp+90h] BYREF
cocos2d::CCPoint v30; // 0:kr08_8.8
cocos2d::CCPoint v31; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v32; // 0:x2.16
cocos2d::CCPoint v33; // 0:s0.4,4:s1.4
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
GJOptionsLayer::addToggle(a1, "Mini Mode", 0, a1->m_settingsObject->m_startMini, &byte_F288A0);
GJOptionsLayer::addToggle(a1, "Dual Mode", 1, a1->m_settingsObject->m_startDual, &byte_F288A0);
m_settingsObject = a1->m_settingsObject;
if ( !m_settingsObject->m_startsWithStartPos )
{
GJOptionsLayer::addToggle(
a1,
"2-Player Mode",
2,
m_settingsObject->m_twoPlayerMode,
"Players are controlled separately.\n"
"Player 1: Left side\n"
"Player 2: Right side\n"
"(You can change the controls in the options menu)");
m_settingsObject = a1->m_settingsObject;
}
GJOptionsLayer::addToggle(a1, "Mirror Mode", 4, m_settingsObject->m_mirrorMode, &byte_F288A0);
GJOptionsLayer::addToggle(a1, "Flip\nGravity", 5, a1->m_settingsObject->m_isFlipped, &byte_F288A0);
GJOptionsLayer::addToggle(a1, "Rotate\nGameplay", 6, a1->m_settingsObject->m_rotateGameplay, &byte_F288A0);
GJOptionsLayer::addToggle(a1, "Reverse\nGameplay", 7, a1->m_settingsObject->m_reverseGameplay, &byte_F288A0);
v4 = a1->m_settingsObject;
if ( !v4->m_startsWithStartPos )
{
GJOptionsLayer::addToggle(
a1,
"No Time\nPenalty",
20,
v4->m_noTimePenalty,
"In platformer mode you automatically lose 1000 points per second. Toggle to disable this penalty.");
sub_D153B8((unsigned int)&v25 + 144, "Spawn Group:");
cocos2d::CCPoint::CCPoint(&v28, (float)(v26 * 0.5) + 50.0, (float)(v27 * 0.5) + -100.0);
v33.y = 0.0;
v33.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xDu,
v33,
9999.0,
v5,
v6,
(std::string)&v29,
&v28,
Float,
Uint,
6,
1u,
0,
0,
0,
2,
0);
v7 = (void *)(v29 - 24);
if ( (__int64 *)(v29 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v29 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v29 - 8);
*(_DWORD *)(v29 - 8) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v28, "Spawn Group");
sub_D153B8(
(int)&v29,
"Lets you set a target position for player spawn.\n"
"If the group contains multiple objects a random target will be selected.");
v8 = (cocos2d::CCNode *)InfoAlertButton::create(0.5);
v9 = (void *)(v29 - 24);
if ( (__int64 *)(v29 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v29 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v29 - 8);
*(_DWORD *)(v29 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v9);
}
v10 = (void *)(*(_QWORD *)&v28 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v28 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(*(_QWORD *)&v28 - 8LL);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(*(_QWORD *)&v28 - 8LL);
*(_DWORD *)(*(_QWORD *)&v28 - 8LL) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v10);
}
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v8);
m_buttonMenu = a1->m_buttonMenu;
setPosition = v8->setPosition;
cocos2d::CCPoint::CCPoint(
&v28,
(float)((float)(v26 * 0.5) + 50.0) - 55.0,
(float)((float)(v27 * 0.5) + -100.0) + 24.0);
v30 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v28);
((void (__fastcall *)(cocos2d::CCNode *, __int64 *, float, float))setPosition)(v8, &v29, v30.x, v30.y);
v13 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_optionsBtn_001.png");
v13->setScale(v13, 0.6);
v32.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v32.adj = (size_t)LevelOptionsLayer::onSettings;
v14 = CCMenuItemSpriteExtra::create(v13, nullptr, v32);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v14);
v15 = a1->m_buttonMenu;
v16 = a1->m_width * 0.5;
v17 = a1->m_height * 0.5;
v18 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v28, (float)(v16 + (float)(v26 * 0.5)) - 25.0, (float)(v17 + (float)(v27 * 0.5)) - 25.0);
v31 = cocos2d::CCNode::convertToNodeSpace(v15, &v28);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v18)(v14, &v29, v31.x, v31.y);
}
}