//
// Slider::init from 0x1002ef580 to 0x1002ef72c (428 bytes)
//
// 1 xrefs:
// > Slider::create @ 0x1002ef524
//
// 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 Slider::init(
Slider *a1,
cocos2d::CCNode *a2,
cocos2d::SEL_MenuHandler a3,
const char *a4,
const char *a5,
const char *a6,
const char *a7,
float a8)
{
size_t adj; // x25
void (__cdecl *ptr)(cocos2d::CCObject *); // x26
_BOOL4 v17; // w20
cocos2d::CCSprite *v18; // x0
cocos2d::CCSprite *v19; // x0
cocos2d::CCTexture2D *v20; // x0
__n128 v21; // q0
cocos2d::CCSprite *m_sliderBar; // x21
__n128 v23; // q1
__n128 v24; // q0
cocos2d::CCSprite *v25; // x21
__n128 v26; // q1
int v28; // [xsp+8h] [xbp-78h] BYREF
__int128 v29; // [xsp+10h] [xbp-70h] BYREF
cocos2d::SEL_MenuHandler v30; // 0:x1.16
adj = a3.adj;
ptr = a3.ptr;
v17 = cocos2d::CCLayer::init(a1);
if ( v17 )
{
v30.ptr = ptr;
v30.adj = adj;
a1->m_touchLogic = SliderTouchLogic::create(a2, v30, a6, a7, a8);
v18 = cocos2d::CCSprite::create(a5);
a1->m_groove = v18;
((void (__fastcall *)(cocos2d::CCSprite *, float))v18->setScale)(v18, a8);
((void (__fastcall *)(Slider *, cocos2d::CCSprite *))a1->addChild)(a1, a1->m_groove);
((void (__fastcall *)(Slider *, SliderTouchLogic *))a1->addChild)(a1, a1->m_touchLogic);
v19 = cocos2d::CCSprite::create(a4);
a1->m_sliderBar = v19;
a1->m_width = a1->m_groove->m_obRect.size.width + -4.0;
a1->m_height = 8.0;
v29 = xmmword_100636BB0;
v20 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v19->getTexture)(v19);
cocos2d::CCTexture2D::setTexParameters(v20, (cocos2d::ccTexParams *)&v29);
v21 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_groove->addChild_0)(
a1->m_groove,
a1->m_sliderBar,
0xFFFFFFFFLL);
m_sliderBar = a1->m_sliderBar;
v21.n128_u32[0] = 0;
v23.n128_u32[0] = 0;
sub_100022980(v21, v23, &v28);
v24 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, int *))m_sliderBar->setAnchorPoint)(m_sliderBar, &v28);
v25 = a1->m_sliderBar;
v24.n128_u32[0] = 2.0;
v26.n128_u32[0] = 4.0;
sub_100022980(v24, v26, &v28);
((void (__fastcall *)(cocos2d::CCSprite *, int *))v25->setPosition)(v25, &v28);
((void (__fastcall *)(cocos2d::CCSprite *, float))a1->m_sliderBar->setScaleY)(a1->m_sliderBar, 1.0);
a1->m_touchLogic->m_slider = a1;
}
return v17;
}