Change ingame menu layout a bit: Browser, Ghost directly instead of Network tab

This commit is contained in:
def 2016-04-27 20:14:03 +02:00
parent b495b1681c
commit ec7d28ed86
3 changed files with 15 additions and 52 deletions

View file

@ -86,8 +86,6 @@ CMenus::CMenus()
m_FriendlistSelectedIndex = -1;
m_DoubleClickIndex = -1;
m_DDRacePage = PAGE_BROWSER;
m_DemoPlayerState = DEMOPLAYER_NONE;
m_Dummy = false;
}
@ -667,10 +665,15 @@ int CMenus::RenderMenubar(CUIRect r)
if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, 0))
NewPage = PAGE_SERVER_INFO;
Box.VSplitLeft(100.0f, &Button, &Box);
Box.VSplitLeft(90.0f, &Button, &Box);
static int s_NetworkButton=0;
if(DoButton_MenuTab(&s_NetworkButton, Localize("Browser"), m_ActivePage==PAGE_NETWORK, &Button, 0))
NewPage = PAGE_NETWORK;
Box.VSplitLeft(70.0f, &Button, &Box);
static int s_GhostButton=0;
if(DoButton_MenuTab(&s_GhostButton, "Network", m_ActivePage==PAGE_DDRace, &Button, 0))
NewPage = PAGE_DDRace;
if(DoButton_MenuTab(&s_GhostButton, Localize("Ghost"), m_ActivePage==PAGE_GHOST, &Button, 0))
NewPage = PAGE_GHOST;
Box.VSplitLeft(100.0f, &Button, &Box);
Box.VSplitLeft(4.0f, 0, &Box);
@ -955,16 +958,16 @@ int CMenus::Render()
RenderPlayers(MainView);
else if(m_GamePage == PAGE_SERVER_INFO)
RenderServerInfo(MainView);
else if(m_GamePage == PAGE_DDRace)
RenderInGameDDRace(MainView);
else if(m_GamePage == PAGE_NETWORK)
RenderInGameNetwork(MainView);
else if(m_GamePage == PAGE_GHOST)
RenderGhost(MainView);
else if(m_GamePage == PAGE_CALLVOTE)
RenderServerControl(MainView);
else if(m_GamePage == PAGE_SETTINGS)
RenderSettings(MainView);
else if(m_GamePage == PAGE_GHOST)
RenderGhost(MainView);
else if(m_GamePage == PAGE_BROWSER)
RenderInGameBrowser(MainView);
}
else if(g_Config.m_UiPage == PAGE_NEWS)
RenderNews(MainView);

View file

@ -314,8 +314,7 @@ public:
PAGE_DEMOS,
PAGE_SETTINGS,
PAGE_SYSTEM,
PAGE_DDRace,
PAGE_BROWSER,
PAGE_NETWORK,
PAGE_GHOST
};
@ -343,7 +342,6 @@ public:
sorted_array<CGhostItem> m_lGhosts;
CGhostItem *m_OwnGhost;
int m_DDRacePage;
void GhostlistPopulate();
void setPopup(int Popup) { m_Popup = Popup; }
@ -378,9 +376,8 @@ private:
static int GhostlistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser);
// found in menus_ingame.cpp
void RenderInGameDDRace(CUIRect MainView);
void RenderInGameNetwork(CUIRect MainView);
void RenderGhost(CUIRect MainView);
void RenderInGameBrowser(CUIRect MainView);
// found in menus_settings.cpp
void RenderSettingsDDRace(CUIRect MainView);

View file

@ -762,44 +762,7 @@ void CMenus::RenderServerControl(CUIRect MainView)
}
}
void CMenus::RenderInGameDDRace(CUIRect MainView)
{
CUIRect Box = MainView;
CUIRect Button;
RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_ALL, 10.0f);
Box.HSplitTop(5.0f, &MainView, &MainView);
Box.HSplitTop(24.0f, &Box, &MainView);
Box.VMargin(20.0f, &Box);
Box.VSplitLeft(100.0f, &Button, &Box);
static int s_BrwoserButton=0;
if(DoButton_MenuTab(&s_BrwoserButton, Localize("Browser"), m_DDRacePage==PAGE_BROWSER, &Button, CUI::CORNER_TL))
{
m_DDRacePage = PAGE_BROWSER;
}
//Box.VSplitLeft(4.0f, 0, &Box);
Box.VSplitLeft(80.0f, &Button, &Box);
static int s_GhostButton=0;
if(DoButton_MenuTab(&s_GhostButton, Localize("Ghost"), m_DDRacePage==PAGE_GHOST, &Button, 0))
{
m_DDRacePage = PAGE_GHOST;
}
if(m_DDRacePage != -1)
{
if(m_DDRacePage == PAGE_GHOST)
RenderGhost(MainView);
else
RenderInGameBrowser(MainView);
}
return;
}
void CMenus::RenderInGameBrowser(CUIRect MainView)
void CMenus::RenderInGameNetwork(CUIRect MainView)
{
CUIRect Box = MainView;
CUIRect Button;