Merge pull request #1345 from EVAST9919/user_overlay_tooltip

Add tooltip to username in the profile overlay
This commit is contained in:
Dean Herbert
2017-10-13 17:21:00 +09:00
committed by GitHub
2 changed files with 17 additions and 7 deletions

View File

@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users; using osu.Game.Users;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using osu.Framework.Graphics.Cursor;
namespace osu.Game.Overlays.Profile namespace osu.Game.Overlays.Profile
{ {
@ -119,15 +120,11 @@ namespace osu.Game.Overlays.Profile
} }
} }
}, },
new LinkFlowContainer.LinkText new LinkFlowContainer.ProfileLink(user)
{ {
Text = user.Username,
Url = $@"https://osu.ppy.sh/users/{user.Id}",
TextSize = 30,
Font = @"Exo2.0-RegularItalic",
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Y = -48 Y = -48,
}, },
countryFlag = new DrawableFlag(user.Country?.FlagName) countryFlag = new DrawableFlag(user.Country?.FlagName)
{ {
@ -539,6 +536,19 @@ namespace osu.Game.Overlays.Profile
hoverColour = colours.Yellow; hoverColour = colours.Yellow;
} }
} }
public class ProfileLink : LinkText, IHasTooltip
{
public string TooltipText => "View Profile in Browser";
public ProfileLink(User user)
{
Text = user.Username;
Url = $@"https://osu.ppy.sh/users/{user.Id}";
Font = @"Exo2.0-RegularItalic";
TextSize = 30;
}
}
} }
} }
} }