mirror of https://github.com/ppy/osu
Add support for overlay-coloured links
This commit is contained in:
parent
de2900bc7c
commit
e3b8d8ee18
|
@ -8,6 +8,7 @@
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Overlays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Online.Chat
|
namespace osu.Game.Online.Chat
|
||||||
|
@ -20,7 +21,10 @@ public class DrawableLinkCompiler : OsuHoverContainer
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Each word part of a chat link (split for word-wrap support).
|
/// Each word part of a chat link (split for word-wrap support).
|
||||||
/// </summary>
|
/// </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));
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
|
||||||
|
|
||||||
|
@ -34,7 +38,7 @@ public DrawableLinkCompiler(IEnumerable<Drawable> parts)
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
IdleColour = colours.Blue;
|
IdleColour = overlayColourProvider?.Light2 ?? colours.Blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> EffectTargets => Parts;
|
protected override IEnumerable<Drawable> EffectTargets => Parts;
|
||||||
|
|
Loading…
Reference in New Issue