//
// EditorUI::updateScaleControl from 0x140114df0 to 0x140114f47 (343 bytes)
//
// 4 xrefs:
// > ??> @ 0x140553ed0
// > ??> @ 0x14066f5f8
// > ??> @ 0x14066f650
// > ??> @ 0x1406c91a4
//
// 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 EditorUI::updateScaleControl(EditorUI *a1)
{
GameObject *m_snapBtn; // rcx
bool isTrigger; // bp
int *p_m_uPreviousPriority; // r14
int *v5; // rsi
unsigned int v6; // ebx
GameObject *v7; // rax
__int64 v8; // rax
CCMenuItemSpriteExtra *v9; // rax
if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_bReorderChildDirty + 328LL))(*(_QWORD *)&a1->m_bReorderChildDirty) )
{
m_snapBtn = (GameObject *)a1->m_snapBtn;
isTrigger = 0;
if ( m_snapBtn )
{
isTrigger = GameObject::isTrigger(m_snapBtn);
p_m_uPreviousPriority = &a1->m_uPreviousPriority;
}
else
{
v5 = &a1->m_uPreviousPriority;
p_m_uPreviousPriority = &a1->m_uPreviousPriority;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)&a1->m_uPreviousPriority) )
{
isTrigger = 1;
v6 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)v5) )
{
while ( 1 )
{
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)v5, v6);
if ( !GameObject::isTrigger(v7) )
break;
if ( ++v6 >= cocos2d::CCArray::count(*(cocos2d::CCArray **)v5) )
goto LABEL_10;
}
isTrigger = 0;
}
}
}
LABEL_10:
v8 = *(_QWORD *)&a1->m_bReorderChildDirty;
if ( BYTE3(a1->m_pUserObject) )
{
*(_DWORD *)(v8 + 496) = 1082130432;
*(_DWORD *)(*(_QWORD *)&a1->m_bReorderChildDirty + 500LL) = 1048576000;
}
else
{
*(_DWORD *)(v8 + 500) = 1056964608;
if ( isTrigger || (v9 = a1->m_snapBtn) != nullptr && v9[1].m_animationType == 747 )
*(_DWORD *)(*(_QWORD *)&a1->m_bReorderChildDirty + 496LL) = 1082130432;
else
*(_DWORD *)(*(_QWORD *)&a1->m_bReorderChildDirty + 496LL) = 0x40000000;
}
GJScaleControl::loadValues(
*(GJScaleControl **)&a1->m_bReorderChildDirty,
(GameObject *)a1->m_snapBtn,
*(cocos2d::CCArray **)p_m_uPreviousPriority,
(std::unordered_map *)&a1->m_uIndexInArray);
}
}