//
// SelectFontLayer2::init from 0x7a1b80 to 0x7a1e88 (776 bytes)
//
// 1 xrefs:
// > SelectFontLayer2::create @ 0x7a1ff2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:59:54 +0000
//
int __fastcall SelectFontLayer2::init(SelectFontLayer2 *this, LevelEditorLayer *a2)
{
int v3; // r6
int v5; // r9
int v6; // r3
cocos2d::CCDirector *v7; // r0
cocos2d::CCLayer *WinSize; // r0
int v9; // r0
int v10; // r3
int v11; // r8
void (__fastcall *v12)(int, _BYTE *); // r10
void (__fastcall *v13)(int, _BYTE *); // r10
const char *v14; // r2
int v15; // r8
int (__fastcall *v16)(int, _BYTE *); // r10
cocos2d::CCMenu *v17; // r0
int v18; // r0
const char *v19; // r1
int v20; // r0
int v21; // r8
void (__fastcall *v22)(int, int *); // r11
unsigned int v23; // r1
cocos2d::CCArray *v24; // r10
cocos2d::CCObject *v25; // r8
cocos2d::CCLayer *v26; // r0
cocos2d::CCLayerColor *v27; // r6
void (__fastcall *v28)(cocos2d::CCLayerColor *, _BYTE *); // r4
cocos2d::CCPoint *v30; // [sp+14h] [bp-38h]
float v31; // [sp+1Ch] [bp-30h] BYREF
float v32; // [sp+20h] [bp-2Ch]
int (__fastcall *v33)(SelectFontLayer2 *, cocos2d::CCObject *); // [sp+24h] [bp-28h]
int v34; // [sp+28h] [bp-24h]
int v35[2]; // [sp+2Ch] [bp-20h] BYREF
_BYTE v36[16]; // [sp+34h] [bp-18h] BYREF
v3 = 0;
v36[0] = 0;
v36[1] = 0;
v36[2] = 0;
v36[3] = -106;
v5 = cocos2d::CCLayerColor::initWithColor(this, v36);
if ( v5 )
{
FLAlertLayer::incrementForcePrio(this);
v6 = *(_DWORD *)this;
*((_BYTE *)this + 468) = 1;
*((_DWORD *)this + 131) = a2;
(*(void (__fastcall **)(SelectFontLayer2 *, int))(v6 + 500))(this, 1);
v7 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SelectFontLayer2 *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v7);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v31);
v9 = cocos2d::CCLayer::create(WinSize);
v10 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v9;
(*(void (__fastcall **)(SelectFontLayer2 *, int))(v10 + 228))(this, v9);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v36);
v12 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v11 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v36, 370.0, 270.0);
v12(v11, v36);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v11, -2);
v13 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v31 * 0.5, v32 * 0.5);
v13(v11, v36);
v15 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Select Font", "goldFont.fnt", v14);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v15);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v15 + 80))(v15, 1061997773);
v16 = *(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v15 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v31 * 0.5, (float)((float)(v32 * 0.5) + 135.0) - 16.0);
v17 = (cocos2d::CCMenu *)v16(v15, v36);
v18 = cocos2d::CCMenu::create(v17);
*((_DWORD *)this + 111) = v18;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v18, 10);
v20 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v19);
v33 = SelectFontLayer2::onClose;
v34 = 0;
v21 = CCMenuItemSpriteExtra::create(v20, 0, (int)this, (int)SelectFontLayer2::onClose, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v21);
CCMenuItemSpriteExtra::setSizeMult(v21, 1.6);
v22 = *(void (__fastcall **)(int, int *))(*(_DWORD *)v21 + 92);
v30 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v36,
(float)((float)(v31 * 0.5) - 185.0) + 10.0,
(float)((float)(v32 * 0.5) + 135.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v35, v30);
v22(v21, v35);
*((_DWORD *)this + 125) = -1;
SelectFontLayer2::loadPreviewSheet(this);
*((_DWORD *)this + 134) = *(_DWORD *)(*(_DWORD *)(*((_DWORD *)this + 131) + 2084) + 300);
v24 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity((cocos2d::CCArray *)off_3C, v23);
do
{
v25 = (cocos2d::CCObject *)operator new(0x38u);
cocos2d::CCObject::CCObject(v25);
*((_DWORD *)v25 + 13) = v3++;
*(_DWORD *)v25 = &off_C8DBE0;
cocos2d::CCObject::autorelease(v25);
cocos2d::CCArray::addObject(v24, v25);
}
while ( v3 != 60 );
v26 = CustomListView::create(v24, (int)this + 520, 1128792064, 1135214592, 0, 33, 0);
v35[0] = -13487566;
*((_DWORD *)this + 132) = v26;
v27 = GJCommentListLayer::create((int)v26, 0, -13487566, 340.0, 200.0, 1);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLayerColor *, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
v27,
10);
v28 = *(void (__fastcall **)(cocos2d::CCLayerColor *, _BYTE *))(*(_DWORD *)v27 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v36,
(float)(v31 - 340.0) * 0.5,
(float)((float)(v32 - 200.0) * 0.5) - 10.0);
v28(v27, v36);
}
return v5;
}