Fix enter not working in server browser when no server selected

This commit is contained in:
Robert Müller 2023-07-13 14:02:42 +02:00
parent c8eae4c512
commit 8fad911b8b

View file

@ -433,8 +433,6 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
} }
} }
} }
if(s_ListBox.WasItemActivated())
Connect(g_Config.m_UiServerAddress);
// Render bar that shows the loading progression. // Render bar that shows the loading progression.
// The bar is only shown while loading and fades out when it's done. // The bar is only shown while loading and fades out when it's done.
@ -592,7 +590,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
Props.m_Color = ColorRGBA(0.5f, 1.0f, 0.5f, 0.5f); Props.m_Color = ColorRGBA(0.5f, 1.0f, 0.5f, 0.5f);
static CButtonContainer s_ConnectButton; static CButtonContainer s_ConnectButton;
if(UI()->DoButton_Menu(m_ConnectButton, &s_ConnectButton, ConnectLabelFunc, &ButtonConnect, Props)) if(UI()->DoButton_Menu(m_ConnectButton, &s_ConnectButton, ConnectLabelFunc, &ButtonConnect, Props) || s_ListBox.WasItemActivated() || UI()->ConsumeHotkey(CUI::HOTKEY_ENTER))
{ {
Connect(g_Config.m_UiServerAddress); Connect(g_Config.m_UiServerAddress);
} }