From f09d4a19e16e1d5cd6b638e88c32d143a71cd8b2 Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 20 Apr 2012 21:45:33 +0200 Subject: [PATCH] prevent that the main tabs in the menu can be misused as refresh buttons --- src/game/client/components/menus.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index d27307f4c..e0000cfe5 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -539,7 +539,7 @@ int CMenus::RenderMenubar(CUIRect r) Box.VSplitLeft(100.0f, &Button, &Box); static int s_InternetButton=0; - if(DoButton_MenuTab(&s_InternetButton, Localize("Internet"), m_ActivePage==PAGE_INTERNET, &Button, CUI::CORNER_TL)) + if(DoButton_MenuTab(&s_InternetButton, Localize("Internet"), m_ActivePage==PAGE_INTERNET, &Button, CUI::CORNER_TL) && m_ActivePage!=PAGE_INTERNET) { ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET); NewPage = PAGE_INTERNET; @@ -548,7 +548,7 @@ int CMenus::RenderMenubar(CUIRect r) //Box.VSplitLeft(4.0f, 0, &Box); Box.VSplitLeft(80.0f, &Button, &Box); static int s_LanButton=0; - if(DoButton_MenuTab(&s_LanButton, Localize("LAN"), m_ActivePage==PAGE_LAN, &Button, 0)) + if(DoButton_MenuTab(&s_LanButton, Localize("LAN"), m_ActivePage==PAGE_LAN, &Button, 0) && m_ActivePage!=PAGE_LAN) { ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN); NewPage = PAGE_LAN; @@ -557,7 +557,7 @@ int CMenus::RenderMenubar(CUIRect r) //box.VSplitLeft(4.0f, 0, &box); Box.VSplitLeft(110.0f, &Button, &Box); static int s_FavoritesButton=0; - if(DoButton_MenuTab(&s_FavoritesButton, Localize("Favorites"), m_ActivePage==PAGE_FAVORITES, &Button, CUI::CORNER_TR)) + if(DoButton_MenuTab(&s_FavoritesButton, Localize("Favorites"), m_ActivePage==PAGE_FAVORITES, &Button, CUI::CORNER_TR) && m_ActivePage!=PAGE_FAVORITES) { ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES); NewPage = PAGE_FAVORITES; @@ -566,7 +566,7 @@ int CMenus::RenderMenubar(CUIRect r) Box.VSplitLeft(4.0f*5, 0, &Box); Box.VSplitLeft(100.0f, &Button, &Box); static int s_DemosButton=0; - if(DoButton_MenuTab(&s_DemosButton, Localize("Demos"), m_ActivePage==PAGE_DEMOS, &Button, CUI::CORNER_T)) + if(DoButton_MenuTab(&s_DemosButton, Localize("Demos"), m_ActivePage==PAGE_DEMOS, &Button, CUI::CORNER_T) && m_ActivePage!=PAGE_DEMOS) { DemolistPopulate(); NewPage = PAGE_DEMOS;