//
// SelectFontLayer::init from 0x4aa368 to 0x4aa7b8 (1104 bytes)
//
// 1 xrefs:
// > SelectFontLayer::create @ 0x4aa824
//
// 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 SelectFontLayer::init(SelectFontLayer *a1, LevelEditorLayer *a2)
{
SelectFontLayer_vtbl *v4; // r3
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *v6; // r0
SelectFontLayer_vtbl *v7; // r3
cocos2d::CCNode *v8; // r6
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v11; // r6
void (__fastcall *v12)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
ButtonSprite *v13; // r0
CCMenuItemSpriteExtra *v14; // r0
cocos2d::CCMenu *v15; // r0
cocos2d::CCMenu *m_buttonMenu; // r6
void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
float v18; // r3
cocos2d::CCNode *v19; // r6
cocos2d::CCMenu *v20; // r9
void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float width; // s15
cocos2d::CCSprite *v23; // r8
CCMenuItemSpriteExtra *v24; // r11
cocos2d::CCSprite *v25; // r5
CCMenuItemSpriteExtra *v26; // r5
void (__fastcall *v27)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
float v29; // r2
float v30; // r3
float v31; // [sp+10h] [bp-6Ch]
int v32; // [sp+14h] [bp-68h]
cocos2d::CCMenu *v33; // [sp+18h] [bp-64h]
cocos2d::CCMenu *v34; // [sp+18h] [bp-64h]
void (__fastcall *v35)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-5Ch]
cocos2d::CCSize v36; // [sp+2Ch] [bp-50h] BYREF
cocos2d::CCPoint v37; // [sp+34h] [bp-48h] BYREF
cocos2d::CCPoint v38; // [sp+3Ch] [bp-40h] BYREF
cocos2d::CCPoint v39; // [sp+44h] [bp-38h] BYREF
cocos2d::CCPoint v40; // [sp+4Ch] [bp-30h] BYREF
void (*v41)(SelectFontLayer *, cocos2d::CCObject *); // [sp+54h] [bp-28h]
int v42; // [sp+58h] [bp-24h]
cocos2d::CCPoint v43; // [sp+5Ch] [bp-20h] BYREF
cocos2d::CCRect v44; // [sp+64h] [bp-18h] BYREF
cocos2d::CCSize v45; // 0:^0.8
cocos2d::CCRect v46; // 0:kr00_16.16
v44.origin.x = -1.034e-25;
v32 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v44);
if ( v32 )
{
FLAlertLayer::incrementForcePrio(a1);
v4 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_editorLayer = a2;
a1->m_noElasticity = 1;
v4->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v36, v5);
v6 = cocos2d::CCLayer::create();
v7 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v6;
v7->addChild(a1, v6);
cocos2d::CCRect::CCRect(&v44, 0.0, 0.0, 80.0, 80.0);
v46.origin.x = v29;
v46.origin.y = v30;
v46.size = v45;
v8 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v44,
v46);
setContentSize = v8->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v44, 300.0, 200.0);
setContentSize(v8, (const cocos2d::CCSize *)&v44);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, -2);
setPosition = v8->setPosition;
cocos2d::CCPoint::CCPoint(&v44.origin, v36.width * 0.5, v36.height * 0.5);
setPosition(v8, &v44.origin);
v11 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v11);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v11->setScale)(v11, 1061997773);
v12 = v11->setPosition;
cocos2d::CCPoint::CCPoint(&v44.origin, v36.width * 0.5, (float)((float)(v36.height * 0.5) + 100.0) - 16.0);
v12(v11, &v44.origin);
v13 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v31);
v41 = SelectFontLayer::onClose;
v42 = 0;
v14 = CCMenuItemSpriteExtra::create(
v13,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SelectFontLayer::onClose, (unsigned int)a1));
v15 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v14, nullptr);
a1->m_buttonMenu = v15;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v15, 10);
m_buttonMenu = a1->m_buttonMenu;
v17 = m_buttonMenu->setPosition;
cocos2d::CCPoint::CCPoint(&v44.origin, v36.width * 0.5, (float)((float)(v36.height * 0.5) - 100.0) + 24.0);
v17(m_buttonMenu, &v44.origin);
sub_776584((int)&v43, "Help");
sub_776584((int)&v44, "Choose a font that will be used in this level.\nYou can only use one font at a time.");
v19 = (cocos2d::CCNode *)InfoAlertButton::create(
(InfoAlertButton *)&v43,
(std::string)&v44,
(std::string)1065353216,
v18);
sub_774008(&v44);
sub_774008(&v43);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v19);
v20 = a1->m_buttonMenu;
v21 = v19->setPosition;
cocos2d::CCPoint::CCPoint(
&v43,
(float)((float)(v36.width * 0.5) - 150.0) + 18.0,
(float)((float)(v36.height * 0.5) + 100.0) - 18.0);
cocos2d::CCNode::convertToNodeSpace(&v44.origin, v20, &v43);
v21(v19, &v44.origin);
width = v36.width;
a1->m_joystickConnected = -1;
cocos2d::CCPoint::CCPoint(&v37, width * 0.5, v36.height * 0.5);
v23 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v23, 1);
((void (__fastcall *)(cocos2d::CCSprite *, int))v23->setScale)(v23, 1061997773);
LODWORD(v43.x) = SelectFontLayer::onChangeFont;
v43.y = 0.0;
v24 = CCMenuItemSpriteExtra::create(
v23,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SelectFontLayer::onChangeFont, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v24);
v24->setTag(v24, 1);
v35 = v24->setPosition;
v33 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v39, 110.0, 0.0);
cocos2d::CCPoint::operator+(&v40, &v37, &v39);
cocos2d::CCNode::convertToNodeSpace(&v44.origin, v33, &v40);
v35(v24, &v44.origin);
CCMenuItemSpriteExtra::setSizeMult(v24, 2.0);
v24->setTag(v24, 1);
v25 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v25->setScale)(v25, 1061997773);
LODWORD(v44.origin.x) = SelectFontLayer::onChangeFont;
v44.origin.y = 0.0;
v26 = CCMenuItemSpriteExtra::create(
v25,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SelectFontLayer::onChangeFont, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v26);
v26->setTag(v26, 2);
v27 = v26->setPosition;
v34 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v38, -110.0, 0.0);
cocos2d::CCPoint::operator+(&v39, &v37, &v38);
cocos2d::CCNode::convertToNodeSpace(&v40, v34, &v39);
v27(v26, &v40);
CCMenuItemSpriteExtra::setSizeMult(v26, 2.0);
v26->setTag(v26, 0);
SelectFontLayer::updateFontLabel(a1);
}
return v32;
}