mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Merge branch 'master' into facade-container
This commit is contained in:
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
@ -35,7 +36,7 @@ namespace osu.Game.Graphics.Containers
|
||||
showNotImplementedError = () => notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"This link type is not yet supported!",
|
||||
Icon = FontAwesome.LifeSaver,
|
||||
Icon = FontAwesome.Solid.LifeRing,
|
||||
});
|
||||
}
|
||||
|
||||
@ -75,6 +76,9 @@ namespace osu.Game.Graphics.Containers
|
||||
return createLink(text, null, url, linkType, linkArgument, tooltipText);
|
||||
}
|
||||
|
||||
public IEnumerable<Drawable> AddUserLink(User user, Action<SpriteText> creationParameters = null)
|
||||
=> createLink(AddText(user.Username, creationParameters), user.Username, null, LinkAction.OpenUserProfile, user.Id.ToString(), "View profile");
|
||||
|
||||
private IEnumerable<Drawable> createLink(IEnumerable<Drawable> drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null)
|
||||
{
|
||||
AddInternal(new DrawableLinkCompiler(drawables.OfType<SpriteText>().ToList())
|
||||
|
@ -1,17 +1,19 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Events;
|
||||
using osuTK.Graphics;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
public class OsuHoverContainer : OsuClickableContainer
|
||||
{
|
||||
protected const float FADE_DURATION = 500;
|
||||
|
||||
protected Color4 HoverColour;
|
||||
|
||||
protected Color4 IdleColour = Color4.White;
|
||||
@ -20,13 +22,13 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
EffectTargets.ForEach(d => d.FadeColour(HoverColour, 500, Easing.OutQuint));
|
||||
EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint));
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
EffectTargets.ForEach(d => d.FadeColour(IdleColour, 500, Easing.OutQuint));
|
||||
EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint));
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user