From eeb50e27007dcf5076b4a0a99ad0e44d7226b8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 13 Jul 2023 21:45:06 +0200 Subject: [PATCH] Do not rely on `OverlayColourProvider` presence --- osu.Game/Overlays/RevertToDefaultButton.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/RevertToDefaultButton.cs b/osu.Game/Overlays/RevertToDefaultButton.cs index 48491c5d9c..28433f1669 100644 --- a/osu.Game/Overlays/RevertToDefaultButton.cs +++ b/osu.Game/Overlays/RevertToDefaultButton.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; @@ -33,7 +34,10 @@ public partial class RevertToDefaultButton : OsuClickableContainer, IHasCurre private Circle circle = null!; [Resolved] - private OverlayColourProvider colours { get; set; } = null!; + private OsuColour colours { get; set; } = null!; + + [Resolved] + private OverlayColourProvider? colourProvider { get; set; } public Bindable Current { @@ -124,16 +128,16 @@ private void updateState() { icon.RotateTo(-40, 500, Easing.OutQuint); - icon.FadeColour(colours.Light1, 300, Easing.OutQuint); - circle.FadeColour(colours.Background2, 300, Easing.OutQuint); + icon.FadeColour(colourProvider?.Light1 ?? colours.YellowLight, 300, Easing.OutQuint); + circle.FadeColour(colourProvider?.Background2 ?? colours.Gray6, 300, Easing.OutQuint); this.ScaleTo(1.2f, 300, Easing.OutQuint); } else { icon.RotateTo(0, 100, Easing.OutQuint); - icon.FadeColour(colours.Colour0, 100, Easing.OutQuint); - circle.FadeColour(colours.Background3, 100, Easing.OutQuint); + icon.FadeColour(colourProvider?.Colour0 ?? colours.Yellow, 100, Easing.OutQuint); + circle.FadeColour(colourProvider?.Background3 ?? colours.Gray3, 100, Easing.OutQuint); this.ScaleTo(1f, 100, Easing.OutQuint); } }