diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index f89685c37..7d4a25894 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -285,8 +285,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) r.Margin(0.5f, &r); RenderTools()->DrawUIElRect(*pItem->m_pUIElement->Get(0), &r, ColorRGBA(1, 1, 1, 0.5f), CUI::CORNER_ALL, 4.0f); } - - if(!Selected && UI()->MouseHovered(&Row)) + else if(UI()->MouseHovered(&Row)) { CUIRect r = Row; r.Margin(0.5f, &r); diff --git a/src/game/client/components/tooltips.cpp b/src/game/client/components/tooltips.cpp index ababd2dcf..b33af1714 100644 --- a/src/game/client/components/tooltips.cpp +++ b/src/game/client/components/tooltips.cpp @@ -9,7 +9,7 @@ CTooltips::CTooltips() void CTooltips::OnReset() { - HoverTime = -1; + m_HoverTime = -1; m_Tooltips.clear(); } @@ -19,7 +19,7 @@ void CTooltips::SetActiveTooltip(CTooltip &Tooltip) return; m_ActiveTooltip.emplace(Tooltip); - HoverTime = time_get(); + m_HoverTime = time_get(); } inline void CTooltips::ClearActiveTooltip() @@ -68,7 +68,7 @@ void CTooltips::OnRender() return; // Delay tooltip until 1 second passed. - if(HoverTime > time_get() - time_freq()) + if(m_HoverTime > time_get() - time_freq()) return; const float MARGIN = 5.0f; diff --git a/src/game/client/components/tooltips.h b/src/game/client/components/tooltips.h index f789262d2..400eb5f5c 100644 --- a/src/game/client/components/tooltips.h +++ b/src/game/client/components/tooltips.h @@ -18,20 +18,20 @@ struct CTooltip /** * A component that manages and renders UI tooltips. - * + * * Should be among the last components to render. */ class CTooltips : public CComponent { std::unordered_map m_Tooltips; std::optional> m_ActiveTooltip; - int64_t HoverTime; + int64_t m_HoverTime; /** - * The passed tooltip is only actually set if there is no currently active tooltip. - * - * @param Tooltip A reference to the tooltip that should be active. - */ + * The passed tooltip is only actually set if there is no currently active tooltip. + * + * @param Tooltip A reference to the tooltip that should be active. + */ void SetActiveTooltip(CTooltip &Tooltip); inline void ClearActiveTooltip(); @@ -42,9 +42,9 @@ public: /** * Adds the tooltip to a cache and renders it when active. - * - * On the first call to this function, the data passed is cached, afterwards the calls are used to detect if the tooltip should be activated. - * + * + * On the first call to this function, the data passed is cached, afterwards the calls are used to detect if the tooltip should be activated. + * * For now only works correctly with single line tooltips, since Text width calculation gets broken when there are multiple lines. * * @param pID The ID of the tooltip. Usually a reference to some g_Config value.