1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 01:43:15 +08:00

Added tooltip to links

This commit is contained in:
FreezyLemon 2017-12-07 11:12:21 +01:00
parent bd11124e6d
commit 8a88040ef5

View File

@ -5,6 +5,7 @@ using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -12,13 +13,15 @@ using System.Linq;
namespace osu.Game.Online.Chat
{
public class ChatLink : OsuLinkSpriteText
public class ChatLink : OsuLinkSpriteText, IHasTooltip
{
public int LinkId = -1;
private Color4 hoverColour;
private Color4 urlColour;
public string TooltipText => LinkId != -1 ? Url : null;
protected override bool OnHover(InputState state)
{
// Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link