//
// ConfigureHSVWidget::init from 0x140096ae0 to 0x1400973b1 (2257 bytes)
//
// 2 xrefs:
// > ConfigureHSVWidget::create @ 0x140096a97
// > ??> @ 0x1406c72cc
//
// 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=2
bool ConfigureHSVWidget::init(ConfigureHSVWidget *a1, cocos2d::ccHSVValue *a2, bool a3, bool a4)
{
bool result; // al
cocos2d::CCDictionary *v8; // rax
struct cocos2d::CCRect *v9; // rax
struct cocos2d::extension::CCScale9Sprite *v10; // rdi
__int64 v11; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v12; // rbx
const cocos2d::CCSize *v13; // rax
cocos2d::CCLabelBMFont *v14; // rax
cocos2d::CCLabelBMFont_vtbl *v15; // rbx
const cocos2d::CCPoint *v16; // rax
const char *v17; // r8
const cocos2d::CCPoint *v18; // rax
Slider *v19; // rax
const cocos2d::CCPoint *v20; // rax
SliderThumb *m_thumb; // rcx
cocos2d::CCLabelBMFont *v22; // rax
cocos2d::CCLabelBMFont_vtbl *v23; // rbx
const cocos2d::CCPoint *v24; // rax
const cocos2d::CCPoint *v25; // rax
const char *v26; // r8
const cocos2d::CCPoint *v27; // rax
Slider *v28; // rax
const cocos2d::CCPoint *v29; // rax
SliderThumb *v30; // rcx
cocos2d::CCLabelBMFont *v31; // rax
cocos2d::CCLabelBMFont_vtbl *v32; // rbx
const cocos2d::CCPoint *v33; // rax
const cocos2d::CCPoint *v34; // rax
const char *v35; // r8
const cocos2d::CCPoint *v36; // rax
Slider *v37; // rax
const cocos2d::CCPoint *v38; // rax
SliderThumb *v39; // rcx
__int64 v40; // rcx
cocos2d::CCNode *v41; // r14
__int64 v42; // rcx
__int64 v43; // rax
cocos2d::CCTouchDispatcher *v44; // rax
__int64 v45; // rcx
__int64 v46; // rax
__int64 v47; // rax
const cocos2d::CCPoint *v48; // rax
float *v49; // rax
const cocos2d::CCPoint *v50; // rax
float *v51; // rax
struct cocos2d::CCSprite *v52; // rax
CCMenuItemSpriteExtra *v53; // rdi
CCMenuItemSpriteExtra_vtbl *v54; // rbx
struct cocos2d::CCPoint v55; // rax
cocos2d::CCPoint v56; // [rsp+88h] [rbp-80h] BYREF
cocos2d::CCPoint v57; // [rsp+90h] [rbp-78h] BYREF
__int128 *v58; // [rsp+98h] [rbp-70h] BYREF
cocos2d::CCRect v59; // [rsp+A0h] [rbp-68h] BYREF
__int128 v60; // [rsp+B0h] [rbp-58h] BYREF
__int64 v61; // [rsp+C0h] [rbp-48h]
__int64 v62; // [rsp+C8h] [rbp-40h]
result = cocos2d::CCNode::init(a1);
if ( result )
{
a1->m_updating = 1;
v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create();
a1->m_inputs = v8;
cocos2d::CCObject::retain(v8);
a1->m_hsv = *a2;
a1->m_addInputs = a4;
cocos2d::CCRect::CCRect(&v59, 0.0, 0.0, 80.0, 80.0);
v10 = cocos2d::extension::CCScale9Sprite::create("square02_001.png", v9);
LOBYTE(v11) = 75;
v10->setOpacity(&v10->cocos2d::CCRGBAProtocol, v11);
v12 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v57, 270.0, 160.0);
v12->setContentSize(v10, v13);
a1->addChild_0(a1, v10, -1);
v14 = cocos2d::CCLabelBMFont::create("Hue:", (const char *)&qword_14052A4D8);
a1->m_hueLabel = v14;
a1->addChild_1(a1, v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_hueLabel->setScale_0)(a1->m_hueLabel);
v15 = a1->m_hueLabel->__vftable;
cocos2d::CCPoint::CCPoint(&v57, 0.0, 66.0);
v15->setPosition_0(a1->m_hueLabel, v16);
if ( a1->m_addInputs )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, -10.0, 0.0);
v18 = a1->m_hueLabel->getPosition_0(a1->m_hueLabel);
cocos2d::CCPoint::operator+(v18, &v57);
ConfigureHSVWidget::createTextInputNode(a1, (cocos2d::CCPoint)&v57, 1);
}
v19 = Slider::create(
a1,
(cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::sliderChanged,
v17,
"slidergroove.png",
"sliderthumb.png",
"sliderthumbsel.png",
1.0);
a1->m_hueSlider = v19;
v19->m_sliderBar->setVisible(v19->m_sliderBar, 0);
a1->addChild_1(a1, a1->m_hueSlider);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, -25.0);
v20 = a1->m_hueLabel->getPosition_0(a1->m_hueLabel);
cocos2d::CCPoint::operator+(v20, &v57);
a1->m_hueSlider->setPosition_0(a1->m_hueSlider, &v57);
m_thumb = a1->m_hueSlider->m_touchLogic->m_thumb;
m_thumb->setTag(m_thumb, 1);
v22 = cocos2d::CCLabelBMFont::create("Saturation:", (const char *)&qword_14052A4D8);
a1->m_saturationLabel = v22;
a1->addChild_1(a1, v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_saturationLabel->setScale_0)(a1->m_saturationLabel);
v23 = a1->m_saturationLabel->__vftable;
v24 = a1->m_hueLabel->getPosition_0(a1->m_hueLabel);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, v24->y - 50.0);
v23->setPosition_0(a1->m_saturationLabel, v25);
if ( a1->m_addInputs )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 22.0, 0.0);
v27 = a1->m_saturationLabel->getPosition_0(a1->m_saturationLabel);
cocos2d::CCPoint::operator+(v27, &v57);
ConfigureHSVWidget::createTextInputNode(a1, (cocos2d::CCPoint)&v57, 2);
}
v28 = Slider::create(
a1,
(cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::sliderChanged,
v26,
"slidergroove.png",
"sliderthumb.png",
"sliderthumbsel.png",
1.0);
a1->m_saturationSlider = v28;
v28->m_sliderBar->setVisible(v28->m_sliderBar, 0);
a1->addChild_1(a1, a1->m_saturationSlider);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, -25.0);
v29 = a1->m_saturationLabel->getPosition_0(a1->m_saturationLabel);
cocos2d::CCPoint::operator+(v29, &v57);
a1->m_saturationSlider->setPosition_0(a1->m_saturationSlider, &v57);
v30 = a1->m_saturationSlider->m_touchLogic->m_thumb;
v30->setTag(v30, 2);
v31 = cocos2d::CCLabelBMFont::create("Brightness:", (const char *)&qword_14052A4D8);
a1->m_brightnessLabel = v31;
a1->addChild_1(a1, v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_brightnessLabel->setScale_0)(a1->m_brightnessLabel);
v32 = a1->m_brightnessLabel->__vftable;
v33 = a1->m_saturationLabel->getPosition_0(a1->m_saturationLabel);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, v33->y - 50.0);
v32->setPosition_0(a1->m_brightnessLabel, v34);
if ( a1->m_addInputs )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 22.0, 0.0);
v36 = a1->m_brightnessLabel->getPosition_0(a1->m_brightnessLabel);
cocos2d::CCPoint::operator+(v36, &v57);
ConfigureHSVWidget::createTextInputNode(a1, (cocos2d::CCPoint)&v57, 3);
}
v37 = Slider::create(
a1,
(cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::sliderChanged,
v35,
"slidergroove.png",
"sliderthumb.png",
"sliderthumbsel.png",
1.0);
a1->m_brightnessSlider = v37;
v37->m_sliderBar->setVisible(v37->m_sliderBar, 0);
a1->addChild_1(a1, a1->m_brightnessSlider);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, -25.0);
v38 = a1->m_brightnessLabel->getPosition_0(a1->m_brightnessLabel);
cocos2d::CCPoint::operator+(v38, &v57);
a1->m_brightnessSlider->setPosition_0(a1->m_brightnessSlider, &v57);
v39 = a1->m_brightnessSlider->m_touchLogic->m_thumb;
v39->setTag(v39, 3);
v41 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v40);
a1->addChild_1(a1, v41);
v43 = cocos2d::CCDirector::sharedDirector(v42);
v44 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v43 + 144LL))(v43);
if ( cocos2d::CCTouchDispatcher::isUsingForcePrio(v44) )
{
v46 = cocos2d::CCDirector::sharedDirector(v45);
v47 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v46 + 144LL))(v46);
((void (__fastcall *)(cocos2d::CCNode *, _QWORD))v41->__vftable[1].getTag)(
v41,
(unsigned int)(*(_DWORD *)(v47 + 124) - 1));
}
cocos2d::CCPoint::CCPoint(&v56, -95.0, 0.0);
v58 = &v60;
v60 = 0;
v61 = 1;
v62 = 15;
LOWORD(v60) = 32;
v48 = a1->m_saturationLabel->getPosition_0(a1->m_saturationLabel);
cocos2d::CCPoint::operator+(v48, &v57);
cocos2d::CCPoint::CCPoint(&v59.origin, 0.0, 1.0);
GameToolbox::createToggleButton(
(const char *)&v60,
(cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::onToggleSConst,
a1->m_hsv.absoluteSaturation,
v41,
(struct cocos2d::CCPoint)&v57,
a1,
a1,
0.60000002,
0.40000001,
150.0,
v49,
(const char *)&qword_14052A4D8,
1,
0,
nullptr);
v59.origin = (cocos2d::CCPoint)&v60;
v60 = 0;
v61 = 1;
v62 = 15;
LOWORD(v60) = 32;
v50 = a1->m_brightnessLabel->getPosition_0(a1->m_brightnessLabel);
cocos2d::CCPoint::operator+(v50, &v57);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, 1.0);
GameToolbox::createToggleButton(
(const char *)&v60,
(cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::onToggleVConst,
a1->m_hsv.absoluteBrightness,
v41,
(struct cocos2d::CCPoint)&v57,
a1,
a1,
0.60000002,
0.40000001,
150.0,
v51,
(const char *)&qword_14052A4D8,
1,
0,
nullptr);
if ( a1->m_hsv.h == -0.001 )
{
ConfigureHSVWidget::onResetHSV(a1, nullptr);
if ( !a1->m_addInputs )
{
a1->m_hueLabel->setString(&a1->m_hueLabel->cocos2d::CCLabelProtocol, "Hue: Mixed");
a1->m_saturationLabel->setString(&a1->m_saturationLabel->cocos2d::CCLabelProtocol, "Saturation: Mixed");
a1->m_brightnessLabel->setString(&a1->m_brightnessLabel->cocos2d::CCLabelProtocol, "Brightness: Mixed");
}
a1->m_mixed = 1;
}
else
{
ConfigureHSVWidget::updateLabels(a1);
}
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_resetBtn_001.png");
v53 = CCMenuItemSpriteExtra::create(v52, nullptr, a1, (cocos2d::SEL_MenuHandler *)ConfigureHSVWidget::onResetHSV);
v41->addChild_1(v41, v53);
v54 = v53->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v59.origin, 119.0, 64.0);
v55 = cocos2d::CCNode::convertToNodeSpace(v41, (const struct cocos2d::CCPoint *)&v58);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v54->setPosition_0)(v53, v55);
ConfigureHSVWidget::updateSliders(a1);
a1->m_updating = 0;
return 1;
}
return result;
}