//
// KeybindingsLayer::init from 0x46aa24 to 0x46b148 (1828 bytes)
//
// 1 xrefs:
// > KeybindingsLayer::create @ 0x46a374
//
// 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
//
bool KeybindingsLayer::init(KeybindingsLayer *a1)
{
int v2; // r10
cocos2d::CCDirector *v3; // r0
cocos2d::CCNode *v4; // r6
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCLabelBMFont *v7; // r6
void (__fastcall *v8)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCLabelBMFont *v9; // r9
void (__fastcall *v10)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v11; // r6
cocos2d::CCDictionary *v12; // r0
cocos2d::CCDictionary *v13; // r0
cocos2d::CCMenu *v14; // r0
cocos2d::CCLabelBMFont *v15; // r0
cocos2d::CCLabelBMFont *v16; // r0
cocos2d::CCSprite *v17; // r0
CCMenuItemSpriteExtra *v18; // r9
void (__fastcall *v19)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
float v20; // s16
cocos2d::CCSprite *v21; // r0
CCMenuItemSpriteExtra *v22; // r0
void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v24; // r0
float v25; // r0
cocos2d::CCSprite *v26; // r9
CCMenuItemSpriteExtra *v27; // r0
CCMenuItemSpriteExtra *m_nextButton; // r9
void (__fastcall *v29)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v30; // r0
float v31; // r0
float v33; // r2
float v34; // r3
cocos2d::CCMenu *m_buttonMenu; // [sp+8h] [bp-4Ch]
cocos2d::CCMenu *v36; // [sp+8h] [bp-4Ch]
cocos2d::CCMenu *v37; // [sp+8h] [bp-4Ch]
CCMenuItemSpriteExtra *m_prevButton; // [sp+Ch] [bp-48h]
cocos2d::CCSize v39; // [sp+14h] [bp-40h] BYREF
void (*v40)(KeybindingsLayer *, cocos2d::CCObject *); // [sp+1Ch] [bp-38h]
int v41; // [sp+20h] [bp-34h]
void (*v42)(KeybindingsLayer *, cocos2d::CCObject *); // [sp+24h] [bp-30h]
int v43; // [sp+28h] [bp-2Ch]
void (*v44)(KeybindingsLayer *, cocos2d::CCObject *); // [sp+2Ch] [bp-28h]
int v45; // [sp+30h] [bp-24h]
cocos2d::CCPoint v46; // [sp+34h] [bp-20h] BYREF
cocos2d::CCRect v47; // [sp+3Ch] [bp-18h] BYREF
cocos2d::CCSize v48; // 0:^0.8
cocos2d::CCRect v49; // 0:kr00_16.16
v2 = FLAlertLayer::init(a1, (cocos2d::_ccColor4B)75);
if ( v2 )
{
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v39, v3);
cocos2d::CCRect::CCRect(&v47, 0.0, 0.0, 80.0, 80.0);
v49.origin.x = v33;
v49.origin.y = v34;
v49.size = v48;
v4 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v47,
v49);
setContentSize = v4->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v47, 420.0, 280.0);
setContentSize(v4, (const cocos2d::CCSize *)&v47);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v4, -1);
setPosition = v4->setPosition;
cocos2d::CCPoint::CCPoint(&v47.origin, v39.width * 0.5, v39.height * 0.5);
setPosition(v4, &v47.origin);
v7 = cocos2d::CCLabelBMFont::create();
v8 = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v47.origin, v39.width * 0.5, (float)((float)(v39.height * 0.5) + 140.0) - 16.0);
v8(v7, &v47.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v7->setScale)(v7, 1061997773);
v9 = cocos2d::CCLabelBMFont::create();
v10 = v9->setPosition;
v11 = (int)v7->getPosition(v7);
cocos2d::CCPoint::CCPoint(&v47.origin, 0.0, -20.0);
cocos2d::CCPoint::operator+(&v46, v11, &v47);
v10(v9, &v46);
a1->m_mainLayer->addChild(a1->m_mainLayer, v9);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v9->setScale)(v9, 1058642330);
v12 = cocos2d::CCDictionary::create();
a1->m_variables = v12;
cocos2d::CCObject::retain(v12);
v13 = cocos2d::CCDictionary::create();
a1->m_values = v13;
cocos2d::CCObject::retain(v13);
v14 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v14;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, 10);
v15 = KeybindingsLayer::addKeyPair(a1, "Gameplay Keys", " ");
v15->setColor(v15, (const cocos2d::ccColor3B *)&off_9ABF30);
KeybindingsLayer::addKeyPair(a1, "Jump", "Space / Up");
KeybindingsLayer::addKeyPair(a1, "Pause", "Escape");
KeybindingsLayer::addKeyPair(a1, "Place Checkpoint", "Z");
KeybindingsLayer::addKeyPair(a1, "Delete Checkpoint", "X");
a1->m_keyCount = 7;
v16 = KeybindingsLayer::addKeyPair(a1, "Editor Keys", " ");
v16->setColor(v16, (const cocos2d::ccColor3B *)&off_9ABF30);
KeybindingsLayer::addKeyPair(a1, "Build Mode", (const char *)&aO1i2r3e45s7t89[1]);
KeybindingsLayer::addKeyPair(a1, "Edit Mode", (const char *)&aO1i2r3e45s7t89[3]);
KeybindingsLayer::addKeyPair(a1, "Delete Mode", (const char *)&aO1i2r3e45s7t89[5]);
KeybindingsLayer::addKeyPair(a1, "Swipe Modifier", "Shift");
KeybindingsLayer::addKeyPair(a1, "Move Modifier", "Space");
KeybindingsLayer::addKeyPair(a1, "Rotate CCW", "Q");
KeybindingsLayer::addKeyPair(a1, "Rotate CW", "E");
KeybindingsLayer::addKeyPair(a1, "Flip X", "Alt + Q");
KeybindingsLayer::addKeyPair(a1, "Flip Y", "Alt + E");
KeybindingsLayer::addKeyPair(a1, "Delete selected", "Delete");
KeybindingsLayer::addKeyPair(a1, "Undo", "Ctrl + Z");
KeybindingsLayer::addKeyPair(a1, "Redo", "Ctrl + Shift + Z");
KeybindingsLayer::addKeyPair(a1, "Deselect", "Alt + D");
KeybindingsLayer::addKeyPair(a1, "Copy", "Ctrl + C");
KeybindingsLayer::addKeyPair(a1, "Paste", "Ctrl + V");
KeybindingsLayer::addKeyPair(a1, "Duplicate", "Ctrl + D");
KeybindingsLayer::addKeyPair(a1, "Rotate", "R");
KeybindingsLayer::addKeyPair(a1, "Free Move", "F");
KeybindingsLayer::addKeyPair(a1, "Swipe", "T");
KeybindingsLayer::addKeyPair(a1, "Snap", "G");
KeybindingsLayer::addKeyPair(a1, "Playtest", "Enter");
KeybindingsLayer::addKeyPair(a1, "Playback music", "Ctrl + Enter");
KeybindingsLayer::addKeyPair(a1, "Next Group", "Arrow Right");
KeybindingsLayer::addKeyPair(a1, "Previous Group", "Arrow Left");
KeybindingsLayer::addKeyPair(a1, "Object Left", "A");
KeybindingsLayer::addKeyPair(a1, "Object Right", "D");
KeybindingsLayer::addKeyPair(a1, "Object Up", "W");
KeybindingsLayer::addKeyPair(a1, "Object Down", "S");
KeybindingsLayer::addKeyPair(a1, "Object Left small", "Shift + A");
KeybindingsLayer::addKeyPair(a1, "Object Right small", "Shift + D");
KeybindingsLayer::addKeyPair(a1, "Object Up small", "Shift + W");
KeybindingsLayer::addKeyPair(a1, "Object Down small", "Shift + S");
KeybindingsLayer::addKeyPair(a1, "Object Down small", "Shift + S");
KeybindingsLayer::addKeyPair(a1, "Lock Preview", "F1");
KeybindingsLayer::addKeyPair(a1, "Unlock Preview", "F2");
KeybindingsLayer::addKeyPair(a1, "Preview Mode On/Off", "F3");
KeybindingsLayer::addKeyPair(a1, "Particle Icons On/Off", "F4");
KeybindingsLayer::addKeyPair(a1, "Debug Draw On/Off", "F5");
KeybindingsLayer::addKeyPair(a1, "Hide Invisible On/Off", "F6");
KeybindingsLayer::addKeyPair(a1, "Save Editor Pos", "Ctrl + 0-9");
KeybindingsLayer::addKeyPair(a1, "Load Editor Pos", "Alt + 0-9");
KeybindingsLayer::addKeyPair(a1, "Zoom", "Ctrl + ScrollWheel");
KeybindingsLayer::addKeyPair(a1, "Transform", "Ctrl + T");
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v40 = KeybindingsLayer::onClose;
v41 = 0;
v18 = CCMenuItemSpriteExtra::create(
v17,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(KeybindingsLayer::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v18, 1.5);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v18);
v19 = v18->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v47.origin,
(float)((float)(v39.width * 0.5) - 210.0) + 5.0,
(float)((float)(v39.height * 0.5) + 140.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(&v46, m_buttonMenu, &v47.origin);
v19(v18, &v46);
v20 = v39.height * 0.5;
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v43 = 0;
v42 = KeybindingsLayer::onPrevPage;
v22 = CCMenuItemSpriteExtra::create(
v21,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(KeybindingsLayer::onPrevPage, (unsigned int)a1));
a1->m_prevButton = v22;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22);
m_prevButton = a1->m_prevButton;
v23 = m_prevButton->setPosition;
v36 = a1->m_buttonMenu;
v24 = cocos2d::CCDirector::sharedDirector();
v25 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v24));
cocos2d::CCPoint::CCPoint(&v47.origin, v25 + 24.0, v20);
cocos2d::CCNode::convertToNodeSpace(&v46, v36, &v47.origin);
v23(m_prevButton, &v46);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v26, 1);
v44 = KeybindingsLayer::onNextPage;
v45 = 0;
v27 = CCMenuItemSpriteExtra::create(
v26,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(KeybindingsLayer::onNextPage, (unsigned int)a1));
a1->m_nextButton = v27;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v27);
m_nextButton = a1->m_nextButton;
v29 = m_nextButton->setPosition;
v37 = a1->m_buttonMenu;
v30 = cocos2d::CCDirector::sharedDirector();
v31 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v30));
cocos2d::CCPoint::CCPoint(&v47.origin, v31 - 24.0, v20);
cocos2d::CCNode::convertToNodeSpace(&v46, v37, &v47.origin);
v29(m_nextButton, &v46);
KeybindingsLayer::goToPage(a1, 0);
}
return v2;
}