From 7de1d3058f166eead23c76a0721f5892f5cee29a Mon Sep 17 00:00:00 2001 From: bencie Date: Tue, 24 Sep 2024 21:33:54 +0200 Subject: [PATCH] Show skin name as tooltip in friendlist and serverinfo --- src/game/client/components/menus.h | 1 + src/game/client/components/menus_browser.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index c9797eb37..4595bd1ee 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -417,6 +417,7 @@ protected: const void *ListItemId() const { return &m_aName; } const void *RemoveButtonId() const { return &m_FriendState; } const void *CommunityTooltipId() const { return &m_IsPlayer; } + const void *SkinTooltipId() const { return &m_aSkin; } bool operator<(const CFriendItem &Other) const { diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 9188cff72..5cbb81ad7 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -1325,6 +1325,8 @@ void CMenus::RenderServerbrowserInfoScoreboard(CUIRect View, const CServerInfo * CRenderTools::GetRenderTeeOffsetToRenderedTee(pIdleState, &TeeInfo, OffsetToMid); const vec2 TeeRenderPos = vec2(Skin.x + TeeInfo.m_Size / 2.0f, Skin.y + Skin.h / 2.0f + OffsetToMid.y); RenderTools()->RenderTee(pIdleState, &TeeInfo, CurrentClient.m_Afk ? EMOTE_BLINK : EMOTE_NORMAL, vec2(1.0f, 0.0f), TeeRenderPos); + Ui()->DoButtonLogic(&CurrentClient.m_aSkin, 0, &Skin); + GameClient()->m_Tooltips.DoToolTip(&CurrentClient.m_aSkin, &Skin, CurrentClient.m_aSkin); } // name @@ -1493,8 +1495,9 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) if(s_ScrollRegion.RectClipped(Rect)) continue; - const bool Inside = Ui()->HotItem() == Friend.ListItemId() || Ui()->HotItem() == Friend.RemoveButtonId() || Ui()->HotItem() == Friend.CommunityTooltipId(); + const bool Inside = Ui()->HotItem() == Friend.ListItemId() || Ui()->HotItem() == Friend.RemoveButtonId() || Ui()->HotItem() == Friend.CommunityTooltipId() || Ui()->HotItem() == Friend.SkinTooltipId(); int ButtonResult = Ui()->DoButtonLogic(Friend.ListItemId(), 0, &Rect); + if(Friend.ServerInfo()) { GameClient()->m_Tooltips.DoToolTip(Friend.ListItemId(), &Rect, Localize("Click to select server. Double click to join your friend.")); @@ -1525,6 +1528,8 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) CRenderTools::GetRenderTeeOffsetToRenderedTee(pIdleState, &TeeInfo, OffsetToMid); const vec2 TeeRenderPos = vec2(Skin.x + Skin.w / 2.0f, Skin.y + Skin.h * 0.55f + OffsetToMid.y); RenderTools()->RenderTee(pIdleState, &TeeInfo, Friend.IsAfk() ? EMOTE_BLINK : EMOTE_NORMAL, vec2(1.0f, 0.0f), TeeRenderPos); + Ui()->DoButtonLogic(Friend.SkinTooltipId(), 0, &Skin); + GameClient()->m_Tooltips.DoToolTip(Friend.SkinTooltipId(), &Skin, Friend.Skin()); } Rect.HSplitTop(11.0f, &NameLabel, &ClanLabel);