mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Remove HoverTarget
shared state update path
Felt quite convoluted to follow. Have just duplicated the single shared line instead.
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
@ -10,13 +9,11 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
public abstract class SidebarButton : OsuButton
|
||||
{
|
||||
private const double fade_duration = 50;
|
||||
protected const double FADE_DURATION = 500;
|
||||
|
||||
[Resolved]
|
||||
protected OverlayColourProvider ColourProvider { get; private set; }
|
||||
|
||||
protected abstract Drawable HoverTarget { get; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -38,9 +35,6 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e) => UpdateState();
|
||||
|
||||
protected virtual void UpdateState()
|
||||
{
|
||||
HoverTarget.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, fade_duration, Easing.OutQuint);
|
||||
}
|
||||
protected abstract void UpdateState();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user