| 1834 | } |
| 1835 | |
| 1836 | void CMenus::RenderServerbrowser(CUIRect MainView) |
| 1837 | { |
| 1838 | UpdateCommunityCache(false); |
| 1839 | |
| 1840 | switch(g_Config.m_UiPage) |
| 1841 | { |
| 1842 | case PAGE_INTERNET: |
| 1843 | GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_BROWSER_INTERNET); |
| 1844 | break; |
| 1845 | case PAGE_LAN: |
| 1846 | GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_BROWSER_LAN); |
| 1847 | if(m_ForceRefreshLanPage) |
| 1848 | { |
| 1849 | RefreshBrowserTab(true); |
| 1850 | m_ForceRefreshLanPage = false; |
| 1851 | } |
| 1852 | break; |
| 1853 | case PAGE_FAVORITES: |
| 1854 | GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_BROWSER_FAVORITES); |
| 1855 | break; |
| 1856 | case PAGE_FAVORITE_COMMUNITY_1: |
| 1857 | case PAGE_FAVORITE_COMMUNITY_2: |
| 1858 | case PAGE_FAVORITE_COMMUNITY_3: |
| 1859 | case PAGE_FAVORITE_COMMUNITY_4: |
| 1860 | case PAGE_FAVORITE_COMMUNITY_5: |
| 1861 | GameClient()->m_MenuBackground.ChangePosition(g_Config.m_UiPage - PAGE_FAVORITE_COMMUNITY_1 + CMenuBackground::POS_BROWSER_CUSTOM0); |
| 1862 | break; |
| 1863 | default: |
| 1864 | dbg_assert_failed("ui_page invalid for RenderServerbrowser: %d", g_Config.m_UiPage); |
| 1865 | } |
| 1866 | |
| 1867 | // clang-format off |
| 1868 | /* |
| 1869 | +---------------------------+ +---communities---+ |
| 1870 | | | | | |
| 1871 | | | +------tabs-------+ |
| 1872 | | server list | | | |
| 1873 | | | | tool | |
| 1874 | | | | box | |
| 1875 | +---------------------------+ | | |
| 1876 | status box +-----------------+ |
| 1877 | */ |
| 1878 | // clang-format on |
| 1879 | |
| 1880 | CUIRect ServerList, StatusBox, ToolBox, TabBar; |
| 1881 | MainView.Draw(ms_ColorTabbarActive, IGraphics::CORNER_B, 10.0f); |
| 1882 | MainView.Margin(10.0f, &MainView); |
| 1883 | MainView.VSplitRight(205.0f, &ServerList, &ToolBox); |
| 1884 | ServerList.VSplitRight(5.0f, &ServerList, nullptr); |
| 1885 | |
| 1886 | if(g_Config.m_UiPage == PAGE_INTERNET || g_Config.m_UiPage == PAGE_FAVORITES) |
| 1887 | { |
| 1888 | CUIRect CommunityFilter; |
| 1889 | ToolBox.HSplitTop(19.0f + 4.0f * 17.0f + CScrollRegion::HEIGHT_MAGIC_FIX, &CommunityFilter, &ToolBox); |
| 1890 | ToolBox.HSplitTop(8.0f, nullptr, &ToolBox); |
| 1891 | RenderServerbrowserCommunitiesFilter(CommunityFilter); |
| 1892 | } |
| 1893 |
nothing calls this directly
no test coverage detected