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
commit bf9c71a6a3
2 changed files with 17 additions and 7 deletions

@ -1 +1 @@
Subproject commit 255b94f5dde0188db1a5b37daf9649659e2b8366
Subproject commit 3760443ea9bf682a1bbf6cfa6aa00ea9541c12aa

View File

@ -19,6 +19,7 @@
using osu.Game.Users;
using System.Diagnostics;
using System.Globalization;
using osu.Framework.Graphics.Cursor;
namespace osu.Game.Overlays.Profile
{
@ -119,15 +120,11 @@ public ProfileHeader(User user)
}
}
},
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,
Origin = Anchor.BottomLeft,
Y = -48
Y = -48,
},
countryFlag = new DrawableFlag(user.Country?.FlagName)
{
@ -539,6 +536,19 @@ private void load(OsuColour colours)
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;
}
}
}
}
}