//
// EditorOptionsLayer::setupOptions from 0x1002d406c to 0x1002d4960 (2292 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007df1e0
//
// 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 EditorOptionsLayer::setupOptions(EditorOptionsLayer *a1)
{
cocos2d::CCArray *v2; // x20
GameManager *v3; // x0
GameManager *v4; // x0
cocos2d::CCDirector *v5; // x0
__n128 v6; // q0
__n128 v7; // q1
cocos2d::CCLabelBMFont *v8; // x22
__n128 v9; // q0
__n128 v10; // q1
double v11; // d0
cocos2d::CCString *v12; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v14; // x0
cocos2d::CCSprite *v15; // x25
CCMenuItemSpriteExtra *v16; // x25
__n128 v17; // q0
cocos2d::CCMenu *m_buttonMenu; // x26
__n128 v19; // q1
cocos2d::CCSprite *v20; // x23
CCMenuItemSpriteExtra *v21; // x23
__n128 v22; // q0
cocos2d::CCMenu *v23; // x24
__n128 v24; // q1
__n128 v25; // q0
__n128 v26; // q1
cocos2d::CCLabelBMFont *v27; // x23
__n128 v28; // q0
__n128 v29; // q1
double v30; // d0
cocos2d::CCString *v31; // x0
const char *v32; // x0
cocos2d::CCLabelBMFont *v33; // x0
cocos2d::CCSprite *v34; // x23
CCMenuItemSpriteExtra *v35; // x23
__n128 v36; // q0
cocos2d::CCMenu *v37; // x24
__n128 v38; // q1
cocos2d::CCSprite *v39; // x21
CCMenuItemSpriteExtra *v40; // x21
__n128 v41; // q0
cocos2d::CCMenu *v42; // x19
__n128 v43; // q1
float32x2_t v44; // [xsp+10h] [xbp-90h] BYREF
float32x2_t v45; // [xsp+18h] [xbp-88h] BYREF
float32x2_t v46; // [xsp+20h] [xbp-80h] BYREF
float32x2_t v47; // [xsp+28h] [xbp-78h] BYREF
float32x2_t v48; // [xsp+30h] [xbp-70h] BYREF
float v49; // [xsp+38h] [xbp-68h]
float v50; // [xsp+3Ch] [xbp-64h]
cocos2d::CCPoint v51; // 0:kr08_8.8
cocos2d::CCPoint v52; // 0:kr10_8.8
cocos2d::CCPoint v53; // 0:kr18_8.8
cocos2d::CCPoint v54; // 0:kr20_8.8
cocos2d::SEL_MenuHandler v55; // 0:x3.16
cocos2d::SEL_MenuHandler v56; // 0:x3.16
cocos2d::SEL_MenuHandler v57; // 0:x3.16
cocos2d::SEL_MenuHandler v58; // 0:x3.16
a1->m_offset = 15.0;
a1->m_togglesPerPage = 12;
GJOptionsLayer::addGVToggle(a1, "Draw Trigger Boxes", "0044", "Draws the hitbox for touch triggered objects.");
GJOptionsLayer::addGVToggle(
a1,
"Playtest No UI",
"0046",
"Hides part of the editor's user interface during playtesting.");
GJOptionsLayer::addGVToggle(a1, "Playtest Music", "0002", "Plays music during playtesting.");
GJOptionsLayer::addGVToggle(
a1,
"Effect Lines",
"0043",
"Shows a vertical line for triggers to indicate where they are activated.");
GJOptionsLayer::addGVToggle(
a1,
"Duration Lines",
"0058",
"Shows a horizontal line for triggers to indicate how long they are active.");
GJOptionsLayer::addGVToggle(a1, "Grid On Top", "0039", "Shows the grid on top of objects in editor.");
GJOptionsLayer::addGVToggle(a1, "Playtest No Grid", "0079", "Hides grid during playtesting.");
GJOptionsLayer::addGVToggle(a1, "Hide Background", "0078", "Hides background in editor.");
GJOptionsLayer::addGVToggle(
a1,
"Enable Link Controls",
"0097",
"Enables option to link objects together in the editor. Linked objects are always selected and deleted together.");
GJOptionsLayer::addGVToggle(
a1,
"Hold To Swipe",
"0057",
"Enables swiping after holding down anywhere on the grid for a short duration. Useful when selecting objects without "
"the need to toggle swiping manually.");
a1->m_toggleCount = a1->m_togglesPerPage + a1->m_toggleCount / a1->m_togglesPerPage * a1->m_togglesPerPage;
GJOptionsLayer::addGVToggle(
a1,
"Swipe Cycle Mode",
"0059",
"Cycles through touched objects instead of adding to selection when tapping in the same position while swiping is ena"
"bled. Useful if you want to select multiple objects that are mixed with other objects.");
GJOptionsLayer::addGVToggle(
a1,
"Layer Locking",
"0103",
"Allows you to click on the editor layer number to lock and unlock a layer.");
GJOptionsLayer::addGVToggle(a1, "Show Clicks", "0149", "Shows a marker during playtesting when the player clicks.");
GJOptionsLayer::addGVToggle(
a1,
"Auto-Pause",
"0150",
"Pauses gameplay when starting from a start position to prepare gameplay. Click a second time to actually start playi"
"ng. This is used to handle start lag in larger levels.");
GJOptionsLayer::addGVToggle(a1, "Hide Path", "0152", "Hides the player path from playtesting.");
GJOptionsLayer::addGVToggle(
a1,
"Start Optimization",
"0151",
"Tries to speed up start position loading in editor. Experimental.");
GJOptionsLayer::addGVToggle(a1, "Hide Particle Icons", "0137", "Hides particle icons while preview mode is enabled.");
GJOptionsLayer::addGVToggle(
a1,
"Increase Undo/Redo",
"0013",
"Increases maximum undo and redo limit from 200 to 1000 in editor.");
GJOptionsLayer::addGVToggle(a1, "Playtest Smooth Fix", "0102", "Enables smooth fix when playtesting in the editor.");
GJOptionsLayer::addGVToggle(
a1,
"Increase Scale",
"0112",
"Increases maximum object scale to 4x and minimum scale to 0.25x. Note that objects larger than 6x grid size may disa"
"ppear near the screen edge. This may be fixed in the future.");
GJOptionsLayer::addGVToggle(
a1,
"Disable Paste State Groups",
"0156",
"Makes it so that pasting state no longer updates the group info of the target object(s). Group state can be pasted d"
"irectly on the edit group page instead.");
GJOptionsLayer::addGVToggle(
a1,
"Small Warp Buttons",
"0169",
"Warp control buttons are 50% smaller. (Restart editor)");
GJOptionsLayer::addGVToggle(
a1,
"Static Trace Arrows",
"0181",
"Disable the arrows showing directed connections when using Trace In/Out.");
v2 = GJOptionsLayer::objectsForPage(a1, 0);
v3 = GameManager::sharedState();
a1->m_buttonsPerRow = GameManager::getIntGameVariable(v3, "0049");
v4 = GameManager::sharedState();
a1->m_buttonRows = GameManager::getIntGameVariable(v4, "0050");
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6.n128_f32[0] = (float)(v49 * 0.5) + -100.0;
v7.n128_f32[0] = (float)(v50 * 0.5) + -115.0;
sub_100022980(v6, v7, &v48);
v8 = cocos2d::CCLabelBMFont::create_1("Buttons Per Row", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v8->setScale)(v8, 0.5);
v9 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v8,
2);
v9.n128_u32[0] = 0;
v10.n128_u32[0] = 30.0;
sub_100022980(v9, v10, &v46);
*(float32x2_t *)&v11 = sub_1000229DC(&v48, &v46, &v47);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v8->setPosition)(v8, &v47, v11);
sub_10024A2D0((__int64)v2);
v12 = (cocos2d::CCString *)sub_100268F4C("%i", a1->m_buttonsPerRow);
CString = cocos2d::CCString::getCString(v12);
v14 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
a1->m_buttonsPerRowLabel = v14;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v14,
2);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))a1->m_buttonsPerRowLabel->setPosition)(
a1->m_buttonsPerRowLabel,
&v48);
sub_10024A2D0((__int64)v2);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
cocos2d::CCSprite::setFlipX(v15, 1);
((void (__fastcall *)(cocos2d::CCSprite *, float))v15->setScale)(v15, 0.8);
v55.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorOptionsLayer::onButtonsPerRow;
v55.adj = 0;
v16 = CCMenuItemSpriteExtra::create(v15, nullptr, a1, v55);
v17 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v16);
m_buttonMenu = a1->m_buttonMenu;
v19.n128_u32[0] = 0;
v17.n128_u32[0] = 1109393408;
sub_100022980(v17, v19, &v45);
sub_1000229DC(&v48, &v45, &v46);
v51 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v46);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v16->setPosition)(v16, &v47, v51.x, v51.y);
CCMenuItemSpriteExtra::setSizeMult(v16, 2.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v16->setTag)(v16, 1);
sub_10024A2D0((__int64)v2);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v20->setScale)(v20, 0.8);
v56.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorOptionsLayer::onButtonsPerRow;
v56.adj = 0;
v21 = CCMenuItemSpriteExtra::create(v20, nullptr, a1, v56);
v22 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v21);
v23 = a1->m_buttonMenu;
v24.n128_u32[0] = 0;
v22.n128_u32[0] = -1038090240;
sub_100022980(v22, v24, &v45);
sub_1000229DC(&v48, &v45, &v46);
v52 = cocos2d::CCNode::convertToNodeSpace(v23, (const cocos2d::CCPoint *)&v46);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v21->setPosition)(v21, &v47, v52.x, v52.y);
CCMenuItemSpriteExtra::setSizeMult(v21, 2.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v21->setTag)(v21, 0);
sub_10024A2D0((__int64)v2);
v25.n128_f32[0] = (float)(v49 * 0.5) + 100.0;
v26.n128_u32[0] = v48.u32[1];
sub_100022980(v25, v26, &v47);
v27 = cocos2d::CCLabelBMFont::create_1("Button Rows", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v27->setScale)(v27, 0.5);
v28 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v27,
2);
v28.n128_u32[0] = 0;
v29.n128_u32[0] = 30.0;
sub_100022980(v28, v29, &v45);
*(float32x2_t *)&v30 = sub_1000229DC(&v47, &v45, &v46);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v27->setPosition)(v27, &v46, v30);
sub_10024A2D0((__int64)v2);
v31 = (cocos2d::CCString *)sub_100268F4C("%i", a1->m_buttonRows);
v32 = cocos2d::CCString::getCString(v31);
v33 = cocos2d::CCLabelBMFont::create_1(v32, "goldFont.fnt");
a1->m_buttonRowsLabel = v33;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v33,
2);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))a1->m_buttonRowsLabel->setPosition)(
a1->m_buttonRowsLabel,
&v47);
sub_10024A2D0((__int64)v2);
v34 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png");
cocos2d::CCSprite::setFlipX(v34, 1);
((void (__fastcall *)(cocos2d::CCSprite *, float))v34->setScale)(v34, 0.8);
v57.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorOptionsLayer::onButtonRows;
v57.adj = 0;
v35 = CCMenuItemSpriteExtra::create(v34, nullptr, a1, v57);
v36 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v35);
v37 = a1->m_buttonMenu;
v38.n128_u32[0] = 0;
v36.n128_u32[0] = 1109393408;
sub_100022980(v36, v38, &v44);
sub_1000229DC(&v47, &v44, &v45);
v53 = cocos2d::CCNode::convertToNodeSpace(v37, (const cocos2d::CCPoint *)&v45);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v35->setPosition)(v35, &v46, v53.x, v53.y);
CCMenuItemSpriteExtra::setSizeMult(v35, 2.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v35->setTag)(v35, 1);
sub_10024A2D0((__int64)v2);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v39->setScale)(v39, 0.8);
v58.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorOptionsLayer::onButtonRows;
v58.adj = 0;
v40 = CCMenuItemSpriteExtra::create(v39, nullptr, a1, v58);
v41 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v40);
v42 = a1->m_buttonMenu;
v43.n128_u32[0] = 0;
v41.n128_u32[0] = -1038090240;
sub_100022980(v41, v43, &v44);
sub_1000229DC(&v47, &v44, &v45);
v54 = cocos2d::CCNode::convertToNodeSpace(v42, (const cocos2d::CCPoint *)&v45);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v40->setPosition)(v40, &v46, v54.x, v54.y);
CCMenuItemSpriteExtra::setSizeMult(v40, 2.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v40->setTag)(v40, 0);
sub_10024A2D0((__int64)v2);
}