1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 20:07:29 +08:00

Move hover sound/container to base implementation

This commit is contained in:
Dean Herbert 2017-12-20 15:54:13 +09:00
parent a6496e35ec
commit fc0b97065c
2 changed files with 11 additions and 6 deletions

View File

@ -6,6 +6,8 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Input;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Containers;
namespace osu.Game.Graphics.Sprites
{
@ -13,6 +15,15 @@ namespace osu.Game.Graphics.Sprites
{
protected override IEnumerable<Drawable> FlowingChildren => Children;
protected override Container<Drawable> Content => content;
private readonly Container content;
public OsuLinkSpriteText()
{
AddInternal(content = new OsuHoverContainer { AutoSizeAxes = Axes.Both });
}
protected override bool OnClick(InputState state)
{
OnLinkClicked();

View File

@ -490,16 +490,10 @@ namespace osu.Game.Overlays.Profile
{
public string TooltipText => "View Profile in Browser";
private readonly OsuHoverContainer content;
protected override Container<Drawable> Content => content;
public override bool HandleInput => true;
public ProfileLink(User user)
{
AddInternal(content = new OsuHoverContainer { AutoSizeAxes = Axes.Both });
Text = user.Username;
Url = $@"https://osu.ppy.sh/users/{user.Id}";
Font = @"Exo2.0-RegularItalic";