mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
prevent that the main tabs in the menu can be misused as refresh buttons
This commit is contained in:
parent
ea876df455
commit
f09d4a19e1
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue