diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index e9be47778af..7e40eb7f9d7 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -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);