mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Merge pull request #7974 from Robyt3/Menus-Tabs-Tooltips
Add tooltips for all icon-based menu and browser tabs
This commit is contained in:
commit
5cb37c2e4a
|
@ -591,6 +591,7 @@ void CMenus::RenderMenubar(CUIRect Box)
|
|||
{
|
||||
m_ShowStart = true;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_StartButton, &Button, Localize("Main menu"));
|
||||
|
||||
Box.VSplitLeft(10.0f, nullptr, &Box);
|
||||
Box.VSplitLeft(75.0f, &Button, &Box);
|
||||
|
@ -721,12 +722,16 @@ void CMenus::RenderMenubar(CUIRect Box)
|
|||
Client()->Quit();
|
||||
}
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_QuitButton, &Button, Localize("Quit"));
|
||||
|
||||
Box.VSplitRight(10.0f, &Box, nullptr);
|
||||
Box.VSplitRight(33.0f, &Box, &Button);
|
||||
static CButtonContainer s_SettingsButton;
|
||||
if(DoButton_MenuTab(&s_SettingsButton, FONT_ICON_GEAR, m_ActivePage == PAGE_SETTINGS, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_SETTINGS]))
|
||||
{
|
||||
NewPage = PAGE_SETTINGS;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_SettingsButton, &Button, Localize("Settings"));
|
||||
|
||||
Box.VSplitRight(10.0f, &Box, nullptr);
|
||||
Box.VSplitRight(33.0f, &Box, &Button);
|
||||
|
@ -735,6 +740,7 @@ void CMenus::RenderMenubar(CUIRect Box)
|
|||
{
|
||||
g_Config.m_ClEditor = 1;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_EditorButton, &Button, Localize("Editor"));
|
||||
|
||||
if(Client()->State() == IClient::STATE_OFFLINE)
|
||||
{
|
||||
|
@ -742,7 +748,10 @@ void CMenus::RenderMenubar(CUIRect Box)
|
|||
Box.VSplitRight(33.0f, &Box, &Button);
|
||||
static CButtonContainer s_DemoButton;
|
||||
if(DoButton_MenuTab(&s_DemoButton, FONT_ICON_CLAPPERBOARD, m_ActivePage == PAGE_DEMOS, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_DEMOBUTTON]))
|
||||
{
|
||||
NewPage = PAGE_DEMOS;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_DemoButton, &Button, Localize("Demos"));
|
||||
}
|
||||
|
||||
TextRender()->SetRenderFlags(0);
|
||||
|
|
|
@ -1642,15 +1642,24 @@ void CMenus::RenderServerbrowserTabBar(CUIRect TabBar)
|
|||
|
||||
static CButtonContainer s_FilterTabButton;
|
||||
if(DoButton_MenuTab(&s_FilterTabButton, FONT_ICON_LIST_UL, g_Config.m_UiToolboxPage == UI_TOOLBOX_PAGE_FILTERS, &FilterTabButton, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_BROWSER_FILTER], &ColorInactive, &ColorActive))
|
||||
{
|
||||
g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_FILTERS;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_FilterTabButton, &FilterTabButton, Localize("Server filter"));
|
||||
|
||||
static CButtonContainer s_InfoTabButton;
|
||||
if(DoButton_MenuTab(&s_InfoTabButton, FONT_ICON_INFO, g_Config.m_UiToolboxPage == UI_TOOLBOX_PAGE_INFO, &InfoTabButton, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_BROWSER_INFO], &ColorInactive, &ColorActive))
|
||||
{
|
||||
g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_INFO;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_InfoTabButton, &InfoTabButton, Localize("Server info"));
|
||||
|
||||
static CButtonContainer s_FriendsTabButton;
|
||||
if(DoButton_MenuTab(&s_FriendsTabButton, FONT_ICON_HEART, g_Config.m_UiToolboxPage == UI_TOOLBOX_PAGE_FRIENDS, &FriendsTabButton, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_BROWSER_FRIENDS], &ColorInactive, &ColorActive))
|
||||
{
|
||||
g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_FRIENDS;
|
||||
}
|
||||
GameClient()->m_Tooltips.DoToolTip(&s_FriendsTabButton, &FriendsTabButton, Localize("Friends"));
|
||||
|
||||
TextRender()->SetRenderFlags(0);
|
||||
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
|
||||
|
|
Loading…
Reference in a new issue