//
// EditorUI::selectBuildTab from 0x1003ea70c to 0x1003ea840 (308 bytes)
//
// 3 xrefs:
// > EditorUI::setupCreateMenu @ 0x1003e4024
// > EditorUI::updateCreateMenu @ 0x1003e6dd0
// > EditorUI::onSelectBuildTab @ 0x1003ea708
//
// 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 __fastcall EditorUI::selectBuildTab(EditorUI *a1, int a2)
{
int m_selectedTab; // w8
unsigned int v5; // w20
int v6; // w0
unsigned int v7; // w8
unsigned int v8; // w20
EditButtonBar *v9; // x21
unsigned int v10; // w20
CCMenuItemToggler *v11; // x0
m_selectedTab = a1->m_selectedTab;
if ( m_selectedTab != a2 && (m_selectedTab == -1 || a1->m_selectedMode == 2) )
{
v5 = a2;
v6 = sub_10024A36C((__int64)a1->m_createButtonBars);
v7 = v5;
if ( v6 - 1 <= v5 )
v7 = sub_10024A36C((__int64)a1->m_createButtonBars) - 1;
if ( v7 )
{
if ( (unsigned int)sub_10024A36C((__int64)a1->m_createButtonBars) - 1 <= v5 )
v5 = sub_10024A36C((__int64)a1->m_createButtonBars) - 1;
}
else
{
v5 = 0;
}
a1->m_selectedTab = v5;
if ( (unsigned int)sub_10024A36C((__int64)a1->m_createButtonBars) )
{
v8 = 0;
do
{
v9 = (EditButtonBar *)sub_10024A388((__int64)a1->m_createButtonBars, v8);
((void (__fastcall *)(EditButtonBar *, bool))v9->setVisible)(v9, v8 == a1->m_selectedTab);
if ( v8 == a1->m_selectedTab )
a1->m_createButtonBar = v9;
++v8;
}
while ( v8 < (unsigned int)sub_10024A36C((__int64)a1->m_createButtonBars) );
}
if ( (unsigned int)sub_10024A36C((__int64)a1->m_tabsArray) )
{
v10 = 0;
do
{
v11 = (CCMenuItemToggler *)sub_10024A388((__int64)a1->m_tabsArray, v10);
CCMenuItemToggler::toggle(v11, v10++ == a1->m_selectedTab);
}
while ( v10 < (unsigned int)sub_10024A36C((__int64)a1->m_tabsArray) );
}
}
}