Add support for overlay-coloured links

This commit is contained in:
smoogipoo 2021-05-17 16:58:54 +09:00
parent de2900bc7c
commit e3b8d8ee18
1 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Online.Chat
@ -20,7 +21,10 @@ public class DrawableLinkCompiler : OsuHoverContainer
/// <summary>
/// Each word part of a chat link (split for word-wrap support).
/// </summary>
public List<Drawable> Parts;
public readonly List<Drawable> Parts;
[Resolved(CanBeNull = true)]
private OverlayColourProvider overlayColourProvider { get; set; }
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
@ -34,7 +38,7 @@ public DrawableLinkCompiler(IEnumerable<Drawable> parts)
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
IdleColour = colours.Blue;
IdleColour = overlayColourProvider?.Light2 ?? colours.Blue;
}
protected override IEnumerable<Drawable> EffectTargets => Parts;