mirror of
https://github.com/ppy/osu
synced 2025-02-04 12:21:58 +00:00
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:
parent
e9c4b521af
commit
5f4d7437bc
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user