//
// Slider::init from 0x140071880 to 0x140071c26 (934 bytes)
//
// 2 xrefs:
// > Slider::create @ 0x14007183c
// > ??> @ 0x1406c6294
//
// 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
//
// Hidden C++ exception states: #wind=3
bool 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)
{
bool result; // al
SliderTouchLogic *v12; // rdi
SliderTouchLogic_vtbl *v13; // rbx
const cocos2d::CCPoint *v14; // rax
SliderThumb *v15; // rbx
cocos2d::CCSprite *v16; // rax
struct cocos2d::CCSprite *v17; // rax
cocos2d::CCTexture2D *v18; // rax
cocos2d::CCSprite_vtbl *v19; // rbx
const cocos2d::CCPoint *v20; // rax
cocos2d::CCSprite_vtbl *v21; // rbx
const cocos2d::CCPoint *v22; // rax
SliderThumb *v23; // [rsp+30h] [rbp-78h] BYREF
SliderTouchLogic *v24; // [rsp+38h] [rbp-70h] BYREF
struct cocos2d::_ccTexParams v25; // [rsp+40h] [rbp-68h] BYREF
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v12 = (SliderTouchLogic *)operator new(0x1E8u);
v24 = v12;
memset(v12, 0, sizeof(SliderTouchLogic));
cocos2d::CCMenu::CCMenu(v12);
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (SliderTouchLogic_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&SliderTouchLogic::`vftable';
v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&SliderTouchLogic::`vftable';
cocos2d::CCPoint::CCPoint(&v12->m_position);
if ( cocos2d::CCMenu::init(v12) )
{
v12->m_rotated = 0;
v12->m_length = a8 * 200.0;
v13 = v12->cocos2d::CCMenu::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v24, 0.0, 0.0);
v13->setPosition_0(v12, v14);
v15 = (SliderThumb *)operator new(0x198u);
v23 = v15;
cocos2d::CCMenuItemImage::CCMenuItemImage(v15);
v15->cocos2d::CCMenuItemImage::cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (SliderThumb_vtbl *)&SliderThumb::`vftable';
v15->cocos2d::CCMenuItemImage::cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&SliderThumb::`vftable';
LODWORD(v15->m_pDisabledImage) = 0;
BYTE4(v15->m_pDisabledImage) = 0;
LODWORD(v15->m_pDisabledImage) = 1128792064;
if ( (unsigned __int8)cocos2d::CCMenuItemImage::initWithNormalImage(v15, a6, a7, 0, a2, a3, v23, v24) )
{
cocos2d::CCObject::autorelease(v15);
}
else
{
((void (__fastcall *)(SliderThumb *, __int64))v15->~SliderThumb)(v15, 1);
v15 = nullptr;
}
v12->m_thumb = v15;
v12->addChild_1(v12, v15);
((void (__fastcall *)(SliderThumb *))v12->m_thumb->setScale_0)(v12->m_thumb);
v12->m_activateThumb = 0;
cocos2d::CCObject::autorelease(v12);
}
else
{
((void (__fastcall *)(SliderTouchLogic *, __int64))v12->~SliderTouchLogic)(v12, 1);
v12 = nullptr;
}
a1->m_touchLogic = v12;
v16 = cocos2d::CCSprite::create(a5);
a1->m_groove = v16;
((void (__fastcall *)(cocos2d::CCSprite *))v16->setScale_0)(v16);
a1->addChild_1(a1, a1->m_groove);
a1->addChild_1(a1, a1->m_touchLogic);
v17 = cocos2d::CCSprite::create("sliderBar.png");
a1->m_sliderBar = v17;
a1->m_width = a1->m_groove->m_obRect.size.width - 4.0;
a1->m_height = 8.0;
v25.minFilter = 9729;
v25.magFilter = 9729;
v25.wrapS = 10497;
v25.wrapT = 10497;
v18 = v17->getTexture(&v17->cocos2d::CCTextureProtocol);
cocos2d::CCTexture2D::setTexParameters(v18, &v25);
a1->m_groove->addChild_0(a1->m_groove, a1->m_sliderBar, -1);
v19 = a1->m_sliderBar->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v23, 0.0, 0.0);
v19->setAnchorPoint(a1->m_sliderBar, v20);
v21 = a1->m_sliderBar->__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v23, 2.0, 4.0);
v21->setPosition_0(a1->m_sliderBar, v22);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_sliderBar->setScaleY)(a1->m_sliderBar);
a1->m_touchLogic->m_slider = a1;
return 1;
}
return result;
}