//
// SearchButton::init from 0x10062ca60 to 0x10062ccb2 (594 bytes)
//
// 11 xrefs:
// > LevelSearchLayer::init @ 0x10062874d
// > LevelSearchLayer::init @ 0x1006287f2
// > LevelSearchLayer::init @ 0x100628897
// > LevelSearchLayer::init @ 0x100628991
// > LevelSearchLayer::init @ 0x100628a3d
// > LevelSearchLayer::init @ 0x100628ae9
// > LevelSearchLayer::init @ 0x100628b95
// > LevelSearchLayer::init @ 0x100628c41
// > LevelSearchLayer::init @ 0x100628ce6
// > LevelSearchLayer::init @ 0x100628fb1
// > SearchButton::create @ 0x10062a956
//
// 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
//
bool __fastcall SearchButton::init(SearchButton *a1, const char *a2, const char *a3, float a4, const char *a5)
{
bool result; // al
bool v9; // r13
_QWORD *v10; // rax
cocos2d::CCLabelBMFont *v11; // rax
cocos2d::CCLabelBMFont *m_label; // r15
cocos2d::CCSprite *v13; // rax
cocos2d::CCSprite *m_icon; // rdi
float v15; // xmm0_4
float v16; // xmm0_4
float v17; // xmm0_4
cocos2d::CCLabelBMFont *v18; // r14
cocos2d::CCSprite *v19; // rbx
float v20; // [rsp+8h] [rbp-48h] BYREF
float v21; // [rsp+10h] [rbp-40h] BYREF
float v22; // [rsp+14h] [rbp-3Ch]
__int64 v23; // [rsp+18h] [rbp-38h] BYREF
float v24; // [rsp+20h] [rbp-30h]
float width; // [rsp+24h] [rbp-2Ch]
width = a4;
result = cocos2d::CCSprite::initWithSpriteFrameName(a1, a2);
if ( result )
{
v9 = result;
sub_10028CBE0(&v21, -1.0, 1.0);
v10 = (_QWORD *)((__int64 (__fastcall *)(SearchButton *))a1->getContentSize)(a1);
sub_10028CFC0(&v23, v10);
v11 = cocos2d::CCLabelBMFont::create_3(a3, "bigFont.fnt");
a1->m_label = v11;
((void (__fastcall *)(SearchButton *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v11, 1);
m_label = a1->m_label;
sub_10028CBE0(&v20, (float)(*(float *)&v23 * 0.5) + v21, (float)(*((float *)&v23 + 1) * 0.5) + v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float *))m_label->setPosition)(m_label, &v20);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_label->setScale)(a1->m_label, width);
if ( a5 )
{
v13 = cocos2d::CCSprite::createWithSpriteFrameName(a5);
a1->m_icon = v13;
((void (__fastcall *)(SearchButton *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v13, 1);
((void (__fastcall *)(cocos2d::CCSprite *, float))a1->m_icon->setScale)(a1->m_icon, 1.1);
m_icon = a1->m_icon;
width = m_icon->m_obRect.size.width;
v15 = ((float (__fastcall *)(cocos2d::CCSprite *))m_icon->getScale)(m_icon);
width = v15 * width;
v24 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_label->getContentSize)(a1->m_label);
v16 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_label->getScale)(a1->m_label);
v17 = (float)(v16 * v24) + 5.0;
width = width * 0.5;
v18 = a1->m_label;
v24 = (float)((float)(width + v17) + 10.0) * 0.5;
sub_10028CBE0(
&v20,
(float)((float)(v17 * 0.5) + (float)((float)(*(float *)&v23 * 0.5) - v24)) + v21,
(float)(*((float *)&v23 + 1) * 0.5) + v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float *))v18->setPosition)(v18, &v20);
v19 = a1->m_icon;
sub_10028CBE0(&v20, (float)((float)(*(float *)&v23 * 0.5) + v24) - width, 0.5 * *((float *)&v23 + 1));
((void (__fastcall *)(cocos2d::CCSprite *, float *))v19->setPosition)(v19, &v20);
}
return v9;
}
return result;
}