diff --git a/osu.Game/Overlays/RestoreDefaultValueButton.cs b/osu.Game/Overlays/RestoreDefaultValueButton.cs index fe36f6ba6d..2f0c43dedb 100644 --- a/osu.Game/Overlays/RestoreDefaultValueButton.cs +++ b/osu.Game/Overlays/RestoreDefaultValueButton.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays { public override bool IsPresent => base.IsPresent || Scheduler.HasPendingTasks; - private readonly BindableWithCurrent current = new BindableWithCurrent(); + private readonly IBindableWithCurrent current = IBindableWithCurrent.Create(); // this is done to ensure a click on this button doesn't trigger focus on a parent element which contains the button. public override bool AcceptsFocus => true; @@ -62,7 +62,8 @@ namespace osu.Game.Overlays Action += () => { - if (!current.Disabled) current.SetDefault(); + if (!Current.Disabled) + Current.SetDefault(); }; } @@ -96,12 +97,12 @@ namespace osu.Game.Overlays private void updateState() { - if (current == null) + if (Current == null) return; - this.FadeTo(current.IsDefault ? 0f : - hovering && !current.Disabled ? 1f : 0.65f, 200, Easing.OutQuint); - this.FadeColour(current.Disabled ? Color4.Gray : buttonColour, 200, Easing.OutQuint); + this.FadeTo(Current.IsDefault ? 0f : + hovering && !Current.Disabled ? 1f : 0.65f, 200, Easing.OutQuint); + this.FadeColour(Current.Disabled ? Color4.Gray : buttonColour, 200, Easing.OutQuint); } } }