Merge pull request #7974 from Robyt3/Menus-Tabs-Tooltips

Add tooltips for all icon-based menu and browser tabs
This commit is contained in:
Dennis Felsing 2024-02-13 23:51:30 +00:00 committed by GitHub
commit 5cb37c2e4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -591,6 +591,7 @@ void CMenus::RenderMenubar(CUIRect Box)
{ {
m_ShowStart = true; m_ShowStart = true;
} }
GameClient()->m_Tooltips.DoToolTip(&s_StartButton, &Button, Localize("Main menu"));
Box.VSplitLeft(10.0f, nullptr, &Box); Box.VSplitLeft(10.0f, nullptr, &Box);
Box.VSplitLeft(75.0f, &Button, &Box); Box.VSplitLeft(75.0f, &Button, &Box);
@ -721,12 +722,16 @@ void CMenus::RenderMenubar(CUIRect Box)
Client()->Quit(); Client()->Quit();
} }
} }
GameClient()->m_Tooltips.DoToolTip(&s_QuitButton, &Button, Localize("Quit"));
Box.VSplitRight(10.0f, &Box, nullptr); Box.VSplitRight(10.0f, &Box, nullptr);
Box.VSplitRight(33.0f, &Box, &Button); Box.VSplitRight(33.0f, &Box, &Button);
static CButtonContainer s_SettingsButton; 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])) if(DoButton_MenuTab(&s_SettingsButton, FONT_ICON_GEAR, m_ActivePage == PAGE_SETTINGS, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_SETTINGS]))
{
NewPage = PAGE_SETTINGS; NewPage = PAGE_SETTINGS;
}
GameClient()->m_Tooltips.DoToolTip(&s_SettingsButton, &Button, Localize("Settings"));
Box.VSplitRight(10.0f, &Box, nullptr); Box.VSplitRight(10.0f, &Box, nullptr);
Box.VSplitRight(33.0f, &Box, &Button); Box.VSplitRight(33.0f, &Box, &Button);
@ -735,6 +740,7 @@ void CMenus::RenderMenubar(CUIRect Box)
{ {
g_Config.m_ClEditor = 1; g_Config.m_ClEditor = 1;
} }
GameClient()->m_Tooltips.DoToolTip(&s_EditorButton, &Button, Localize("Editor"));
if(Client()->State() == IClient::STATE_OFFLINE) if(Client()->State() == IClient::STATE_OFFLINE)
{ {
@ -742,8 +748,11 @@ void CMenus::RenderMenubar(CUIRect Box)
Box.VSplitRight(33.0f, &Box, &Button); Box.VSplitRight(33.0f, &Box, &Button);
static CButtonContainer s_DemoButton; 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])) if(DoButton_MenuTab(&s_DemoButton, FONT_ICON_CLAPPERBOARD, m_ActivePage == PAGE_DEMOS, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_DEMOBUTTON]))
{
NewPage = PAGE_DEMOS; NewPage = PAGE_DEMOS;
} }
GameClient()->m_Tooltips.DoToolTip(&s_DemoButton, &Button, Localize("Demos"));
}
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);

View file

@ -1642,15 +1642,24 @@ void CMenus::RenderServerbrowserTabBar(CUIRect TabBar)
static CButtonContainer s_FilterTabButton; 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)) 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; g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_FILTERS;
}
GameClient()->m_Tooltips.DoToolTip(&s_FilterTabButton, &FilterTabButton, Localize("Server filter"));
static CButtonContainer s_InfoTabButton; 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)) 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; g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_INFO;
}
GameClient()->m_Tooltips.DoToolTip(&s_InfoTabButton, &InfoTabButton, Localize("Server info"));
static CButtonContainer s_FriendsTabButton; 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)) 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; g_Config.m_UiToolboxPage = UI_TOOLBOX_PAGE_FRIENDS;
}
GameClient()->m_Tooltips.DoToolTip(&s_FriendsTabButton, &FriendsTabButton, Localize("Friends"));
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);