mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Use a better method of link compilation
Adds word wrap back, simplifies a lot.
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
|
||||
@ -10,26 +12,34 @@ namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
public class OsuHoverContainer : OsuClickableContainer
|
||||
{
|
||||
private Color4 hoverColour;
|
||||
private Color4 unhoverColour;
|
||||
protected Color4 HoverColour;
|
||||
|
||||
protected Color4 IdleColour = Color4.White;
|
||||
|
||||
protected virtual IEnumerable<Drawable> EffectTargets => new[] { Content };
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
this.FadeColour(hoverColour, 500, Easing.OutQuint);
|
||||
EffectTargets.ForEach(d => d.FadeColour(HoverColour, 500, Easing.OutQuint));
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
this.FadeColour(unhoverColour, 500, Easing.OutQuint);
|
||||
EffectTargets.ForEach(d => d.FadeColour(IdleColour, 500, Easing.OutQuint));
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
hoverColour = colours.Yellow;
|
||||
unhoverColour = Colour;
|
||||
HoverColour = colours.Yellow;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
EffectTargets.ForEach(d => d.FadeColour(IdleColour));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user