//
// KeybindingsLayer::addKeyPair from 0x46a664 to 0x46a82e (458 bytes)
//
// 49 xrefs:
// > KeybindingsLayer::init @ 0x46abbe
// > KeybindingsLayer::init @ 0x46abd6
// > KeybindingsLayer::init @ 0x46abe4
// > KeybindingsLayer::init @ 0x46abf2
// > KeybindingsLayer::init @ 0x46ac00
// > KeybindingsLayer::init @ 0x46ac16
// > KeybindingsLayer::init @ 0x46ac34
// > KeybindingsLayer::init @ 0x46ac42
// > KeybindingsLayer::init @ 0x46ac50
// > KeybindingsLayer::init @ 0x46ac5e
// > KeybindingsLayer::init @ 0x46ac6c
// > KeybindingsLayer::init @ 0x46ac7a
// > KeybindingsLayer::init @ 0x46ac88
// > KeybindingsLayer::init @ 0x46ac96
// > KeybindingsLayer::init @ 0x46aca4
// > KeybindingsLayer::init @ 0x46acb2
// > KeybindingsLayer::init @ 0x46acc0
// > KeybindingsLayer::init @ 0x46acce
// > KeybindingsLayer::init @ 0x46acdc
// > KeybindingsLayer::init @ 0x46acea
// > KeybindingsLayer::init @ 0x46acf8
// > KeybindingsLayer::init @ 0x46ad06
// > KeybindingsLayer::init @ 0x46ad14
// > KeybindingsLayer::init @ 0x46ad22
// > KeybindingsLayer::init @ 0x46ad30
// > KeybindingsLayer::init @ 0x46ad3e
// > KeybindingsLayer::init @ 0x46ad4c
// > KeybindingsLayer::init @ 0x46ad5a
// > KeybindingsLayer::init @ 0x46ad68
// > KeybindingsLayer::init @ 0x46ad76
// > KeybindingsLayer::init @ 0x46aeb2
// > KeybindingsLayer::init @ 0x46aec0
// > KeybindingsLayer::init @ 0x46aece
// > KeybindingsLayer::init @ 0x46aedc
// > KeybindingsLayer::init @ 0x46aeea
// > KeybindingsLayer::init @ 0x46aef8
// > KeybindingsLayer::init @ 0x46af06
// > KeybindingsLayer::init @ 0x46af10
// > KeybindingsLayer::init @ 0x46af1a
// > KeybindingsLayer::init @ 0x46af2a
// > KeybindingsLayer::init @ 0x46af38
// > KeybindingsLayer::init @ 0x46af46
// > KeybindingsLayer::init @ 0x46af54
// > KeybindingsLayer::init @ 0x46af62
// > KeybindingsLayer::init @ 0x46af70
// > KeybindingsLayer::init @ 0x46af7e
// > KeybindingsLayer::init @ 0x46af8c
// > KeybindingsLayer::init @ 0x46af9a
// > KeybindingsLayer::init @ 0x46afa8
//
// 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
//
cocos2d::CCLabelBMFont *KeybindingsLayer::addKeyPair(KeybindingsLayer *a1, const char *a2, const char *a3)
{
int v3; // r5
int m_keyCount; // r0
float v6; // r0
int m_maxPage; // r3
int v8; // s15
cocos2d::CCLayer *v9; // r10
bool v10; // zf
char v11; // r2
cocos2d::CCNode *v12; // r7
cocos2d::CCLabelBMFont *v13; // r7
cocos2d::CCLabelBMFont *v14; // r8
void (__fastcall *v15)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCLabelBMFont *setAnchorPoint; // [sp+4h] [bp-10h]
cocos2d::CCLabelBMFont *v18; // [sp+4h] [bp-10h]
cocos2d::CCLabelBMFont *v19; // [sp+4h] [bp-10h]
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-8h]
cocos2d::CCPoint v21; // [sp+14h] [bp+0h] BYREF
cocos2d::CCPoint v22; // [sp+1Ch] [bp+8h] BYREF
cocos2d::CCPoint v23; // [sp+24h] [bp+10h] BYREF
m_keyCount = a1->m_keyCount;
a1->m_keyCount = m_keyCount + 1;
v6 = floorf((float)(m_keyCount / 7));
m_maxPage = a1->m_maxPage;
v8 = LODWORD(v6);
if ( v6 <= 0.0 )
v3 = 0;
else
v8 = (int)v6;
if ( v6 > 0.0 )
v3 = v8;
if ( m_maxPage < v3 )
a1->m_maxPage = v3;
else
a1->m_maxPage = m_maxPage;
v9 = KeybindingsLayer::layerForPage(a1, v3);
KeybindingsLayer::nextPosition(&v21, a1, v3);
v10 = (a1->m_keyCount & 1) == 0;
LOBYTE(v23.x) = 0;
if ( v10 )
v11 = 50;
else
v11 = 100;
*(_WORD *)((char *)&v23.x + 1) = 0;
HIBYTE(v23.x) = v11;
v12 = (cocos2d::CCNode *)cocos2d::CCLayerColor::create(
(cocos2d::CCLayerColor *)&v23,
(const cocos2d::_ccColor4B *)0x43B40000,
30.0,
0.0);
v9->addChild_0(v9, v12, -1);
setPosition = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v22, -180.0, -15.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
setPosition(v12, &v23);
v13 = cocos2d::CCLabelBMFont::create();
setAnchorPoint = (cocos2d::CCLabelBMFont *)v13->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v23, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCPoint *))setAnchorPoint)(v13, &v23);
v9->addChild(v9, v13);
v18 = (cocos2d::CCLabelBMFont *)v13->setPosition;
cocos2d::CCPoint::CCPoint(&v22, -170.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCPoint *))v18)(v13, &v23);
cocos2d::CCLabelBMFont::limitLabelWidth(v13, 260.0, 0.5, 0.0);
v14 = cocos2d::CCLabelBMFont::create();
v19 = (cocos2d::CCLabelBMFont *)v14->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v23, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCPoint *))v19)(v14, &v23);
v9->addChild(v9, v14);
v15 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v22, 170.0, 0.0);
cocos2d::CCPoint::operator+(&v23, &v21, &v22);
v15(v14, &v23);
cocos2d::CCLabelBMFont::limitLabelWidth(v14, 100.0, 0.6, 0.0);
KeybindingsLayer::incrementCountForPage(a1, v3);
return v13;
}