//
// StatsCell::loadFromObject from 0x100246aa0 to 0x100246d47 (679 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x1002425a7
//
// 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 __fastcall StatsCell::loadFromObject(StatsCell *a1, StatsObject *a2)
{
StatsCell *m_mainLayer; // rdi
const char *TitleFromKey; // rax
cocos2d::CCLabelBMFont *v5; // r14
cocos2d::CCString *v6; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v8; // r15
char v9; // [rsp+0h] [rbp-30h]
_BYTE v10[40]; // [rsp+8h] [rbp-28h] BYREF
((void (__fastcall *)(cocos2d::CCLayerColor *, __int64))a1->m_backgroundLayer->setOpacity)(a1->m_backgroundLayer, 255);
m_mainLayer = (StatsCell *)a1->m_mainLayer;
((void (__fastcall *)(StatsCell *, __int64))m_mainLayer->removeAllChildrenWithCleanup)(m_mainLayer, 1);
TitleFromKey = StatsCell::getTitleFromKey(m_mainLayer, a2->m_key);
v5 = cocos2d::CCLabelBMFont::create_3(TitleFromKey, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v5);
if ( *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5) > 200.0 )
{
if ( (float)(200.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5)) < 1.0 )
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v5->setScale)(v5);
}
v6 = (cocos2d::CCString *)sub_1007AB580("%i", v9);
CString = cocos2d::CCString::getCString(v6);
v8 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v8);
if ( *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v8->getContentSize)(v8) > 100.0 )
{
if ( (float)(100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v8->getContentSize)(v8)) < 1.0 )
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v8->getContentSize)(v8);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v8->setScale)(v8);
}
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getScale)(v5) <= 0.69999999 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->getScale)(v5, 0.69999999);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double))v5->setScale)(v5, COERCE_DOUBLE(1060320051));
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v8->getScale)(v8) <= 0.69999999 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v8->getScale)(v8, 0.69999999);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double))v8->setScale)(v8, COERCE_DOUBLE(1060320051));
sub_10028CBE0(v10, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v5->setAnchorPoint)(v5, v10);
sub_10028CBE0(v10, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v8->setAnchorPoint)(v8, v10);
sub_10028CBE0(v10, 20.0, (float)(a1->m_height * 0.5) + -1.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v5->setPosition)(v5, v10);
sub_10028CBE0(v10, 330.0, (float)(0.5 * a1->m_height) + -1.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v8->setPosition)(v8, v10);
}