//
// ButtonSprite::setString from 0x2e365c to 0x2e394c (752 bytes)
//
// 10 xrefs:
// > ButtonSprite::updateBGImage @ 0x2e39d2
// > ButtonSprite::init @ 0x2e3b44
// > EditorUI::onResetSpecialFilter @ 0x37b8c8
// > EditorUI::onResetSpecialFilter @ 0x37b8e4
// > EditorUI::setIDPopupClosed @ 0x3a2f54
// > EditorUI::setIDPopupClosed @ 0x3a2fb6
// > CustomizeObjectLayer::updateCustomColorLabels @ 0x461c88
// > CustomizeObjectLayer::textChanged @ 0x461e1a
// > CustomizeObjectLayer::init @ 0x462e7a
// > CustomizeObjectLayer::init @ 0x463032
//
// 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 ButtonSprite::setString(ButtonSprite *a1, const char *a2)
{
const cocos2d::CCSize *v4; // r0
float m_width; // s16
cocos2d::CCLabelBMFont *v6; // r5
void (__fastcall *v7)(cocos2d::CCLabelBMFont *__hidden, float); // r7
float v8; // r0
float m_scale; // s15
float v10; // s16
float m_minWidth; // s17
float width; // s16
float v13; // s16
const cocos2d::CCSize *v14; // r0
float m_height; // s15
cocos2d::extension::CCScale9Sprite *m_BGSprite; // r7
void (__fastcall *setContentSize)(cocos2d::extension::CCScale9Sprite *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r7
float v19; // r8
const cocos2d::CCSize *v20; // r0
cocos2d::CCLabelBMFont *v21; // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v23; // s17
const cocos2d::CCSize *v24; // r0
cocos2d::extension::CCScale9Sprite *v25; // r7
void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v27; // s17
const cocos2d::CCSize *v28; // r0
cocos2d::CCNode *v29; // r0
cocos2d::CCNode *v30; // r7
void (__fastcall *v31)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
const cocos2d::CCSize *v32; // r0
void (__fastcall *v33)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r7
float v34; // s17
const cocos2d::CCSize *v35; // r0
cocos2d::CCLabelBMFont *m_label; // r5
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r7
float *v38; // r0
cocos2d::CCPoint v39; // [sp+4h] [bp-Ch] BYREF
if ( a1->m_mode == 1 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_label->setScale)(a1->m_label, 1065353216);
a1->m_label->setString(a1->m_label, (const unsigned __int8 *)a2);
sub_7753D4((int)&a1->m_caption, (char *)a2);
if ( a1->m_width > 0.0 )
{
v4 = a1->m_label->getContentSize(a1->m_label);
m_width = a1->m_width;
if ( v4->width > m_width )
{
m_label = a1->m_label;
setScale = m_label->setScale;
v38 = (float *)m_label->getContentSize(m_label);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(m_label, m_width / *v38);
}
}
v6 = a1->m_label;
v7 = v6->setScale;
v8 = v6->getScale(v6);
m_scale = a1->m_scale;
if ( v8 <= m_scale )
{
v6 = a1->m_label;
m_scale = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v6->getScale)(v6));
}
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))v7)(v6, LODWORD(m_scale));
if ( a1->m_absolute )
{
v10 = a1->m_width;
}
else
{
m_minWidth = a1->m_minWidth;
width = a1->m_label->getContentSize(a1->m_label)->width;
if ( m_minWidth >= (float)(width * a1->m_label->getScale(a1->m_label)) )
{
v10 = a1->m_minWidth;
}
else
{
v13 = a1->m_label->getContentSize(a1->m_label)->width;
v10 = v13 * a1->m_label->getScale(a1->m_label);
}
}
v14 = a1->m_label->getContentSize(a1->m_label);
m_height = a1->m_height;
m_BGSprite = a1->m_BGSprite;
setContentSize = m_BGSprite->setContentSize;
if ( m_height == 0.0 )
m_height = v14->height + 4.0;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v39, v10 + 16.0, m_height);
setContentSize(m_BGSprite, (const cocos2d::CCSize *)&v39);
v18 = a1->setContentSize;
v19 = a1->m_BGSprite->getContentSize(a1->m_BGSprite)->width;
v20 = a1->m_BGSprite->getContentSize(a1->m_BGSprite);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v39, v19, v20->height);
v18(a1, (const cocos2d::CCSize *)&v39);
v21 = a1->m_label;
setPosition = v21->setPosition;
v23 = a1->m_textOffset.x + (float)(a1->getContentSize(a1)->width * 0.5);
v24 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v39, v23, a1->m_textOffset.y + (float)(v24->height * 0.5));
setPosition(v21, &v39);
v25 = a1->m_BGSprite;
v26 = v25->setPosition;
v27 = a1->getContentSize(a1)->width;
v28 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v39, v27 * 0.5, v28->height * 0.5);
v26(v25, &v39);
if ( a1->getParent(a1) )
{
v29 = a1->getParent(a1);
if ( v29 )
{
if ( _dynamic_cast(
v29,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'CCMenuItemSpriteExtra,
0) )
{
v30 = a1->getParent(a1);
v31 = v30->setContentSize;
v32 = a1->getContentSize(a1);
v31(v30, v32);
v33 = a1->setPosition;
v34 = a1->getContentSize(a1)->width;
v35 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v39, v34 * 0.5, v35->height * 0.5);
v33(a1, &v39);
}
}
}
}
}