//
// SelectFontLayer::init from 0x5d5eb4 to 0x5d630c (1112 bytes)
//
// 1 xrefs:
// > SelectFontLayer::create @ 0x5d6380
//
// 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:54:08 +0000
//
int __fastcall SelectFontLayer::init(SelectFontLayer *this, LevelEditorLayer *a2)
{
int v4; // r3
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *WinSize; // r0
int v7; // r0
int v8; // r3
int v9; // r5
void (__fastcall *v10)(int, _DWORD *); // r7
void (__fastcall *v11)(int, _DWORD *); // r7
const char *v12; // r2
int v13; // r5
void (__fastcall *v14)(int, _DWORD *); // r10
ButtonSprite *v15; // r0
cocos2d::CCMenu *v16; // r0
int v17; // r0
int v18; // r5
void (__fastcall *v19)(int, _DWORD *); // r7
int v20; // r6
const cocos2d::CCPoint *v21; // r8
void (__fastcall *v22)(int, _DWORD *); // r7
float v23; // s15
const char *v24; // r1
cocos2d::CCSprite *v25; // r7
int v26; // r11
const char *v27; // r1
int v28; // r9
int v29; // r6
const cocos2d::CCPoint *v30; // r11
float v32; // [sp+10h] [bp-84h]
int v33; // [sp+14h] [bp-80h]
cocos2d::CCPoint *v34; // [sp+18h] [bp-7Ch]
cocos2d::CCPoint *v35; // [sp+18h] [bp-7Ch]
void (__fastcall *v36)(int, _DWORD *); // [sp+20h] [bp-74h]
float v37; // [sp+2Ch] [bp-68h] BYREF
float v38; // [sp+30h] [bp-64h]
_BYTE v39[8]; // [sp+34h] [bp-60h] BYREF
_BYTE v40[8]; // [sp+3Ch] [bp-58h] BYREF
_BYTE v41[8]; // [sp+44h] [bp-50h] BYREF
_BYTE v42[8]; // [sp+4Ch] [bp-48h] BYREF
int (__fastcall *v43)(SelectFontLayer *, cocos2d::CCObject *); // [sp+54h] [bp-40h]
int v44; // [sp+58h] [bp-3Ch]
_DWORD v45[2]; // [sp+5Ch] [bp-38h] BYREF
int v46[3]; // [sp+64h] [bp-30h] BYREF
int v47[3]; // [sp+70h] [bp-24h] BYREF
_DWORD v48[4]; // [sp+7Ch] [bp-18h] BYREF
v48[0] = -1778384896;
v33 = cocos2d::CCLayerColor::initWithColor(this, v48);
if ( v33 )
{
FLAlertLayer::incrementForcePrio(this);
v4 = *(_DWORD *)this;
*((_DWORD *)this + 131) = a2;
*((_BYTE *)this + 468) = 1;
(*(void (__fastcall **)(SelectFontLayer *, int))(v4 + 500))(this, 1);
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SelectFontLayer *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v5);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v37);
v7 = cocos2d::CCLayer::create(WinSize);
v8 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v7;
(*(void (__fastcall **)(SelectFontLayer *, int))(v8 + 228))(this, v7);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v48, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v48);
v10 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v48, 300.0, 200.0);
v10(v9, v48);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v9, -2);
v11 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v37 * 0.5, v38 * 0.5);
v11(v9, v48);
v13 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Select Font", "goldFont.fnt", v12);
(*(void (__fastcall **)(SelectFontLayer *, int))(*(_DWORD *)this + 228))(this, v13);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 80))(v13, 1061997773);
v14 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v37 * 0.5, (float)((float)(v38 * 0.5) + 100.0) - 16.0);
v14(v13, v48);
v15 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v32);
v43 = SelectFontLayer::onClose;
v44 = 0;
v16 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create((int)v15, 0, (int)this, (int)SelectFontLayer::onClose, 0);
v17 = cocos2d::CCMenu::create(v16, nullptr);
*((_DWORD *)this + 111) = v17;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v17, 10);
v18 = *((_DWORD *)this + 111);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, v37 * 0.5, (float)((float)(v38 * 0.5) - 100.0) + 24.0);
v19(v18, v48);
memset(v46, 0, sizeof(v46));
std::string::__init(v46, "Help", 4u);
memset(v47, 0, sizeof(v47));
std::string::__init(
v47,
"Choose a font that will be used in this level.\nYou can only use one font at a time.",
0x53u);
v20 = InfoAlertButton::create(v46, v47, 1065353216);
std::string::~string((int)v47);
std::string::~string((int)v46);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v20);
v21 = *((const cocos2d::CCPoint **)this + 111);
v22 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
(float)((float)(v37 * 0.5) - 150.0) + 18.0,
(float)((float)(v38 * 0.5) + 100.0) - 18.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v48, v21);
v22(v20, v48);
v23 = v37;
*((_DWORD *)this + 125) = -1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v23 * 0.5, v38 * 0.5);
v25 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_arrow_01_001.png",
v24);
cocos2d::CCSprite::setFlipX(v25, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *, int))(*(_DWORD *)v25 + 80))(v25, 1061997773);
v45[0] = SelectFontLayer::onChangeFont;
v45[1] = 0;
v26 = CCMenuItemSpriteExtra::create((int)v25, 0, (int)this, (int)SelectFontLayer::onChangeFont, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v26);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v26 + 36))(v26, 1);
v36 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v26 + 92);
v34 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, 110.0, 0.0);
cocos2d::CCPoint::operator+(v42, v39, v41);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v48, v34);
v36(v26, v48);
CCMenuItemSpriteExtra::setSizeMult(v26, 2.0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v26 + 36))(v26, 1);
v28 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v27);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v28 + 80))(v28, 1061997773);
v48[0] = SelectFontLayer::onChangeFont;
v48[1] = 0;
v29 = CCMenuItemSpriteExtra::create(v28, 0, (int)this, (int)SelectFontLayer::onChangeFont, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v29);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v29 + 36))(v29, 2);
v30 = *((const cocos2d::CCPoint **)this + 111);
v35 = *(cocos2d::CCPoint **)(*(_DWORD *)v29 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, -110.0, 0.0);
cocos2d::CCPoint::operator+(v41, v39, v40);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v42, v30);
((void (__fastcall *)(int, _BYTE *))v35)(v29, v42);
CCMenuItemSpriteExtra::setSizeMult(v29, 2.0);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v29 + 36))(v29, 0);
SelectFontLayer::updateFontLabel((int *)this);
}
return v33;
}