//
// ConfigureHSVWidget::init from 0x1000ff0e8 to 0x1000ff8d0 (2024 bytes)
//
// 1 xrefs:
// > ConfigureHSVWidget::create @ 0x1000ff02c
//
// 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 ConfigureHSVWidget::init(ConfigureHSVWidget *a1, cocos2d::ccHSVValue a2, bool a3, bool a4)
{
__int64 v6; // x23
__int64 v7; // x24
_BOOL4 v9; // w20
cocos2d::CCDictionary *v10; // x0
cocos2d::extension::CCScale9Sprite *v11; // x21
cocos2d::CCLabelBMFont *v12; // x0
__n128 v13; // q0
cocos2d::CCLabelBMFont *m_hueLabel; // x21
__n128 v15; // q1
float32x2_t *v16; // x21
__n128 v17; // q0
__n128 v18; // q1
Slider *v19; // x0
Slider *m_hueSlider; // x21
float32x2_t *v21; // x22
__n128 v22; // q0
__n128 v23; // q1
double v24; // d0
SliderThumb *Thumb; // x0
cocos2d::CCLabelBMFont *v26; // x0
cocos2d::CCLabelBMFont *m_saturationLabel; // x21
__n128 v28; // q1
__n128 v29; // q0
float32x2_t *v30; // x21
__n128 v31; // q0
__n128 v32; // q1
Slider *v33; // x0
Slider *m_saturationSlider; // x21
float32x2_t *v35; // x22
__n128 v36; // q0
__n128 v37; // q1
double v38; // d0
SliderThumb *v39; // x0
cocos2d::CCLabelBMFont *v40; // x0
cocos2d::CCLabelBMFont *m_brightnessLabel; // x22
__n128 v42; // q1
__n128 v43; // q0
float32x2_t *v44; // x22
__n128 v45; // q0
__n128 v46; // q1
Slider *v47; // x0
Slider *m_brightnessSlider; // x22
float32x2_t *v49; // x23
__n128 v50; // q0
__n128 v51; // q1
double v52; // d0
SliderThumb *v53; // x0
cocos2d::CCMenu *v54; // x22
cocos2d::CCDirector *v55; // x0
cocos2d::CCTouchDispatcher *v56; // x0
__n128 v57; // q0
__n128 v58; // q1
cocos2d::CCDirector *v59; // x0
__int64 v60; // x0
bool absoluteSaturation; // w23
float32x2_t *v62; // x0
__n128 v63; // q0
__n128 v64; // q1
bool absoluteBrightness; // w23
float32x2_t *v66; // x0
__n128 v67; // q0
__n128 v68; // q1
cocos2d::CCObject *v69; // x1
cocos2d::CCSprite *v70; // x0
CCMenuItemSpriteExtra *v71; // x21
__n128 v72; // q0
__n128 v73; // q1
void *v75[2]; // [xsp+20h] [xbp-90h] BYREF
char v76; // [xsp+37h] [xbp-79h]
cocos2d::CCPoint v77; // [xsp+38h] [xbp-78h] BYREF
void *__p[2]; // [xsp+40h] [xbp-70h] BYREF
char v79; // [xsp+57h] [xbp-59h]
cocos2d::CCPoint v80; // [xsp+58h] [xbp-58h] BYREF
float32x2_t v81[2]; // [xsp+60h] [xbp-50h] BYREF
cocos2d::CCPoint v82; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v83; // 0:x1.16
cocos2d::SEL_MenuHandler v84; // 0:x1.16
cocos2d::SEL_MenuHandler v85; // 0:x1.16
cocos2d::SEL_MenuHandler v86; // 0:x3.16
cocos2d::CCPoint v87; // 0:s0.4,4:s1.4
cocos2d::CCPoint v88; // 0:s0.4,4:s1.4
cocos2d::CCPoint v89; // 0:s0.4,4:s1.4
cocos2d::CCRect v90; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v6 = *(_QWORD *)&a2.v;
v7 = *(_QWORD *)&a2.h;
v9 = cocos2d::CCNode::init(a1);
if ( v9 )
{
a1->m_updating = 1;
v10 = cocos2d::CCDictionary::create();
a1->m_inputs = v10;
cocos2d::CCObject::retain(v10);
*(_QWORD *)&a1->m_hsv.h = v7;
*(_QWORD *)&a1->m_hsv.v = v6;
a1->m_addInputs = a4;
if ( !a3 )
{
sub_100022990((float *)v81, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("square02_001.png", v90);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v11->setOpacity)(v11, 75);
sub_100022988((float *)v81, 270.0, 160.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, float32x2_t *))v11->setContentSize)(v11, v81);
((void (__fastcall *)(ConfigureHSVWidget *, cocos2d::extension::CCScale9Sprite *, __int64))a1->addChild_0)(
a1,
v11,
0xFFFFFFFFLL);
}
v12 = cocos2d::CCLabelBMFont::create_1("Hue:", "bigFont.fnt");
a1->m_hueLabel = v12;
((void (__fastcall *)(ConfigureHSVWidget *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v12);
v13 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_hueLabel->setScale)(a1->m_hueLabel, 0.5);
m_hueLabel = a1->m_hueLabel;
v15.n128_u32[0] = 1115947008;
v13.n128_u32[0] = 0;
sub_100022980(v13, v15, v81);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))m_hueLabel->setPosition)(m_hueLabel, v81);
if ( a1->m_addInputs )
{
v16 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_hueLabel->getPosition)(a1->m_hueLabel);
v17.n128_u32[0] = -10.0;
v18.n128_u32[0] = 0;
sub_100022980(v17, v18, &v80);
v87.x = sub_1000229DC(v16, (float32x2_t *)&v80, v81).f32[0];
ConfigureHSVWidget::createTextInputNode(a1, v87, (int)v81);
}
v83.ptr = (void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::sliderChanged;
v83.adj = 0;
v19 = Slider::create_2(a1, v83);
a1->m_hueSlider = v19;
Slider::setBarVisibility(v19, 0);
((void (__fastcall *)(ConfigureHSVWidget *, Slider *))a1->addChild)(a1, a1->m_hueSlider);
m_hueSlider = a1->m_hueSlider;
v21 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_hueLabel->getPosition)(a1->m_hueLabel);
v22.n128_u32[0] = 0;
v23.n128_u32[0] = -25.0;
sub_100022980(v22, v23, &v80);
*(float32x2_t *)&v24 = sub_1000229DC(v21, (float32x2_t *)&v80, v81);
((void (__fastcall *)(Slider *, float32x2_t *, double))m_hueSlider->setPosition)(m_hueSlider, v81, v24);
Thumb = Slider::getThumb(a1->m_hueSlider);
((void (__fastcall *)(SliderThumb *, __int64))Thumb->setTag)(Thumb, 1);
v26 = cocos2d::CCLabelBMFont::create_1("Saturation:", "bigFont.fnt");
a1->m_saturationLabel = v26;
((void (__fastcall *)(ConfigureHSVWidget *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v26);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_saturationLabel->setScale)(a1->m_saturationLabel, 0.5);
m_saturationLabel = a1->m_saturationLabel;
v28.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_hueLabel->getPosition)(a1->m_hueLabel)
+ 4)
+ -50.0;
v29.n128_u32[0] = 0;
sub_100022980(v29, v28, v81);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))m_saturationLabel->setPosition)(
m_saturationLabel,
v81);
if ( a1->m_addInputs )
{
v30 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_saturationLabel->getPosition)(a1->m_saturationLabel);
v31.n128_u32[0] = 22.0;
v32.n128_u32[0] = 0;
sub_100022980(v31, v32, &v80);
v88.x = sub_1000229DC(v30, (float32x2_t *)&v80, v81).f32[0];
ConfigureHSVWidget::createTextInputNode(a1, v88, (int)v81);
}
v84.ptr = (void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::sliderChanged;
v84.adj = 0;
v33 = Slider::create_2(a1, v84);
a1->m_saturationSlider = v33;
Slider::setBarVisibility(v33, 0);
((void (__fastcall *)(ConfigureHSVWidget *, Slider *))a1->addChild)(a1, a1->m_saturationSlider);
m_saturationSlider = a1->m_saturationSlider;
v35 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_saturationLabel->getPosition)(a1->m_saturationLabel);
v36.n128_u32[0] = 0;
v37.n128_u32[0] = -25.0;
sub_100022980(v36, v37, &v80);
*(float32x2_t *)&v38 = sub_1000229DC(v35, (float32x2_t *)&v80, v81);
((void (__fastcall *)(Slider *, float32x2_t *, double))m_saturationSlider->setPosition)(
m_saturationSlider,
v81,
v38);
v39 = Slider::getThumb(a1->m_saturationSlider);
((void (__fastcall *)(SliderThumb *, __int64))v39->setTag)(v39, 2);
v40 = cocos2d::CCLabelBMFont::create_1("Brightness:", "bigFont.fnt");
a1->m_brightnessLabel = v40;
((void (__fastcall *)(ConfigureHSVWidget *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v40);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_brightnessLabel->setScale)(a1->m_brightnessLabel, 0.5);
m_brightnessLabel = a1->m_brightnessLabel;
v42.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_saturationLabel->getPosition)(a1->m_saturationLabel)
+ 4)
+ -50.0;
v43.n128_u32[0] = 0;
sub_100022980(v43, v42, v81);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))m_brightnessLabel->setPosition)(
m_brightnessLabel,
v81);
if ( a1->m_addInputs )
{
v44 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_brightnessLabel->getPosition)(a1->m_brightnessLabel);
v45.n128_u32[0] = 22.0;
v46.n128_u32[0] = 0;
sub_100022980(v45, v46, &v80);
v89.x = sub_1000229DC(v44, (float32x2_t *)&v80, v81).f32[0];
ConfigureHSVWidget::createTextInputNode(a1, v89, (int)v81);
}
v85.ptr = (void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::sliderChanged;
v85.adj = 0;
v47 = Slider::create_2(a1, v85);
a1->m_brightnessSlider = v47;
Slider::setBarVisibility(v47, 0);
((void (__fastcall *)(ConfigureHSVWidget *, Slider *))a1->addChild)(a1, a1->m_brightnessSlider);
m_brightnessSlider = a1->m_brightnessSlider;
v49 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_brightnessLabel->getPosition)(a1->m_brightnessLabel);
v50.n128_u32[0] = 0;
v51.n128_u32[0] = -25.0;
sub_100022980(v50, v51, &v80);
*(float32x2_t *)&v52 = sub_1000229DC(v49, (float32x2_t *)&v80, v81);
((void (__fastcall *)(Slider *, float32x2_t *, double))m_brightnessSlider->setPosition)(
m_brightnessSlider,
v81,
v52);
v53 = Slider::getThumb(a1->m_brightnessSlider);
((void (__fastcall *)(SliderThumb *, __int64))v53->setTag)(v53, 3);
v54 = cocos2d::CCMenu::create();
((void (__fastcall *)(ConfigureHSVWidget *, cocos2d::CCMenu *))a1->addChild)(a1, v54);
v55 = cocos2d::CCDirector::sharedDirector();
v56 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v55->getTouchDispatcher)(v55);
if ( cocos2d::CCTouchDispatcher::isUsingForcePrio(v56) )
{
v59 = cocos2d::CCDirector::sharedDirector();
v60 = ((__int64 (__fastcall *)(cocos2d::CCDirector *))v59->getTouchDispatcher)(v59);
v57 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, _QWORD))v54->setTouchPriority)(
v54,
(unsigned int)(*(_DWORD *)(v60 + 124) - 1));
}
v57.n128_u32[0] = -1027735552;
v58.n128_u32[0] = 0;
sub_100022980(v57, v58, v81);
sub_100009900(__p, " ");
absoluteSaturation = a1->m_hsv.absoluteSaturation;
v62 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_saturationLabel->getPosition)(a1->m_saturationLabel);
v63.n128_f32[1] = sub_1000229DC(v62, v81, (float32x2_t *)&v80).f32[1];
v63.n128_u32[0] = 0;
v64.n128_u32[0] = 1.0;
sub_100022980(v63, v64, &v77);
GameToolbox::createToggleButton(
(const char *)__p,
(void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::onToggleSConst,
0,
absoluteSaturation,
v54,
&v80,
a1,
a1,
0.6,
0.4,
150.0,
(float *)&v77,
"bigFont.fnt",
1,
0,
0);
if ( v79 < 0 )
operator delete(__p[0]);
sub_100009900(v75, " ");
absoluteBrightness = a1->m_hsv.absoluteBrightness;
v66 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_brightnessLabel->getPosition)(a1->m_brightnessLabel);
v67.n128_f32[1] = sub_1000229DC(v66, v81, (float32x2_t *)&v80).f32[1];
v67.n128_u32[0] = 0;
v68.n128_u32[0] = 1.0;
sub_100022980(v67, v68, &v77);
GameToolbox::createToggleButton(
(const char *)v75,
(void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::onToggleVConst,
0,
absoluteBrightness,
v54,
&v80,
a1,
a1,
0.6,
0.4,
150.0,
(float *)&v77,
"bigFont.fnt",
1,
0,
0);
if ( v76 < 0 )
operator delete(v75[0]);
if ( a1->m_hsv.h == -0.001 )
{
ConfigureHSVWidget::onResetHSV(a1, v69);
if ( !a1->m_addInputs )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_hueLabel->setString)(
a1->m_hueLabel,
"Hue: Mixed");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_saturationLabel->setString)(
a1->m_saturationLabel,
"Saturation: Mixed");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_brightnessLabel->setString)(
a1->m_brightnessLabel,
"Brightness: Mixed");
}
a1->m_mixed = 1;
}
else
{
ConfigureHSVWidget::updateLabels(a1);
}
v70 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_resetBtn_001.png");
v86.ptr = (void (__cdecl *)(cocos2d::CCObject *))ConfigureHSVWidget::onResetHSV;
v86.adj = 0;
v71 = CCMenuItemSpriteExtra::create(v70, nullptr, a1, v86);
v72 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v54->addChild)(v54, v71);
v72.n128_u32[0] = 1122893824;
v73.n128_u32[0] = 1115684864;
sub_100022980(v72, v73, &v77);
v82 = cocos2d::CCNode::convertToNodeSpace(v54, &v77);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))v71->setPosition)(
v71,
&v80,
v82.x,
v82.y);
ConfigureHSVWidget::updateSliders(a1);
a1->m_updating = 0;
}
return v9;
}