//
// SelectFontLayer2::init from 0xd030f8 to 0xd0351c (1060 bytes)
//
// 2 xrefs:
// > SelectFontLayer2::create @ 0xd03684
// > ??> @ 0xe6ad0
//
// 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 13:06:55 +0000
//
__int64 __fastcall SelectFontLayer2::init(SelectFontLayer2 *this, LevelEditorLayer *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w26
__int64 v7; // x2
int v8; // w20
cocos2d::CCDirector *v9; // x0
cocos2d::CCDirector *v10; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v12; // x0
__int64 v13; // x19
void (__fastcall *v14)(__int64, __int64 *); // x27
void (__fastcall *v15)(__int64, __int64 *); // x27
const char *v16; // x2
__int64 v17; // x19
__int64 (__fastcall *v18)(__int64, __int64 *); // x27
cocos2d::CCMenu *v19; // x0
__int64 v20; // x0
const char *v21; // x1
__int64 v22; // x0
__int64 v23; // x19
cocos2d::CCNode *v24; // x27
void (__fastcall *v25)(__int64, __int64 *); // x21
unsigned int v26; // w1
cocos2d::CCArray *v27; // x21
cocos2d::CCObject *v28; // x19
__int64 v29; // x0
cocos2d::CCLayerColor *v30; // x19
void (__fastcall *v31)(cocos2d::CCLayerColor *, __int64 *); // x20
__int64 v32; // [xsp+88h] [xbp+88h] BYREF
_BYTE v33[8]; // [xsp+90h] [xbp+90h] BYREF
__int64 v34[2]; // [xsp+98h] [xbp+98h] BYREF
LODWORD(v34[0]) = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v34);
v5 = v4;
if ( v4 )
{
FLAlertLayer::incrementForcePrio(this);
*((_BYTE *)this + 596) = 1;
v7 = *(_QWORD *)this;
*((_QWORD *)this + 84) = a2;
v8 = 0;
(*(void (__fastcall **)(SelectFontLayer2 *, __int64))(v7 + 1000))(this, 1);
v9 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(SelectFontLayer2 *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v32, v10);
v12 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v12;
(*(void (__fastcall **)(SelectFontLayer2 *, __int64))(*(_QWORD *)this + 456LL))(this, v12);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v34, 0.0, 0.0, 80.0, 80.0);
v13 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v34);
v14 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v34, 370.0, 270.0);
v14(v13, v34);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v13,
4294967294LL);
v15 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, *(float *)&v32 * 0.5, *((float *)&v32 + 1) * 0.5);
v15(v13, v34);
v17 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Select Font", "goldFont.fnt", v16);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v17);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v17 + 160LL))(v17, 0.8);
v18 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v34,
*(float *)&v32 * 0.5,
(float)((float)(*((float *)&v32 + 1) * 0.5) + 135.0) - 16.0);
v19 = (cocos2d::CCMenu *)v18(v17, v34);
v20 = cocos2d::CCMenu::create(v19);
*((_QWORD *)this + 69) = v20;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v20,
10);
v22 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v21);
v23 = CCMenuItemSpriteExtra::create(v22, 0, (__int64)this, (__int64)SelectFontLayer2::onClose, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v23);
CCMenuItemSpriteExtra::setSizeMult(v23, 1.6);
v24 = *((cocos2d::CCNode **)this + 69);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v33,
(float)((float)(*(float *)&v32 * 0.5) + -185.0) + 10.0,
(float)((float)(*((float *)&v32 + 1) * 0.5) + 135.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v34, v24, (const cocos2d::CCPoint *)v33);
v25(v23, v34);
*((_DWORD *)this + 160) = -1;
SelectFontLayer2::loadPreviewSheet(this);
v26 = *(_DWORD *)(*(_QWORD *)(*((_QWORD *)this + 84) + 3272LL) + 360LL);
*((_DWORD *)this + 173) = v26;
v27 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity((cocos2d::CCArray *)&word_3C, v26);
do
{
v28 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCObject::CCObject(v28);
*((_DWORD *)v28 + 14) = v8++;
*(_QWORD *)v28 = &off_1428350;
cocos2d::CCObject::autorelease(v28);
cocos2d::CCArray::addObject(v27, v28);
}
while ( v8 != 60 );
v29 = CustomListView::create(v27, (int)this + 664, 0, 33, 200.0, 340.0, 0.0);
*((_QWORD *)this + 85) = v29;
v30 = GJCommentListLayer::create(v29, 0, -13487566, 1u, 340.0, 200.0);
(*(void (__fastcall **)(_QWORD, cocos2d::CCLayerColor *, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v30,
10);
v31 = *(void (__fastcall **)(cocos2d::CCLayerColor *, __int64 *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v34,
(float)(*(float *)&v32 - 340.0) * 0.5,
(float)((float)(*((float *)&v32 + 1) - 200.0) * 0.5) + -10.0);
v31(v30, v34);
}
return v5;
}