Show skin name as tooltip in friendlist and serverinfo

This commit is contained in:
bencie 2024-09-24 21:33:54 +02:00
parent ec768b2269
commit 7de1d3058f
2 changed files with 7 additions and 1 deletions

View file

@ -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
{

View file

@ -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);