//
// ColorSelectLiveOverlay::init from 0x90b308 to 0x90c0bc (3508 bytes)
//
// 2 xrefs:
// > ColorSelectLiveOverlay::create @ 0x90c200
// > ??> @ 0xbeff8
//
// 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 ColorSelectLiveOverlay::init(ColorSelectLiveOverlay *a1, ColorAction *a2, ColorAction *a3, EffectGameObject *a4)
{
cocos2d::CCArray *v7; // x0
cocos2d::CCArray *v8; // x0
cocos2d::CCDirector *v9; // x0
cocos2d::CCSprite *v10; // x28
cocos2d::CCSprite *v11; // x0
cocos2d::CCLayer *m_mainLayer; // x2
cocos2d::CCSprite *v13; // x27
cocos2d::CCSprite *v14; // x0
cocos2d::CCLayer *v15; // x2
cocos2d::CCSprite *v16; // x25
void (__fastcall *v17)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCSprite *v18; // x0
cocos2d::CCLayer *v19; // x2
cocos2d::CCSprite *m_saturationSprite; // x24
void (__fastcall *v21)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *m_valueSprite; // x24
void (__fastcall *v23)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *m_opacitySprite; // x24
void (__fastcall *v25)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
Slider *v26; // x0
__int64 v27; // x0
SliderThumb *Thumb; // x0
Slider *v29; // x0
const cocos2d::CCPoint *v30; // x0
SliderThumb *v31; // x0
Slider *v32; // x0
const cocos2d::CCPoint *v33; // x0
SliderThumb *v34; // x0
Slider *v35; // x0
Slider *m_opacitySlider; // x24
void (__fastcall *v37)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
const cocos2d::CCPoint *v38; // x0
SliderThumb *v39; // x0
cocos2d::CCNode *v40; // x24
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x25
void (__fastcall *v42)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
const cocos2d::CCPoint *v43; // x26
cocos2d::CCSprite *v44; // x0
cocos2d::CCSprite_vtbl *v45; // x1
cocos2d::CCSprite *m_colorSprite; // x26
void (__fastcall *v47)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCSprite *v48; // x0
cocos2d::CCSprite_vtbl *v49; // x1
cocos2d::CCSprite *m_oldColorSprite; // x25
void (__fastcall *v51)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
const cocos2d::CCPoint *v52; // x27
cocos2d::CCLabelBMFont *v53; // x0
cocos2d::CCLabelBMFont_vtbl *v54; // x1
cocos2d::CCLabelBMFont *m_colorLabel; // x26
void (__fastcall *v56)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCSprite *v57; // x26
CCMenuItemSpriteExtra *v58; // x0
cocos2d::CCMenu *v59; // x0
cocos2d::CCMenu *m_buttonMenu; // x26
cocos2d::CCNode *v61; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v63)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
__int64 v64; // x27
ColorAction *m_detailColorAction; // x0
cocos2d::CCArray *v66; // x0
const char *v67; // x6
cocos2d::CCNode *v68; // x26
CCMenuItemSpriteExtra *v69; // x24
const char *v70; // x6
cocos2d::CCNode *v71; // x26
CCMenuItemSpriteExtra *v72; // x22
void (__fastcall *v73)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
void (__fastcall *v74)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
__int64 v75; // x24
Slider *m_hueSlider; // [xsp+78h] [xbp+78h]
Slider *m_saturationSlider; // [xsp+78h] [xbp+78h]
Slider *m_valueSlider; // [xsp+78h] [xbp+78h]
cocos2d::CCMenu *v80; // [xsp+78h] [xbp+78h]
cocos2d::CCObject *setPosition; // [xsp+80h] [xbp+80h]
cocos2d::CCObject *v83; // [xsp+80h] [xbp+80h]
cocos2d::CCObject *v84; // [xsp+80h] [xbp+80h]
cocos2d::CCObject *v85; // [xsp+80h] [xbp+80h]
cocos2d::CCObject *v86; // [xsp+80h] [xbp+80h]
cocos2d::CCLayer *v87; // [xsp+80h] [xbp+80h]
unsigned __int8 v88; // [xsp+8Fh] [xbp+8Fh]
cocos2d::CCPoint v89; // [xsp+98h] [xbp+98h] BYREF
_BYTE v90[8]; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCPoint v91; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v92; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCRect v93; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCPoint v94; // 0:kr08_8.8
cocos2d::CCPoint v95; // 0:kr10_8.8
cocos2d::CCPoint v96; // 0:kr20_8.8
cocos2d::SEL_MenuHandler v97; // 0:x2.16
cocos2d::SEL_MenuHandler v98; // 0:x2.16
cocos2d::SEL_MenuHandler v99; // 0:x2.16
cocos2d::CCRect v100; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v88 = FLAlertLayer::init(a1, 0);
v7 = (cocos2d::CCArray *)v88;
if ( !v88 )
return v88;
if ( a2 )
{
a1->m_baseColorAction = a2;
cocos2d::CCObject::retain(a2);
if ( !a3 )
goto LABEL_5;
}
else if ( !a3 )
{
if ( a4 )
{
a1->m_effectGameObject = a4;
cocos2d::CCObject::retain(a4);
}
goto LABEL_5;
}
a1->m_detailColorAction = a3;
cocos2d::CCObject::retain(a3);
LABEL_5:
a1->m_updateColor = 1;
a1->m_noElasticity = 1;
v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);
a1->m_barSprites = v8;
cocos2d::CCObject::retain(v8);
a1->m_hue = 1.0;
a1->m_saturation = 1.0;
a1->m_value = 1.0;
ColorSelectLiveOverlay::determineStartValues(a1);
a1->setTouchEnabled(a1, 0);
a1->setKeypadEnabled(a1, 0);
a1->m_disableTextDelegate = 1;
v9 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v9);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("hueBar.png");
a1->m_mainLayer->addChild(a1->m_mainLayer, v10);
cocos2d::CCArray::addObject(a1->m_barSprites, v10);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("saturationBarBottom.png");
m_mainLayer = a1->m_mainLayer;
a1->m_saturationSprite = v11;
m_mainLayer->addChild(m_mainLayer, v11);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_saturationSprite);
v13 = cocos2d::CCSprite::createWithSpriteFrameName("saturationBarTop.png");
a1->m_saturationSprite->addChild_0(a1->m_saturationSprite, v13, 1);
setPosition = (cocos2d::CCObject *)v13->setPosition;
v94 = cocos2d::CCNode::convertToNodeSpace(a1->m_saturationSprite, &stru_1243220);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCRect *, float, float))setPosition)(v13, &v93, v94.x, v94.y);
v14 = cocos2d::CCSprite::createWithSpriteFrameName("saturationBarBottom.png");
v15 = a1->m_mainLayer;
a1->m_valueSprite = v14;
v15->addChild(v15, v14);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_valueSprite);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("saturationBarTop.png");
v16->setColor(v16, (const cocos2d::ccColor3B *)&unk_EF3070);
a1->m_valueSprite->addChild_0(a1->m_valueSprite, v16, 1);
v17 = v16->setPosition;
v95 = cocos2d::CCNode::convertToNodeSpace(a1->m_valueSprite, &stru_1243220);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCRect *, float, float))v17)(v16, &v93, v95.x, v95.y);
v18 = cocos2d::CCSprite::createWithSpriteFrameName("saturationBarTop.png");
v19 = a1->m_mainLayer;
a1->m_opacitySprite = v18;
v19->addChild(v19, v18);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_opacitySprite);
v10->setScaleX(v10, 14.0 / v10->m_obRect.size.width);
v10->setScaleY(v10, 110.0 / v10->m_obRect.size.height);
a1->m_saturationSprite->setScaleX(a1->m_saturationSprite, 14.0 / a1->m_saturationSprite->m_obRect.size.width);
a1->m_saturationSprite->setScaleY(a1->m_saturationSprite, 110.0 / a1->m_saturationSprite->m_obRect.size.height);
a1->m_valueSprite->setScaleX(a1->m_valueSprite, 14.0 / a1->m_valueSprite->m_obRect.size.width);
a1->m_valueSprite->setScaleY(a1->m_valueSprite, 110.0 / a1->m_valueSprite->m_obRect.size.height);
a1->m_opacitySprite->setScaleX(a1->m_opacitySprite, 14.0 / a1->m_opacitySprite->m_obRect.size.width);
a1->m_opacitySprite->setScaleY(a1->m_opacitySprite, -(float)(110.0 / a1->m_opacitySprite->m_obRect.size.height));
cocos2d::CCPoint::CCPoint(&v89, 90.0, 180.0);
v10->setPosition(v10, &v89);
m_saturationSprite = a1->m_saturationSprite;
v21 = m_saturationSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v93.origin, 34.0, 0.0);
cocos2d::CCPoint::operator+(&v92, &v89, &v93);
v21(m_saturationSprite, &v92);
m_valueSprite = a1->m_valueSprite;
v23 = m_valueSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v93.origin, 68.0, 0.0);
cocos2d::CCPoint::operator+(&v92, &v89, &v93);
v23(m_valueSprite, &v92);
m_opacitySprite = a1->m_opacitySprite;
v25 = m_opacitySprite->setPosition;
cocos2d::CCPoint::CCPoint(&v93.origin, 102.0, 0.0);
cocos2d::CCPoint::operator+(&v92, &v89, &v93);
v25(m_opacitySprite, &v92);
v26 = (Slider *)Slider::create(
a1,
(void (__cdecl *)(cocos2d::CCObject *))ColorSelectLiveOverlay::sliderChanged,
0,
"sliderBar.png",
"slidergroove_02.png",
"GJ_colorThumbBtn.png",
"GJ_colorThumbSBtn.png",
1.0);
a1->m_hueSlider = v26;
Slider::setBarVisibility(v26, 0);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_hueSlider);
m_hueSlider = a1->m_hueSlider;
v83 = (cocos2d::CCObject *)m_hueSlider->setPosition;
v27 = (__int64)v10->getPosition(v10);
((void (__fastcall *)(Slider *, __int64))v83)(m_hueSlider, v27);
Slider::setRotated(a1->m_hueSlider, 1);
Slider::setMaxOffset(a1->m_hueSlider, 110.0);
Slider::hideGroove(a1->m_hueSlider, 1);
Thumb = Slider::getThumb(a1->m_hueSlider);
Thumb->setTag(Thumb, 1);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_hueSlider);
v29 = (Slider *)Slider::create(
a1,
(void (__cdecl *)(cocos2d::CCObject *))ColorSelectLiveOverlay::sliderChanged,
0,
"sliderBar.png",
"slidergroove_02.png",
"GJ_colorThumbBtn.png",
"GJ_colorThumbSBtn.png",
1.0);
a1->m_saturationSlider = v29;
Slider::setBarVisibility(v29, 0);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_saturationSlider);
m_saturationSlider = a1->m_saturationSlider;
v84 = (cocos2d::CCObject *)m_saturationSlider->setPosition;
v30 = a1->m_saturationSprite->getPosition(a1->m_saturationSprite);
((void (__fastcall *)(Slider *, const cocos2d::CCPoint *))v84)(m_saturationSlider, v30);
Slider::setRotated(a1->m_saturationSlider, 1);
Slider::setMaxOffset(a1->m_saturationSlider, 110.0);
Slider::hideGroove(a1->m_saturationSlider, 1);
v31 = Slider::getThumb(a1->m_saturationSlider);
v31->setTag(v31, 2);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_saturationSlider);
v32 = (Slider *)Slider::create(
a1,
(void (__cdecl *)(cocos2d::CCObject *))ColorSelectLiveOverlay::sliderChanged,
0,
"sliderBar.png",
"slidergroove_02.png",
"GJ_colorThumbBtn.png",
"GJ_colorThumbSBtn.png",
1.0);
a1->m_valueSlider = v32;
Slider::setBarVisibility(v32, 0);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_valueSlider);
m_valueSlider = a1->m_valueSlider;
v85 = (cocos2d::CCObject *)m_valueSlider->setPosition;
v33 = a1->m_valueSprite->getPosition(a1->m_valueSprite);
((void (__fastcall *)(Slider *, const cocos2d::CCPoint *))v85)(m_valueSlider, v33);
Slider::setRotated(a1->m_valueSlider, 1);
Slider::setMaxOffset(a1->m_valueSlider, 110.0);
Slider::hideGroove(a1->m_valueSlider, 1);
v34 = Slider::getThumb(a1->m_valueSlider);
v34->setTag(v34, 3);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_valueSlider);
v35 = (Slider *)Slider::create(
a1,
(void (__cdecl *)(cocos2d::CCObject *))ColorSelectLiveOverlay::sliderChanged,
0,
"sliderBar.png",
"slidergroove_02.png",
"GJ_colorThumbBtn.png",
"GJ_colorThumbSBtn.png",
1.0);
a1->m_opacitySlider = v35;
Slider::setBarVisibility(v35, 0);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_opacitySlider);
m_opacitySlider = a1->m_opacitySlider;
v37 = m_opacitySlider->setPosition;
v38 = a1->m_opacitySprite->getPosition(a1->m_opacitySprite);
v37(m_opacitySlider, v38);
Slider::setRotated(a1->m_opacitySlider, 1);
Slider::setMaxOffset(a1->m_opacitySlider, 110.0);
Slider::hideGroove(a1->m_opacitySlider, 1);
v39 = Slider::getThumb(a1->m_opacitySlider);
v39->setTag(v39, 4);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_opacitySlider);
cocos2d::CCRect::CCRect(&v93, 0.0, 0.0, 80.0, 80.0);
v40 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02_001.png",
(const char *)&v93,
v100);
setContentSize = v40->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v93, 130.0, 130.0);
setContentSize(v40, (const cocos2d::CCSize *)&v93);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v40, -1);
v42 = v40->setPosition;
v43 = a1->m_saturationSlider->getPosition(a1->m_saturationSlider);
cocos2d::CCPoint::CCPoint(&v93.origin, 17.0, 0.0);
cocos2d::CCPoint::operator+(&v92, v43, &v93);
v42(v40, &v92);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v40->__vftable[1].~CCNode_0)(v40, 125);
v44 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
v45 = v44->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_colorSprite = v44;
((void (__fastcall *)(float))v45->setScale)(0.5);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_colorSprite, 5);
m_colorSprite = a1->m_colorSprite;
v47 = m_colorSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v93.origin, 130.0, -40.0);
cocos2d::CCPoint::operator+(&v92, &v89, &v93);
v47(m_colorSprite, &v92);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_colorSprite);
v48 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
v49 = v48->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_oldColorSprite = v48;
((void (__fastcall *)(float))v49->setScale)(0.5);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_oldColorSprite, 5);
m_oldColorSprite = a1->m_oldColorSprite;
v51 = m_oldColorSprite->setPosition;
v52 = a1->m_colorSprite->getPosition(a1->m_colorSprite);
cocos2d::CCPoint::CCPoint(&v93.origin, 0.0, -15.0);
cocos2d::CCPoint::operator+(&v92, v52, &v93);
v51(m_oldColorSprite, &v92);
cocos2d::CCArray::addObject(a1->m_barSprites, a1->m_oldColorSprite);
a1->m_colorSprite->setColor(a1->m_colorSprite, &a1->m_targetColor);
a1->m_oldColorSprite->setColor(a1->m_oldColorSprite, &a1->m_targetColor);
v53 = cocos2d::CCLabelBMFont::create();
v54 = v53->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_colorLabel = v53;
((void (__fastcall *)(float))v54->setScale)(0.5);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_colorLabel);
m_colorLabel = a1->m_colorLabel;
v56 = m_colorLabel->setPosition;
v86 = (cocos2d::CCObject *)v40->getPosition(v40);
cocos2d::CCPoint::CCPoint(&v93.origin, 0.0, 75.0);
cocos2d::CCPoint::operator+(&v92, v86, &v93);
v56(m_colorLabel, &v92);
v57 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v57->setScale(v57, 0.5);
v97.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v97.adj = (size_t)ColorSelectLiveOverlay::closeColorSelect;
v58 = CCMenuItemSpriteExtra::create(v57, nullptr, v97);
v59 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v58, nullptr);
a1->m_buttonMenu = v59;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v59, 10);
m_buttonMenu = a1->m_buttonMenu;
v61 = v40;
getPosition = v40->getPosition;
v63 = m_buttonMenu->setPosition;
v64 = (__int64)getPosition(v61);
cocos2d::CCPoint::CCPoint(&v93.origin, -74.0, 65.0);
cocos2d::CCPoint::operator+(&v92, v64, &v93);
v63(m_buttonMenu, &v92);
ColorSelectLiveOverlay::selectColor(a1, (cocos2d::ccColor3B)*(_QWORD *)&a1->m_targetColor.r);
if ( a1->m_baseColorAction )
{
m_detailColorAction = a1->m_detailColorAction;
if ( m_detailColorAction )
{
v66 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)m_detailColorAction);
a1->m_12buttons = v66;
cocos2d::CCObject::retain(v66);
v68 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"1",
(const char *)&dword_14,
0,
1,
0.5,
"bigFont.fnt",
"GJ_button_01.png",
v67,
30.0);
v68->setScale(v68, 0.6);
v98.adj = (size_t)ColorSelectLiveOverlay::onSelectTab;
v98.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v69 = CCMenuItemSpriteExtra::create(v68, nullptr, v98);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v69);
v69->setTag(v69, 1);
v68->setTag(v68, 1);
cocos2d::CCArray::addObject(a1->m_12buttons, v68);
v71 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)&byte_F78BA8,
(const char *)&dword_14,
0,
1,
0.5,
"bigFont.fnt",
"GJ_button_04.png",
v70,
30.0);
v71->setScale(v71, 0.6);
v99.adj = (size_t)ColorSelectLiveOverlay::onSelectTab;
v99.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v72 = CCMenuItemSpriteExtra::create(v71, nullptr, v99);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v72);
v72->setTag(v72, 2);
v71->setTag(v71, 2);
cocos2d::CCArray::addObject(a1->m_12buttons, v71);
v80 = a1->m_buttonMenu;
v73 = v69->setPosition;
v87 = a1->m_mainLayer;
cocos2d::CCPoint::CCPoint(&v93.origin, 130.0, 50.0);
cocos2d::CCPoint::operator+(&v92, &v89, &v93);
cocos2d::CCNode::convertToWorldSpace(v87, &v92);
v96 = cocos2d::CCNode::convertToNodeSpace(v80, &v91);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _BYTE *, float, float))v73)(v69, v90, v96.x, v96.y);
v74 = v72->setPosition;
v75 = (__int64)v69->getPosition(v69);
cocos2d::CCPoint::CCPoint(&v93.origin, 0.0, -24.0);
cocos2d::CCPoint::operator+(&v92, v75, &v93);
v74(v72, &v92);
}
}
ColorSelectLiveOverlay::updateColorLabel(a1);
a1->m_disableTextDelegate = 0;
a1->m_updateColor = 0;
return v88;
}