//
// HSVLiveOverlay::init from 0x10026a950 to 0x10026ad31 (993 bytes)
//
// 1 xrefs:
// > HSVLiveOverlay::create @ 0x10026a908
//
// 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 HSVLiveOverlay::init(HSVLiveOverlay *a1, GameObject *a2, cocos2d::CCArray *a3)
{
HSVLiveOverlay_vtbl *v4; // r14
bool result; // al
__int64 v6; // rax
cocos2d::CCDirector *v7; // rsi
cocos2d::CCArray *v8; // rax
cocos2d::CCSprite *v9; // r14
unsigned int v10; // eax
int v11; // edx
int v12; // ecx
int v13; // r8d
int v14; // r9d
cocos2d::CCMenu *v15; // rax
cocos2d::CCMenu *m_buttonMenu; // r14
int v17; // esi
cocos2d::CCArray *v18; // rax
ButtonSprite *v19; // r13
CCMenuItemSpriteExtra *v20; // r14
ButtonSprite *v21; // r13
CCMenuItemSpriteExtra *v22; // r15
__int64 v23; // r14
char v24; // [rsp+0h] [rbp-70h] BYREF
_BYTE v25[8]; // [rsp+8h] [rbp-68h] BYREF
_BYTE v26[8]; // [rsp+10h] [rbp-60h] BYREF
_BYTE v27[8]; // [rsp+18h] [rbp-58h] BYREF
cocos2d::CCMenu *v28; // [rsp+20h] [rbp-50h]
cocos2d::CCLayer *m_mainLayer; // [rsp+28h] [rbp-48h]
char v30; // [rsp+34h] [rbp-3Ch] BYREF
_BYTE v31[11]; // [rsp+3Ch] [rbp-34h] BYREF
bool v32; // [rsp+47h] [rbp-29h]
double v33; // 0:xmm0_8.8
double v34; // 0:xmm0_8.8
v4 = (HSVLiveOverlay_vtbl *)a2;
result = FLAlertLayer::init_1(a1, 0);
if ( result )
{
v32 = result;
v6 = 640;
if ( a2 || (v6 = 648, (v4 = (HSVLiveOverlay_vtbl *)a3) != nullptr) )
{
*(HSVLiveOverlay_vtbl **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6) = v4;
cocos2d::CCObject::retain((cocos2d::CCObject *)v4);
}
a1->m_noElasticity = 1;
v7 = cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v33 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v24);
v8 = (cocos2d::CCArray *)sub_10071F9E0(&v24, v7);
a1->m_controls = v8;
cocos2d::CCObject::retain(v8);
((void (__fastcall *)(HSVLiveOverlay *, _QWORD, double))a1->setTouchEnabled)(a1, 0, v33);
((void (__fastcall *)(HSVLiveOverlay *, _QWORD))a1->setKeypadEnabled)(a1, 0);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v9->setScale)(v9, 0.5);
v10 = (unsigned int)CCMenuItemSpriteExtra::create(
v9,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)HSVLiveOverlay::closeColorSelect);
v15 = (cocos2d::CCMenu *)sub_100792C50(v10, 0, v11, v12, v13, v14);
a1->m_buttonMenu = v15;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v15,
10);
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0(v31, 157.0, 163.0);
sub_10028CBE0(v26, -81.0, 48.0);
sub_10028CCE0(&v30, v31);
((void (__fastcall *)(cocos2d::CCMenu *, char *))m_buttonMenu->setPosition)(m_buttonMenu, &v30);
HSVLiveOverlay::determineStartValues(a1);
v17 = 2;
if ( a1->m_unkBool1 )
{
if ( !a1->m_unkBool2 )
goto LABEL_8;
v18 = (cocos2d::CCArray *)sub_10071F9E0(a1, 2);
a1->m_unkArray = v18;
cocos2d::CCObject::retain(v18);
v19 = ButtonSprite::create_1("1", 20, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
((void (__fastcall *)(ButtonSprite *, float))v19->setScale)(v19, 0.60000002);
v20 = CCMenuItemSpriteExtra::create(
v19,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)HSVLiveOverlay::onSelectTab);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v20);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v20->setTag)(v20, 1);
((void (__fastcall *)(ButtonSprite *, __int64))v19->setTag)(v19, 1);
sub_10071FCD0(a1->m_unkArray, v19);
v21 = ButtonSprite::create_1("2", 20, 0, 0.5, 1, "bigFont.fnt", "GJ_button_04.png", 30.0);
((void (__fastcall *)(ButtonSprite *, float))v21->setScale)(v21, 0.60000002);
v22 = CCMenuItemSpriteExtra::create(
v21,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)HSVLiveOverlay::onSelectTab);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v22);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v22->setTag)(v22, 2);
((void (__fastcall *)(ButtonSprite *, __int64))v21->setTag)(v21, 2);
sub_10071FCD0(a1->m_unkArray, v21);
v28 = a1->m_buttonMenu;
m_mainLayer = a1->m_mainLayer;
sub_10028CBE0(v27, 157.0, 163.0);
sub_10028CBE0(v25, 97.0, 36.0);
sub_10028CCE0(v26, v27);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v31, (const cocos2d::CCPoint *)m_mainLayer);
*(cocos2d::CCPoint *)&v34 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v30,
(const cocos2d::CCPoint *)v28);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))v20->setPosition)(v20, &v30, v34);
v23 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v20->getPosition)(v20);
sub_10028CBE0(v31, 0.0, -24.0);
sub_10028CCE0(&v30, v23);
((void (__fastcall *)(CCMenuItemSpriteExtra *, char *))v22->setPosition)(v22, &v30);
v17 = 2;
if ( a1->m_unkBool1 )
LABEL_8:
v17 = 1;
}
HSVLiveOverlay::createHSVWidget(a1, v17);
return v32;
}
return result;
}