mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
Merge pull request #9078 from ChillerDragon/pr_browser_arrow_left_right
Arrow left and right in browser (internet/lan/favorites)
This commit is contained in:
commit
7abeaf5600
|
@ -660,6 +660,27 @@ void CMenus::RenderMenubar(CUIRect Box, IClient::EClientState ClientState)
|
|||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_FavoritesButton, &Button, Localize("Favorites"));
|
||||
|
||||
int MaxPage = PAGE_FAVORITES + ServerBrowser()->FavoriteCommunities().size();
|
||||
if(
|
||||
!Ui()->IsPopupOpen() &&
|
||||
CLineInput::GetActiveInput() == nullptr &&
|
||||
(g_Config.m_UiPage >= PAGE_INTERNET && g_Config.m_UiPage <= MaxPage) &&
|
||||
(m_MenuPage >= PAGE_INTERNET && m_MenuPage <= PAGE_FAVORITE_COMMUNITY_5))
|
||||
{
|
||||
if(Input()->KeyPress(KEY_RIGHT))
|
||||
{
|
||||
NewPage = g_Config.m_UiPage + 1;
|
||||
if(NewPage > MaxPage)
|
||||
NewPage = PAGE_INTERNET;
|
||||
}
|
||||
if(Input()->KeyPress(KEY_LEFT))
|
||||
{
|
||||
NewPage = g_Config.m_UiPage - 1;
|
||||
if(NewPage < PAGE_INTERNET)
|
||||
NewPage = MaxPage;
|
||||
}
|
||||
}
|
||||
|
||||
size_t FavoriteCommunityIndex = 0;
|
||||
static CButtonContainer s_aFavoriteCommunityButtons[5];
|
||||
static_assert(std::size(s_aFavoriteCommunityButtons) == (size_t)PAGE_FAVORITE_COMMUNITY_5 - PAGE_FAVORITE_COMMUNITY_1 + 1);
|
||||
|
|
Loading…
Reference in a new issue