//
// NumberInputLayer::init from 0x140348400 to 0x1403489ac (1452 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::tryCloneLevel @ 0x1402fd619
// > LevelInfoLayer::tryCloneLevel @ 0x1402fd60a
// > ??> @ 0x1405adc90
// > ??> @ 0x1406d59fc
//
// 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
//
// Hidden C++ exception states: #wind=2
bool NumberInputLayer::init(NumberInputLayer *a1)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCDirector *v4; // rax
struct cocos2d::CCRect *v5; // rax
struct cocos2d::extension::CCScale9Sprite *v6; // rdi
__int64 v7; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v8; // rbx
const cocos2d::CCSize *v9; // rax
float v10; // xmm0_4
double v11; // xmm0_8
struct cocos2d::CCLabelBMFont *v12; // rdi
cocos2d::CCLabelBMFont_vtbl *v13; // rbx
const cocos2d::CCPoint *v14; // rax
__int64 v15; // rcx
cocos2d::CCMenu *v16; // rax
struct cocos2d::CCSprite *v17; // rax
CCMenuItemSpriteExtra *v18; // rdi
float v19; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v20; // rbx
double v21; // xmm0_8
struct cocos2d::CCPoint v22; // rax
unsigned int v23; // edi
unsigned int v24; // r14d
cocos2d::CCString *v25; // rax
const char *CString; // rsi
ButtonSprite *v27; // rbx
CCMenuItemSpriteExtra *v28; // rax
CCMenuItemSpriteExtra *v29; // rsi
float v30; // xmm1_4
CCMenuItemSpriteExtra_vtbl *v31; // rbx
struct cocos2d::CCPoint v32; // rax
cocos2d::CCLabelBMFont *v33; // rax
cocos2d::CCLabelBMFont_vtbl *v34; // rbx
const cocos2d::CCPoint *v35; // rax
CCMenuItemSpriteExtra *v36; // [rsp+50h] [rbp-E8h] BYREF
cocos2d::CCRect v37; // [rsp+60h] [rbp-D8h] BYREF
float v38; // [rsp+148h] [rbp+10h]
float v39; // [rsp+150h] [rbp+18h] BYREF
ButtonSprite *v40; // [rsp+158h] [rbp+20h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4);
cocos2d::CCRect::CCRect(&v37, 0.0, 0.0, 80.0, 80.0);
v6 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
LOBYTE(v7) = -1;
v6->setOpacity(&v6->cocos2d::CCRGBAProtocol, v7);
v8 = v6->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v40, 270.0, 270.0);
v8->setContentSize(v6, v9);
v10 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v6,
0xFFFFFFFFLL);
v11 = cocos2d::CCPoint::CCPoint(v10, v38 * 0.5);
v6->setPosition_0(v6, (const cocos2d::CCPoint *)&v39);
v12 = cocos2d::CCLabelBMFont::create("Enter Password", "goldFont.fnt");
v13 = v12->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v11, v39);
v13->setPosition_0(v12, v14);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v12);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v12->setScale_0)(v12);
v16 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v15);
a1->m_buttonMenu = v16;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v16, 10);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, a1, (cocos2d::SEL_MenuHandler *)AudioAssetsBrowser::onClose);
HIDWORD(v18->m_pfnSelector.adj) = 1070386381;
v19 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v18);
v20 = v18->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v21 = cocos2d::CCPoint::CCPoint(v19, (float)((float)(v38 * 0.5) - 135.0) + 10.0);
v22 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v36);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v20->setPosition_0)(v18, v22);
v23 = 1;
while ( 1 )
{
v24 = v23;
if ( v23 >= 0xA )
{
if ( v23 == 10 )
{
CString = "<";
}
else if ( v23 == 11 )
{
CString = "0";
v24 = 0;
}
else
{
CString = "OK";
if ( v23 != 12 )
CString = nullptr;
}
}
else
{
v25 = cocos2d::CCString::createWithFormat("%i", v23);
CString = cocos2d::CCString::getCString(v25);
}
v40 = (ButtonSprite *)operator new(0x2C0u);
v27 = ButtonSprite::ButtonSprite(v40);
if ( v27 )
{
if ( ButtonSprite::init_1(
v27,
CString,
30,
30,
1.0,
1,
(const char *)&qword_14052A4D8,
"GJ_button_01.png",
40.0) )
{
cocos2d::CCObject::autorelease(v27);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v27->~ButtonSprite)(v27, 1);
v27 = nullptr;
}
}
v36 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v28 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v36);
v29 = v28;
if ( !v28 )
goto LABEL_19;
if ( !CCMenuItemSpriteExtra::init(v28, v27, nullptr, a1, (cocos2d::SEL_MenuHandler *)NumberInputLayer::onNumber) )
break;
cocos2d::CCObject::autorelease(v29);
LABEL_20:
v29->setTag(v29, v24);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v29);
v30 = v38 * 0.5;
if ( v23 == 3 * (v23 / 3) )
{
v30 = v30 + 60.0;
}
else if ( v23 % 3 == 1 )
{
v30 = v30 + -60.0;
}
if ( v23 == 12 )
a1->m_okButton = v29;
v31 = v29->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v21 = cocos2d::CCPoint::CCPoint(*(float *)&v21, v30);
v32 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v37.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v31->setPosition_0)(v29, v32);
if ( (int)++v23 >= 13 )
{
v33 = cocos2d::CCLabelBMFont::create(byte_140518980, (const char *)&qword_14052A4D8);
a1->m_inputLabel = v33;
v34 = v33->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v21, v39);
v34->setPosition_0(a1->m_inputLabel, v35);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, a1->m_inputLabel);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_inputLabel->setScale_0)(a1->m_inputLabel);
NumberInputLayer::updateNumberState(a1);
return 1;
}
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v29->~CCMenuItemSpriteExtra)(v29, 1);
LABEL_19:
v29 = nullptr;
goto LABEL_20;
}
return result;
}