//
// EditorUI::editHSV from 0x1401be410 to 0x1401be695 (645 bytes)
//
// 4 xrefs:
// > EditorUI::onEditColor @ 0x1401bdeb9
// > EditorUI::handleEditorAction @ 0x1401c37a4
// > EditorUI::checkLiveColorSelect @ 0x1401c9718
// > ??> @ 0x14091a4d4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:28:02 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall EditorUI::editHSV(_QWORD *a1)
{
__int64 v2; // rdx
int SelectedObjects; // r13d
__int64 v4; // rcx
__int64 v5; // rcx
unsigned int *v6; // rbx
__int64 v7; // rcx
__int64 *v8; // rbx
__int64 *i; // rsi
__int64 v10; // rcx
char v11; // r14
__int16 v12; // bp
__int16 v13; // r15
char v14; // r12
__int64 v15; // rbx
_QWORD *v16; // rsi
_QWORD *v18; // [rsp+70h] [rbp+8h] BYREF
__int64 v19; // [rsp+78h] [rbp+10h] BYREF
__int64 v20; // [rsp+80h] [rbp+18h] BYREF
EditorUI::closeLiveHSVSelect(a1);
EditorUI::closeLiveColorSelect((__int64)a1);
SelectedObjects = 0;
v4 = a1[196];
if ( v4 )
{
*(_BYTE *)(v4 + 1141) = 0;
GameObject::updateObjectEditorColor(v4);
}
else
{
SelectedObjects = EditorUI::getSelectedObjects(a1, v2);
v5 = a1[118];
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
v7 = *v6;
if ( (_DWORD)v7 )
{
v8 = *((__int64 **)v6 + 2);
for ( i = &v8[v7 - 1]; v8 <= i; ++v8 )
{
v10 = *v8;
if ( !*v8 )
break;
*(_BYTE *)(v10 + 1141) = 0;
GameObject::updateObjectEditorColor(v10);
}
}
}
}
v18 = nullptr;
v19 = 0;
v20 = 0;
EditorUI::getEditColorTargets((__int64)a1, (__int64 *)&v18, &v19, &v20);
v11 = -1;
v12 = -1;
if ( v18 )
{
v13 = *((_WORD *)v18 + 36);
v14 = *((_BYTE *)v18 + 74);
}
else
{
v13 = -1;
v14 = -1;
}
if ( v19 )
{
v12 = *(_WORD *)(v19 + 72);
v11 = *(_BYTE *)(v19 + 74);
}
v15 = a1[196];
v16 = operator new(0x2E8u);
v18 = v16;
FLAlertLayer::FLAlertLayer((__int64)v16);
*v16 = &HSVLiveOverlay::`vftable';
v16[40] = &HSVLiveOverlay::`vftable';
v16[41] = &HSVLiveOverlay::`vftable';
v16[42] = &HSVLiveOverlay::`vftable';
v16[43] = &HSVLiveOverlay::`vftable';
v16[44] = &HSVLiveOverlay::`vftable';
v16[51] = &HSVLiveOverlay::`vftable';
v16[54] = &HSVLiveOverlay::`vftable';
v16[68] = &HSVLiveOverlay::`vftable';
v16[83] = &HSVLiveOverlay::`vftable';
v16[84] = 0;
v16[85] = 0;
v16[87] = 0;
v16[88] = 0;
*((_DWORD *)v16 + 178) = -1;
v16[90] = 0;
*((_WORD *)v16 + 364) = 0;
*((_BYTE *)v16 + 730) = 0;
LOWORD(v18) = v12;
BYTE2(v18) = v11;
LOWORD(v20) = v13;
BYTE2(v20) = v14;
if ( (unsigned __int8)HSVLiveOverlay::init((_DWORD)v16, v15, SelectedObjects, (unsigned int)&v20, (__int64)&v18) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v16);
}
else
{
(*(void (__fastcall **)(_QWORD *, __int64))(*v16 + 8LL))(v16, 1);
v16 = nullptr;
}
a1[203] = v16;
v16[88] = a1 + 52;
*(_QWORD *)(a1[203] + 568LL) = a1;
return (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[203] + 1064LL))(a1[203]);
}