//
// NumberInputLayer::init from 0x956970 to 0x956eec (1404 bytes)
//
// 4 xrefs:
// > ParentalGateLayer::init @ 0x8f91c4
// > NumberInputLayer::create @ 0x9566d0
// > ??> @ 0x68dd0
// > ??> @ 0x146c930
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:57:25 +0000
//
__int64 __fastcall NumberInputLayer::init(cocos2d::CCNode **this)
{
cocos2d::CCDirector *v3; // x0
int v4; // w26
__int64 v5; // x28
const char *v6; // x2
__int64 v7; // x28
cocos2d::CCMenu *v8; // x0
__int64 v9; // x0
const char *v10; // x1
__int64 v11; // x0
__int64 v12; // x28
const char *v13; // x6
float v14; // s8
float v15; // s0
cocos2d::CCNode *v16; // x23
void (__fastcall *v17)(__int64, __int64 *); // x27
cocos2d::CCString *v18; // x0
ButtonSprite *CString; // x0
const char *v20; // x6
__int64 v21; // x0
__int64 v22; // x28
float v23; // s1
unsigned int v24; // w27
char *v25; // x0
__int64 v26; // x0
cocos2d::CCNode *v27; // x24
void (__fastcall *v28)(__int64, __int64 *); // x23
const char *v29; // x2
__int64 v30; // x21
float v31; // s2
void (__fastcall *v32)(__int64, _BYTE *); // x22
cocos2d::CCNode *v33; // [xsp+A8h] [xbp+A8h]
void (__fastcall *v34)(__int64, _BYTE *); // [xsp+B0h] [xbp+B0h]
void (__fastcall *v35)(__int64, _BYTE *); // [xsp+B0h] [xbp+B0h]
void (__fastcall *v36)(__int64, __int64 *); // [xsp+B0h] [xbp+B0h]
unsigned __int8 v37; // [xsp+BFh] [xbp+BFh]
__int64 v38; // [xsp+C0h] [xbp+C0h] BYREF
float v39; // [xsp+C8h] [xbp+C8h] BYREF
float v40; // [xsp+CCh] [xbp+CCh]
__int64 v41; // [xsp+D0h] [xbp+D0h] BYREF
_BYTE v42[16]; // [xsp+D8h] [xbp+D8h] BYREF
v37 = FLAlertLayer::init((FLAlertLayer *)this, 150);
if ( v37 )
{
v3 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v37);
cocos2d::CCDirector::getWinSize(&v38, v3);
v4 = 1;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v42, 0.0, 0.0, 80.0, 80.0);
v5 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v42);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 912LL))(v5, 0xFFFFFFFFLL);
v34 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v5 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v42, 270.0, 270.0);
v34(v5, v42);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v5, 0xFFFFFFFFLL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, *(float *)&v38 * 0.5, *((float *)&v38 + 1) * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v5 + 184LL))(v5, &v39);
v7 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Enter Password", "goldFont.fnt", v6);
*(this + 84) = (cocos2d::CCNode *)v7;
v35 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v7 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v39, (float)(v40 + 135.0) - 16.0);
v35(v7, v42);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), *(this + 84));
v8 = (cocos2d::CCMenu *)(*(__int64 (__fastcall **)(_QWORD, float))(*(_QWORD *)*(this + 84) + 160LL))(
*(this + 84),
0.6);
v9 = cocos2d::CCMenu::create(v8);
*(this + 69) = (cocos2d::CCNode *)v9;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v9, 10);
v11 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v10);
v12 = CCMenuItemSpriteExtra::create(v11, 0, (__int64)this, (__int64)NumberInputLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v12, 1.6);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v12);
v36 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
v33 = *(this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v42,
(float)((float)(*(float *)&v38 * 0.5) + -135.0) + 10.0,
(float)((float)(*((float *)&v38 + 1) * 0.5) + 135.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(&v41, v33, (const cocos2d::CCPoint *)v42);
v36(v12, &v41);
v14 = (float)(*((float *)&v38 + 1) * 0.5) + 50.0;
while ( 1 )
{
if ( v4 > 9 )
{
if ( v4 == 10 )
{
v24 = 10;
v25 = (char *)&unk_11688A0;
}
else if ( v4 == 11 )
{
v24 = 0;
v25 = "0";
}
else
{
v24 = 12;
v25 = "OK";
}
v26 = ButtonSprite::create(
(ButtonSprite *)v25,
(const char *)&off_18 + 6,
(int)&off_18 + 6,
1,
1.0,
"bigFont.fnt",
"GJ_button_01.png",
v13,
40.0);
v22 = CCMenuItemSpriteExtra::create(v26, 0, (__int64)this, (__int64)NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v22 + 72LL))(v22, v24);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v22);
v23 = v14 - 150.0;
}
else
{
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)v4);
CString = (ButtonSprite *)cocos2d::CCString::getCString(v18);
v21 = ButtonSprite::create(
CString,
(const char *)&off_18 + 6,
(int)&off_18 + 6,
1,
1.0,
"bigFont.fnt",
"GJ_button_01.png",
v20,
40.0);
v22 = CCMenuItemSpriteExtra::create(v21, 0, (__int64)this, (__int64)NumberInputLayer::onNumber, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v22 + 72LL))(v22, (unsigned int)v4);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v22);
if ( v4 <= 6 )
v23 = v4 <= 3 ? v14 : v14 - 50.0;
else
v23 = v14 - 100.0;
}
v15 = *(float *)&v38 * 0.5;
if ( v4 % 3 )
{
if ( v4 % 3 == 1 )
v15 = v15 - 60.0;
}
else
{
v15 = v15 + 60.0;
}
if ( v4 == 12 )
break;
v16 = *(this + 69);
++v4;
v17 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v15, v23);
cocos2d::CCNode::convertToNodeSpace(&v41, v16, (const cocos2d::CCPoint *)v42);
v17(v22, &v41);
}
*(this + 85) = (cocos2d::CCNode *)v22;
v27 = *(this + 69);
v28 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v15, v23);
cocos2d::CCNode::convertToNodeSpace(&v41, v27, (const cocos2d::CCPoint *)v42);
v28(v22, &v41);
v30 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&byte_11B8890, "bigFont.fnt", v29);
v31 = v40;
*(this + 83) = (cocos2d::CCNode *)v30;
v32 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v39, v31 + 95.0);
v32(v30, v42);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), *(this + 83));
(*(void (__fastcall **)(_QWORD, float))(*(_QWORD *)*(this + 83) + 160LL))(*(this + 83), 0.8);
NumberInputLayer::updateNumberState((NumberInputLayer *)this);
}
return v37;
}