diff --git a/osu.Game/Overlays/Mods/IncompatibilityDisplayingModPanel.cs b/osu.Game/Overlays/Mods/IncompatibilityDisplayingModPanel.cs index 26c5b2ac49..84336319b7 100644 --- a/osu.Game/Overlays/Mods/IncompatibilityDisplayingModPanel.cs +++ b/osu.Game/Overlays/Mods/IncompatibilityDisplayingModPanel.cs @@ -16,6 +16,9 @@ namespace osu.Game.Overlays.Mods { private readonly BindableBool incompatible = new BindableBool(); + [Resolved] + private OverlayColourProvider overlayColourProvider { get; set; } = null!; + [Resolved] private Bindable> selectedMods { get; set; } = null!; @@ -55,7 +58,7 @@ namespace osu.Game.Overlays.Mods #region IHasCustomTooltip - public ITooltip GetCustomTooltip() => new IncompatibilityDisplayingTooltip(); + public ITooltip GetCustomTooltip() => new IncompatibilityDisplayingTooltip(overlayColourProvider); public Mod TooltipContent => Mod; diff --git a/osu.Game/Overlays/Mods/IncompatibilityDisplayingTooltip.cs b/osu.Game/Overlays/Mods/IncompatibilityDisplayingTooltip.cs index 2f82711162..3ac541eaa3 100644 --- a/osu.Game/Overlays/Mods/IncompatibilityDisplayingTooltip.cs +++ b/osu.Game/Overlays/Mods/IncompatibilityDisplayingTooltip.cs @@ -24,13 +24,15 @@ namespace osu.Game.Overlays.Mods [Resolved] private Bindable ruleset { get; set; } = null!; - public IncompatibilityDisplayingTooltip() + public IncompatibilityDisplayingTooltip(OverlayColourProvider colourProvider) + : base(colourProvider) { AddRange(new Drawable[] { incompatibleText = new OsuSpriteText { Margin = new MarginPadding { Top = 5 }, + Colour = colourProvider.Content2, Font = OsuFont.GetFont(weight: FontWeight.Regular), Text = "Incompatible with:" }, @@ -43,12 +45,6 @@ namespace osu.Game.Overlays.Mods }); } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - incompatibleText.Colour = colours.BlueLight; - } - protected override void UpdateDisplay(Mod mod) { base.UpdateDisplay(mod); diff --git a/osu.Game/Overlays/Mods/ModButtonTooltip.cs b/osu.Game/Overlays/Mods/ModButtonTooltip.cs index 52b27f1e00..061c3e3e3a 100644 --- a/osu.Game/Overlays/Mods/ModButtonTooltip.cs +++ b/osu.Game/Overlays/Mods/ModButtonTooltip.cs @@ -1,9 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -18,11 +15,10 @@ namespace osu.Game.Overlays.Mods public partial class ModButtonTooltip : VisibilityContainer, ITooltip { private readonly OsuSpriteText descriptionText; - private readonly Box background; protected override Container Content { get; } - public ModButtonTooltip() + public ModButtonTooltip(OverlayColourProvider colourProvider) { AutoSizeAxes = Axes.Both; Masking = true; @@ -30,9 +26,10 @@ namespace osu.Game.Overlays.Mods InternalChildren = new Drawable[] { - background = new Box + new Box { - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Background6, }, Content = new FillFlowContainer { @@ -43,6 +40,7 @@ namespace osu.Game.Overlays.Mods { descriptionText = new OsuSpriteText { + Colour = colourProvider.Content1, Font = OsuFont.GetFont(weight: FontWeight.Regular), }, } @@ -50,17 +48,10 @@ namespace osu.Game.Overlays.Mods }; } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - background.Colour = colours.Gray3; - descriptionText.Colour = colours.BlueLighter; - } - protected override void PopIn() => this.FadeIn(200, Easing.OutQuint); protected override void PopOut() => this.FadeOut(200, Easing.OutQuint); - private Mod lastMod; + private Mod? lastMod; public void SetContent(Mod mod) { diff --git a/osu.Game/Overlays/Mods/ModPresetTooltip.cs b/osu.Game/Overlays/Mods/ModPresetTooltip.cs index 501b56e2fd..ec81aa7ceb 100644 --- a/osu.Game/Overlays/Mods/ModPresetTooltip.cs +++ b/osu.Game/Overlays/Mods/ModPresetTooltip.cs @@ -40,14 +40,14 @@ namespace osu.Game.Overlays.Mods { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Padding = new MarginPadding(7), + Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 }, Spacing = new Vector2(7), Children = new[] { descriptionText = new OsuSpriteText { Font = OsuFont.GetFont(weight: FontWeight.Regular), - Colour = colourProvider.Content2, + Colour = colourProvider.Content1, }, } }