mirror of https://github.com/ppy/osu
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 @@ public OsuHoverContainer()
|
||||||
{
|
{
|
||||||
Enabled.ValueChanged += e =>
|
Enabled.ValueChanged += e =>
|
||||||
{
|
{
|
||||||
|
if (e.NewValue && isHovered)
|
||||||
|
fadeIn();
|
||||||
|
|
||||||
if (!e.NewValue)
|
if (!e.NewValue)
|
||||||
unhover();
|
unhover();
|
||||||
};
|
};
|
||||||
|
@ -33,11 +36,12 @@ public OsuHoverContainer()
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
|
isHovered = true;
|
||||||
|
|
||||||
if (!Enabled.Value)
|
if (!Enabled.Value)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint));
|
fadeIn();
|
||||||
isHovered = true;
|
|
||||||
|
|
||||||
return base.OnHover(e);
|
return base.OnHover(e);
|
||||||
}
|
}
|
||||||
|
@ -69,5 +73,10 @@ protected override void LoadComplete()
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
EffectTargets.ForEach(d => d.FadeColour(IdleColour));
|
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