mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Fix initally-disabled OsuAnimatedButton colour fading
This commit is contained in:
@ -38,6 +38,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
@ -73,17 +76,25 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load()
|
||||||
{
|
{
|
||||||
if (AutoSizeAxes != Axes.None)
|
if (AutoSizeAxes != Axes.None)
|
||||||
{
|
{
|
||||||
content.RelativeSizeAxes = (Axes.Both & ~AutoSizeAxes);
|
content.RelativeSizeAxes = (Axes.Both & ~AutoSizeAxes);
|
||||||
content.AutoSizeAxes = AutoSizeAxes;
|
content.AutoSizeAxes = AutoSizeAxes;
|
||||||
}
|
}
|
||||||
|
|
||||||
Enabled.BindValueChanged(enabled => this.FadeColour(enabled.NewValue ? Color4.White : colours.Gray9, 200, Easing.OutQuint), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
Colour = enablementColour;
|
||||||
|
Enabled.BindValueChanged(_ => this.FadeColour(enablementColour, 200, Easing.OutQuint));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color4 enablementColour => Enabled.Value ? Color4.White : colours.Gray9;
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
hover.FadeIn(500, Easing.OutQuint);
|
hover.FadeIn(500, Easing.OutQuint);
|
||||||
|
Reference in New Issue
Block a user