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:
parent
a6496e35ec
commit
fc0b97065c
@ -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();
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user