//
// KeybindingsLayer::init from 0x100609e90 to 0x10060a731 (2209 bytes)
//
// 2 xrefs:
// > KeybindingsLayer::create @ 0x100609e54
// > ??> @ 0x10097feb0
//
// 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 __fastcall KeybindingsLayer::init(KeybindingsLayer *a1)
{
bool result; // al
cocos2d::extension::CCScale9Sprite *v2; // r14
cocos2d::CCLabelBMFont *v3; // r14
cocos2d::CCLabelBMFont *v4; // r15
unsigned __int64 *v5; // r14
cocos2d::CCDictionary *v6; // rax
cocos2d::CCDictionary *v7; // rax
cocos2d::CCMenu *v8; // rax
cocos2d::CCLabelBMFont *v9; // rax
cocos2d::CCLabelBMFont *v10; // rax
cocos2d::CCSprite *v11; // rax
CCMenuItemSpriteExtra *v12; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
cocos2d::CCSprite *v14; // rax
CCMenuItemSpriteExtra *v15; // rax
CCMenuItemSpriteExtra *m_prevButton; // r15
cocos2d::CCMenu *v17; // r12
cocos2d::CCDirector *v18; // rax
cocos2d::CCSprite *v19; // r14
CCMenuItemSpriteExtra *v20; // rax
CCMenuItemSpriteExtra *m_nextButton; // r14
cocos2d::CCMenu *v22; // r15
cocos2d::CCDirector *v23; // rax
double v24[2]; // [rsp+0h] [rbp-50h] BYREF
unsigned __int64 v25; // [rsp+10h] [rbp-40h] BYREF
float v26; // [rsp+18h] [rbp-38h] BYREF
float v27; // [rsp+1Ch] [rbp-34h]
float v28; // [rsp+20h] [rbp-30h]
bool v29; // [rsp+27h] [rbp-29h]
cocos2d::CCRect v30; // 0:xmm0_8.8,8:xmm1_8.8
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
v29 = result;
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v26);
v30.origin = 0;
v30.size = 0;
sub_10028CC00((__int64)v24, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v2 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", v30);
sub_10028CBF0((float *)v24, 420.0, 280.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, double *))v2->setContentSize)(v2, v24);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v2,
0xFFFFFFFFLL);
sub_10028CBE0((float *)v24, v26 * 0.5, v27 * 0.5);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, double *))v2->setPosition)(v2, v24);
v3 = cocos2d::CCLabelBMFont::create_3("Key Bindings", "bigFont.fnt");
sub_10028CBE0((float *)v24, v26 * 0.5, (float)((float)(v27 * 0.5) + 140.0) + -16.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v3->setPosition)(v3, v24);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v3);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v3->setScale)(v3, 0.80000001);
v4 = cocos2d::CCLabelBMFont::create_3("(Customizing key bindings is not yet supported)", "goldFont.fnt");
v5 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v3->getPosition)(v3);
sub_10028CBE0((float *)&v25, 0.0, -20.0);
sub_10028CCE0(v24, v5, &v25);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v4->setPosition)(v4, v24);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v4);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v4->setScale)(v4, 0.60000002);
v6 = cocos2d::CCDictionary::create();
a1->m_variables = v6;
cocos2d::CCObject::retain(v6);
v7 = cocos2d::CCDictionary::create();
a1->m_values = v7;
cocos2d::CCObject::retain(v7);
v8 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v8;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v8,
10);
v9 = KeybindingsLayer::addKeyPair(a1, "Gameplay Keys", " ");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v9->setColor)(v9, &unk_100822208);
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;
v10 = KeybindingsLayer::addKeyPair(a1, "Editor Keys", " ");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v10->setColor)(v10, &unk_100822208);
KeybindingsLayer::addKeyPair(a1, "Build Mode", "1");
KeybindingsLayer::addKeyPair(a1, "Edit Mode", "2");
KeybindingsLayer::addKeyPair(a1, "Delete Mode", "3");
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");
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v12 = CCMenuItemSpriteExtra::create(
v11,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)KeybindingsLayer::onClose);
CCMenuItemSpriteExtra::setSizeMult(v12, 1.5);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v12);
v28 = 0.5;
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0((float *)&v25, (float)((float)(v26 * 0.5) + -210.0) + 5.0, (float)((float)(v27 * 0.5) + 140.0) + -5.0);
v30.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v24, (const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v12->setPosition)(v12, v24, *(double *)&v30.origin);
v28 = v28 * v27;
v14 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v15 = CCMenuItemSpriteExtra::create(
v14,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)KeybindingsLayer::onPrevPage);
a1->m_prevButton = v15;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v15);
m_prevButton = a1->m_prevButton;
v17 = a1->m_buttonMenu;
v18 = cocos2d::CCDirector::sharedDirector();
v30.origin.x = sub_100484D90((__int64)v18);
sub_10028CBE0((float *)&v25, v30.origin.x + 24.0, v28);
v30.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v24, (const cocos2d::CCPoint *)v17);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))m_prevButton->setPosition)(
m_prevButton,
v24,
*(double *)&v30.origin);
v19 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v19, 1);
v20 = CCMenuItemSpriteExtra::create(
v19,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)KeybindingsLayer::onNextPage);
a1->m_nextButton = v20;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v20);
m_nextButton = a1->m_nextButton;
v22 = a1->m_buttonMenu;
v23 = cocos2d::CCDirector::sharedDirector();
v30.origin.x = sub_100484DA0((__int64)v23);
sub_10028CBE0((float *)&v25, v30.origin.x + -24.0, v28);
v30.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v24, (const cocos2d::CCPoint *)v22);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))m_nextButton->setPosition)(
m_nextButton,
v24,
*(double *)&v30.origin);
KeybindingsLayer::goToPage(a1, 0);
return v29;
}
return result;
}