From 639a5879a6a7c6201abcb287d7bb1776697a6d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 13 Feb 2024 22:26:26 +0100 Subject: [PATCH] Add tooltips for all icon-based menu and browser tabs --- src/game/client/components/menus.cpp | 9 +++++++++ src/game/client/components/menus_browser.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 65ce68286..1e2c9a473 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -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); diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index b501af976..923d915c7 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -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);