//
// SelectFontLayer::init from 0xa21d2c to 0xa22328 (1532 bytes)
//
// 2 xrefs:
// > SelectFontLayer::create @ 0xa22484
// > ??> @ 0x4b448
//
// 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:59:40 +0000
//
__int64 __fastcall SelectFontLayer::init(SelectFontLayer *this, LevelEditorLayer *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w24
__int64 v7; // x2
cocos2d::CCDirector *v8; // x0
cocos2d::CCDirector *v9; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v11; // x0
__int64 v12; // x22
void (__fastcall *v13)(__int64, __int64 *); // x27
void (__fastcall *v14)(__int64, __int64 *); // x27
const char *v15; // x2
__int64 v16; // x22
void (__fastcall *v17)(__int64, __int64 *); // x27
const char *v18; // x6
__int64 v19; // x0
cocos2d::CCMenu *v20; // x0
__int64 v21; // x0
__int64 v22; // x22
void (__fastcall *v23)(__int64, __int64 *); // x23
__int64 v24; // x22
void (__fastcall *v25)(__int64, __int64 *); // x28
__int64 v26; // kr00_8
const char *v27; // x1
cocos2d::CCSprite *v28; // x22
__int64 v29; // x22
const char *v30; // x1
__int64 v31; // x22
__int64 v32; // x22
cocos2d::CCNode *v33; // x28
void (__fastcall *v34)(__int64, __int64 *); // x27
cocos2d::CCNode *v35; // [xsp+80h] [xbp+80h]
cocos2d::CCNode *v36; // [xsp+88h] [xbp+88h]
cocos2d::CCNode *v37; // [xsp+88h] [xbp+88h]
__int64 v38; // [xsp+98h] [xbp+98h] BYREF
_BYTE v39[8]; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v40[8]; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v41; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v42[2]; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v43[2]; // [xsp+C8h] [xbp+C8h] BYREF
void *v44; // [xsp+D8h] [xbp+D8h]
__int64 v45[2]; // [xsp+E0h] [xbp+E0h] BYREF
void *v46; // [xsp+F0h] [xbp+F0h]
LODWORD(v42[0]) = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v42);
v5 = v4;
if ( v4 )
{
FLAlertLayer::incrementForcePrio(this);
*((_BYTE *)this + 596) = 1;
v7 = *(_QWORD *)this;
*((_QWORD *)this + 83) = a2;
(*(void (__fastcall **)(SelectFontLayer *, __int64))(v7 + 1000))(this, 1);
v8 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(SelectFontLayer *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v38, v9);
v11 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v11;
(*(void (__fastcall **)(SelectFontLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v11);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v42, 0.0, 0.0, 80.0, 80.0);
v12 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v42);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v42, 300.0, 200.0);
v13(v12, v42);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v12,
4294967294LL);
v14 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, *(float *)&v38 * 0.5, *((float *)&v38 + 1) * 0.5);
v14(v12, v42);
v16 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Select Font", "goldFont.fnt", v15);
(*(void (__fastcall **)(SelectFontLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v16);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 0.8);
v17 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v42,
*(float *)&v38 * 0.5,
(float)((float)(*((float *)&v38 + 1) * 0.5) + 100.0) - 16.0);
v17(v16, v42);
v19 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v18,
30.0);
v20 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v19, 0, (__int64)this, (__int64)SelectFontLayer::onClose, 0);
v21 = cocos2d::CCMenu::create(v20, nullptr);
*((_QWORD *)this + 69) = v21;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v21,
10);
v22 = *((_QWORD *)this + 69);
v23 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v42,
*(float *)&v38 * 0.5,
(float)((float)(*((float *)&v38 + 1) * 0.5) + -100.0) + 24.0);
v23(v22, v42);
v43[0] = 0;
v43[1] = 0;
v44 = nullptr;
std::string::__init(v43, "Help", 4u);
v45[0] = 0;
v45[1] = 0;
v46 = nullptr;
std::string::__init(
v45,
"Choose a font that will be used in this level.\nYou can only use one font at a time.",
0x53u);
v24 = InfoAlertButton::create(v43, v45, 1.0);
if ( (v45[0] & 1) != 0 )
{
operator delete(v46);
if ( (v43[0] & 1) == 0 )
goto LABEL_5;
}
else if ( (v43[0] & 1) == 0 )
{
LABEL_5:
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v24);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v24 + 184LL);
v36 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v41,
(float)((float)(*(float *)&v38 * 0.5) + -150.0) + 18.0,
(float)((float)(*((float *)&v38 + 1) * 0.5) + 100.0) - 18.0);
cocos2d::CCNode::convertToNodeSpace(v42, v36, (const cocos2d::CCPoint *)&v41);
v25(v24, v42);
v26 = v38;
*((_DWORD *)this + 160) = -1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, *(float *)&v26 * 0.5, *((float *)&v26 + 1) * 0.5);
v28 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_arrow_01_001.png",
v27);
cocos2d::CCSprite::setFlipX(v28, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *, float))(*(_QWORD *)v28 + 160LL))(v28, 0.8);
v29 = CCMenuItemSpriteExtra::create((__int64)v28, 0, (__int64)this, (__int64)SelectFontLayer::onChangeFont, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v29);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 72LL))(v29, 1);
v35 = *((cocos2d::CCNode **)this + 69);
v37 = *(cocos2d::CCNode **)(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, 110.0, 0.0);
cocos2d::CCPoint::operator+(&v41, v39);
cocos2d::CCNode::convertToNodeSpace(v42, v35, (const cocos2d::CCPoint *)&v41);
((void (__fastcall *)(__int64, __int64 *))v37)(v29, v42);
CCMenuItemSpriteExtra::setSizeMult(v29, 2.0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 72LL))(v29, 1);
v31 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v30);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v31 + 160LL))(v31, 0.8);
v32 = CCMenuItemSpriteExtra::create(v31, 0, (__int64)this, (__int64)SelectFontLayer::onChangeFont, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v32 + 72LL))(v32, 2);
v33 = *((cocos2d::CCNode **)this + 69);
v34 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, -110.0, 0.0);
cocos2d::CCPoint::operator+(&v41, v39);
cocos2d::CCNode::convertToNodeSpace(v42, v33, (const cocos2d::CCPoint *)&v41);
v34(v32, v42);
CCMenuItemSpriteExtra::setSizeMult(v32, 2.0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v32 + 72LL))(v32, 0);
SelectFontLayer::updateFontLabel(this);
return v5;
}
operator delete(v44);
goto LABEL_5;
}
return v5;
}