//
// EditorOptionsLayer::setupOptions from 0x8db330 to 0x8dbc88 (2392 bytes)
//
// 2 xrefs:
// > ??> @ 0x32c40
// > ??> @ 0x1196990
//
// 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 EditorOptionsLayer::setupOptions(EditorOptionsLayer *a1)
{
cocos2d::CCArray *v2; // x23
GameManager *v3; // x0
GameManager *v4; // x0
cocos2d::CCDirector *v5; // x0
cocos2d::CCLabelBMFont *v6; // x24
cocos2d::CCString *v7; // x0
cocos2d::CCLabelBMFont *v8; // x0
cocos2d::CCSprite *v9; // x24
CCMenuItemSpriteExtra *v10; // x24
cocos2d::CCSprite *v11; // x24
CCMenuItemSpriteExtra *v12; // x24
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCLabelBMFont *v14; // x24
void (__fastcall *v15)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCString *v16; // x0
cocos2d::CCLabelBMFont *v17; // x0
cocos2d::CCSprite *v18; // x24
CCMenuItemSpriteExtra *v19; // x24
void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28
cocos2d::CCSprite *v21; // x24
CCMenuItemSpriteExtra *v22; // x24
cocos2d::CCMenu *v23; // x26
void (__fastcall *v24)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x19
cocos2d::CCMenu *m_buttonMenu; // [xsp+A0h] [xbp+A0h]
cocos2d::CCNode *setPosition; // [xsp+A8h] [xbp+A8h]
cocos2d::CCNode *v27; // [xsp+A8h] [xbp+A8h]
cocos2d::CCMenu *v28; // [xsp+A8h] [xbp+A8h]
cocos2d::CCMenu *v29; // [xsp+A8h] [xbp+A8h]
float v30; // [xsp+B8h] [xbp+B8h]
float v31; // [xsp+BCh] [xbp+BCh]
cocos2d::CCPoint v32; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCPoint v33; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v34; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCPoint v35; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v36; // [xsp+E0h] [xbp+E0h] BYREF
cocos2d::CCPoint v37; // 0:kr08_8.8
cocos2d::CCPoint v38; // 0:kr10_8.8
cocos2d::CCPoint v39; // 0:kr18_8.8
cocos2d::CCPoint v40; // 0:kr20_8.8
cocos2d::SEL_MenuHandler v41; // 0:x2.16
cocos2d::SEL_MenuHandler v42; // 0:x2.16
cocos2d::SEL_MenuHandler v43; // 0:x2.16
cocos2d::SEL_MenuHandler v44; // 0:x2.16
a1->m_togglesPerPage = 12;
a1->m_offset = 15.0;
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.");
GJOptionsLayer::offsetToNextPage(a1);
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);
cocos2d::CCPoint::CCPoint(&v32, (float)(v30 * 0.5) + -100.0, (float)(v31 * 0.5) + -115.0);
v6 = cocos2d::CCLabelBMFont::create();
v6->setScale(v6, 0.5);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v6, 2);
setPosition = (cocos2d::CCNode *)v6->setPosition;
cocos2d::CCPoint::CCPoint(&v35, 0.0, 30.0);
cocos2d::CCPoint::operator+(&v36, &v32, &v35);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64 *))setPosition)(v6, &v36);
cocos2d::CCArray::addObject(v2, v6);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_buttonsPerRow);
cocos2d::CCString::getCString(v7);
v8 = cocos2d::CCLabelBMFont::create();
a1->m_buttonsPerRowLabel = v8;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, 2);
a1->m_buttonsPerRowLabel->setPosition(a1->m_buttonsPerRowLabel, &v32);
cocos2d::CCArray::addObject(v2, a1->m_buttonsPerRowLabel);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
cocos2d::CCSprite::setFlipX(v9, 1);
v9->setScale(v9, 0.8);
v41.adj = (size_t)EditorOptionsLayer::onButtonsPerRow;
v41.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v10 = CCMenuItemSpriteExtra::create(v9, nullptr, v41);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v10);
v27 = (cocos2d::CCNode *)v10->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v34, 40.0, 0.0);
cocos2d::CCPoint::operator+(&v35, &v32, &v34);
v37 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v35);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v27)(v10, &v36, v37.x, v37.y);
CCMenuItemSpriteExtra::setSizeMult(v10, 2.0);
v10->setTag(v10, 1);
cocos2d::CCArray::addObject(v2, v10);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v11->setScale(v11, 0.8);
v42.adj = (size_t)EditorOptionsLayer::onButtonsPerRow;
v42.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, v42);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v12);
v28 = a1->m_buttonMenu;
v13 = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v34, -40.0, 0.0);
cocos2d::CCPoint::operator+(&v35, &v32, &v34);
v38 = cocos2d::CCNode::convertToNodeSpace(v28, &v35);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v13)(v12, &v36, v38.x, v38.y);
CCMenuItemSpriteExtra::setSizeMult(v12, 2.0);
v12->setTag(v12, 0);
cocos2d::CCArray::addObject(v2, v12);
cocos2d::CCPoint::CCPoint(&v33, (float)(v30 * 0.5) + 100.0, v32.y);
v14 = cocos2d::CCLabelBMFont::create();
v14->setScale(v14, 0.5);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, 2);
v15 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v35, 0.0, 30.0);
cocos2d::CCPoint::operator+(&v36, &v33, &v35);
v15(v14, (const cocos2d::CCPoint *)&v36);
cocos2d::CCArray::addObject(v2, v14);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a1->m_buttonRows);
cocos2d::CCString::getCString(v16);
v17 = cocos2d::CCLabelBMFont::create();
a1->m_buttonRowsLabel = v17;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v17, 2);
a1->m_buttonRowsLabel->setPosition(a1->m_buttonRowsLabel, &v33);
cocos2d::CCArray::addObject(v2, a1->m_buttonRowsLabel);
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png");
cocos2d::CCSprite::setFlipX(v18, 1);
v18->setScale(v18, 0.8);
v43.adj = (size_t)EditorOptionsLayer::onButtonRows;
v43.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v19 = CCMenuItemSpriteExtra::create(v18, nullptr, v43);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v19);
v29 = a1->m_buttonMenu;
v20 = v19->setPosition;
cocos2d::CCPoint::CCPoint(&v34, 40.0, 0.0);
cocos2d::CCPoint::operator+(&v35, &v33, &v34);
v39 = cocos2d::CCNode::convertToNodeSpace(v29, &v35);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v20)(v19, &v36, v39.x, v39.y);
CCMenuItemSpriteExtra::setSizeMult(v19, 2.0);
v19->setTag(v19, 1);
cocos2d::CCArray::addObject(v2, v19);
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png");
v21->setScale(v21, 0.8);
v44.adj = (size_t)EditorOptionsLayer::onButtonRows;
v44.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v22 = CCMenuItemSpriteExtra::create(v21, nullptr, v44);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22);
v23 = a1->m_buttonMenu;
v24 = v22->setPosition;
cocos2d::CCPoint::CCPoint(&v34, -40.0, 0.0);
cocos2d::CCPoint::operator+(&v35, &v33, &v34);
v40 = cocos2d::CCNode::convertToNodeSpace(v23, &v35);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64 *, float, float))v24)(v22, &v36, v40.x, v40.y);
CCMenuItemSpriteExtra::setSizeMult(v22, 2.0);
v22->setTag(v22, 0);
cocos2d::CCArray::addObject(v2, v22);
}