//
// SelectFontLayer::updateFontLabel from 0x4aa228 to 0x4aa2fe (214 bytes)
//
// 2 xrefs:
// > SelectFontLayer::onChangeFont @ 0x4aa360
// > SelectFontLayer::init @ 0x4aa788
//
// 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
//
void SelectFontLayer::updateFontLabel(SelectFontLayer *a1)
{
int m_fontIndex; // r6
cocos2d::CCLabelBMFont *m_fontLabel; // r0
cocos2d::CCString *v4; // r0
GameManager *v5; // r0
GameManager *v6; // r7
GameManager *v7; // r0
cocos2d::CCLabelBMFont *v8; // r0
SelectFontLayer_vtbl *v9; // r3
cocos2d::CCDirector *v10; // r0
cocos2d::CCLabelBMFont *v11; // r6
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCSize v13; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v14; // [sp+Ch] [bp-10h] BYREF
m_fontIndex = a1->m_editorLayer->m_levelSettings->m_fontIndex;
if ( a1->m_font != m_fontIndex )
{
m_fontLabel = a1->m_fontLabel;
if ( m_fontLabel )
{
m_fontLabel->removeFromParent(m_fontLabel);
a1->m_fontLabel = nullptr;
}
a1->m_font = m_fontIndex;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Font %i",
(const char *)(m_fontIndex + 1));
cocos2d::CCString::getCString(v4);
v5 = GameManager::sharedState();
GameManager::loadFont(v5, a1->m_font);
v6 = GameManager::sharedState();
v7 = GameManager::sharedState();
GameManager::getFontFile(v6, v7->m_loadedFont);
v8 = cocos2d::CCLabelBMFont::create();
v9 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_fontLabel = v8;
v9->addChild(a1, v8);
v10 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v13, v10);
v11 = a1->m_fontLabel;
setPosition = v11->setPosition;
cocos2d::CCPoint::CCPoint(&v14, v13.width * 0.5, v13.height * 0.5);
setPosition(v11, &v14);
}
}