Fix the issue

When Enabled's value has been changed to true, it will now check if it is currently howered, and if yes, it will fade in correctly.
This commit is contained in:
Arphox 2019-06-04 21:30:49 +02:00
parent e9c4b521af
commit 5f4d7437bc

View File

@ -24,6 +24,9 @@ namespace osu.Game.Graphics.Containers
{
Enabled.ValueChanged += e =>
{
if (e.NewValue && isHovered)
fadeIn();
if (!e.NewValue)
unhover();
};
@ -33,11 +36,12 @@ namespace osu.Game.Graphics.Containers
protected override bool OnHover(HoverEvent e)
{
isHovered = true;
if (!Enabled.Value)
return false;
EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint));
isHovered = true;
fadeIn();
return base.OnHover(e);
}
@ -69,5 +73,10 @@ namespace osu.Game.Graphics.Containers
base.LoadComplete();
EffectTargets.ForEach(d => d.FadeColour(IdleColour));
}
private void fadeIn()
{
EffectTargets.ForEach(d => d.FadeColour(Color4.Black, FADE_DURATION * 10, Easing.OutQuint));
}
}
}