//
// HSVLiveOverlay::createHSVWidget from 0x56442c to 0x564520 (244 bytes)
//
// 2 xrefs:
// > HSVLiveOverlay::init @ 0x5647d2
// > HSVLiveOverlay::onSelectTab @ 0x564948
//
// 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
//
void HSVLiveOverlay::createHSVWidget(HSVLiveOverlay *a1, int a2)
{
int v3; // r2
ConfigureHSVWidget *m_widget; // r0
unsigned int v6; // r6
ButtonSprite *v7; // r0
ButtonSprite *v8; // r8
const char *v9; // r1
cocos2d::CCDirector *v10; // r0
HSVWidgetDelegate *v11; // r4
ConfigureHSVWidget *v12; // r0
ConfigureHSVWidget_vtbl *v13; // r3
HSVWidgetDelegate_vtbl *v14; // r6
void (__fastcall *v15)(HSVWidgetDelegate_vtbl *, cocos2d::CCPoint *); // r8
cocos2d::CCSize v16; // [sp+Ch] [bp-24h] BYREF
cocos2d::CCPoint v17; // [sp+14h] [bp-1Ch] BYREF
cocos2d::ccHSVValue v18; // [sp+1Ch] [bp-14h] BYREF
int v19; // [sp+2Ch] [bp-4h]
v3 = _stack_chk_guard;
a1->m_activeTab = a2;
v19 = v3;
if ( a1->m_unkArray )
{
v6 = 0;
while ( v6 < cocos2d::CCArray::count(a1->m_unkArray) )
{
v7 = (ButtonSprite *)cocos2d::CCArray::objectAtIndex(a1->m_unkArray, v6++);
v8 = v7;
if ( v7->getTag(v7) == a2 )
v9 = "GJ_button_01.png";
else
v9 = "GJ_button_04.png";
ButtonSprite::updateBGImage(v8, v9);
}
}
m_widget = a1->m_widget;
if ( m_widget )
{
m_widget->removeMeAndCleanup(m_widget);
a1->m_widget = nullptr;
}
v10 = cocos2d::CCDirector::sharedDirector();
v11 = &a1->HSVWidgetDelegate;
cocos2d::CCDirector::getWinSize(&v16, v10);
ConfigureHSVWidget::getHSV(&v18, (GameObject *)v11[1].__vftable, (cocos2d::CCArray *)v11[2].__vftable, a2);
v12 = ConfigureHSVWidget::create(v18, 0, 0);
v13 = v12->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v11[7].__vftable = (HSVWidgetDelegate_vtbl *)v12;
v13->setTag(v12, a2);
(*((void (__fastcall **)(HSVWidgetDelegate_vtbl *, HSVWidgetDelegate_vtbl *))v11[-10].hsvPopupClosed + 55))(
v11[-10].__vftable,
v11[7].__vftable);
v14 = v11[7].__vftable;
v15 = *((void (__fastcall **)(HSVWidgetDelegate_vtbl *, cocos2d::CCPoint *))v14->hsvPopupClosed + 23);
cocos2d::CCPoint::CCPoint(&v17, 157.0, 163.0);
v15(v14, &v17);
(*((void (__fastcall **)(HSVWidgetDelegate_vtbl *, int))v11[7].hsvPopupClosed + 20))(v11[7].__vftable, 1058642330);
v11[7].__vftable[39].hsvPopupClosed = (void (__fastcall *)(HSVWidgetDelegate *__hidden, HSVWidgetPopup *, cocos2d::ccHSVValue))v11;
}