From 3780c74add476e936de39d15e0b8be6a28a8d887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 18 Dec 2022 21:58:25 +0100 Subject: [PATCH] Add tooltips for the buttons that open directories and files Closes #5653. --- src/game/client/components/menus_demo.cpp | 1 + src/game/client/components/menus_settings.cpp | 4 ++++ src/game/client/components/menus_settings_assets.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index f731e4eb7..c3338a41c 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -1406,6 +1406,7 @@ void CMenus::RenderDemoList(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_DirectoryButtonID, &DirectoryButton, Localize("Open the directory that contains the demo files")); if(!m_DemolistSelectedIsDir) { diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 642ddeb4a..2128d1cfe 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -210,6 +210,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_SettingsButtonID, &SettingsButton, Localize("Open the settings file")); Left.HSplitTop(15.0f, 0, &Left); CUIRect ConfigButton; @@ -225,6 +226,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_ConfigButtonID, &ConfigButton, Localize("Open the directory that contains the configuration and user files")); Left.HSplitTop(15.0f, 0, &Left); CUIRect DirectoryButton; @@ -242,6 +244,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_ThemesButtonID, &DirectoryButton, Localize("Open the directory to add custom themes")); // auto statboard screenshot { @@ -917,6 +920,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_DirectoryButtonID, &DirectoryButton, Localize("Open the directory to add custom skins")); TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT)); TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE); diff --git a/src/game/client/components/menus_settings_assets.cpp b/src/game/client/components/menus_settings_assets.cpp index f851b0315..fc9f1beb9 100644 --- a/src/game/client/components/menus_settings_assets.cpp +++ b/src/game/client/components/menus_settings_assets.cpp @@ -692,6 +692,7 @@ void CMenus::RenderSettingsCustom(CUIRect MainView) dbg_msg("menus", "couldn't open file '%s'", aBuf); } } + GameClient()->m_Tooltips.DoToolTip(&s_AssetsDirID, &DirectoryButton, Localize("Open the directory to add custom assets")); TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT)); TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);