From 5845665ba602cae27fe1d726aba48745044966d1 Mon Sep 17 00:00:00 2001 From: SushiTee Date: Thu, 15 Nov 2012 10:14:30 +0100 Subject: [PATCH] started writing the friends browser page --- src/game/client/components/menus.cpp | 11 +++++++++-- src/game/client/components/menus.h | 6 ++++++ src/game/client/components/menus_browser.cpp | 18 ++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 4cc928580..eed2317fc 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1163,10 +1163,17 @@ void CMenus::RenderMenubar(CUIRect r) g_Config.m_UiBrowserPage = PAGE_LAN; } + char aBuf[32]; + if(m_BorwserPage == PAGE_BROWSER_BROWSER) + str_copy(aBuf, Localize("Friends"), sizeof(aBuf)); + else if(m_BorwserPage == PAGE_BROWSER_FRIENDS) + str_copy(aBuf, Localize("Browser"), sizeof(aBuf)); static int s_FilterButton=0; - if(DoButton_Menu(&s_FilterButton, Localize("Filter"), 0, &Right)) + if(DoButton_Menu(&s_FilterButton, aBuf, 0, &Right)) { - // TODO + m_BorwserPage++; + if(m_BorwserPage >= NUM_PAGE_BROWSER) + m_BorwserPage = 0; } } else if(m_MenuPage == PAGE_DEMOS) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 0443a29ff..027489a26 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -135,6 +135,10 @@ class CMenus : public CComponent PAGE_SYSTEM, PAGE_START, + PAGE_BROWSER_BROWSER=0, + PAGE_BROWSER_FRIENDS, + NUM_PAGE_BROWSER, + SETTINGS_GENERAL=0, SETTINGS_PLAYER, SETTINGS_TEE, @@ -147,6 +151,7 @@ class CMenus : public CComponent int m_Popup; int m_ActivePage; int m_MenuPage; + int m_BorwserPage; bool m_MenuActive; bool m_UseMouseButtons; vec2 m_MousePos; @@ -428,6 +433,7 @@ class CMenus : public CComponent // found in menus_browser.cpp int m_ScrollOffset; void RenderServerbrowserServerList(CUIRect View); + void RenderServerbrowserFriendList(CUIRect View); void RenderServerbrowserServerDetail(CUIRect View, const CServerInfo *pInfo); void RenderServerbrowserFilters(CUIRect View); void RenderServerbrowserFriends(CUIRect View); diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 9127670d9..18c5dbc9b 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -1622,9 +1622,10 @@ void CMenus::RenderServerbrowser(CUIRect MainView) // server list - { + if(m_BorwserPage == PAGE_BROWSER_BROWSER) RenderServerbrowserServerList(ServerList); - } + else if(m_BorwserPage == PAGE_BROWSER_FRIENDS) + RenderServerbrowserFriendList(ServerList); /*// background RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 12.0f); @@ -1660,6 +1661,19 @@ void CMenus::RenderServerbrowser(CUIRect MainView) RenderServerbrowserOverlay(); } +// firend list + +void CMenus::RenderServerbrowserFriendList(CUIRect View) +{ + //CUIRect Headers, Status, InfoButton; + + //float SpacingH = 2.0f; + //float ButtonHeight = 20.0f; + + // background + RenderTools()->DrawUIRect(&View, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); +} + void CMenus::ConchainFriendlistUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) { pfnCallback(pResult, pCallbackUserData);