Only activate server browser list box when no popup is open

To support popup menus over the server browser.
This commit is contained in:
Robert Müller 2023-05-21 21:12:00 +02:00
parent e175c0a79f
commit 59fafdbf4e

View file

@ -184,8 +184,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
g_Config.m_UiToolboxPage = (g_Config.m_UiToolboxPage + 3 + Direction) % 3;
}
bool ListBoxUsed = !UI()->IsPopupOpen();
static CListBox s_ListBox;
s_ListBox.DoStart(ms_ListheaderHeight, NumServers, 1, 3, -1, &View, false);
s_ListBox.DoStart(ms_ListheaderHeight, NumServers, 1, 3, -1, &View, false, &ListBoxUsed);
int NumPlayers = 0;
static int s_PrevSelectedIndex = -1;
@ -222,7 +224,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
pItem->m_pUIElement = UI()->GetNewUIElement(UIRectCount);
}
const CListboxItem ListItem = s_ListBox.DoNextItem(pItem, str_comp(pItem->m_aAddress, g_Config.m_UiServerAddress) == 0);
const CListboxItem ListItem = s_ListBox.DoNextItem(pItem, str_comp(pItem->m_aAddress, g_Config.m_UiServerAddress) == 0, &ListBoxUsed);
if(ListItem.m_Selected)
m_SelectedIndex = i;