Skip to content

Commit

Permalink
Singer in the Singer avatar should be nullable.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Jul 13, 2023
1 parent 412a7c5 commit 877db56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Rulesets.Karaoke.Beatmaps.Metadatas;
using osu.Game.Rulesets.Karaoke.Beatmaps.Metadatas.Types;
using osu.Game.Rulesets.Karaoke.Beatmaps.Utils;
Expand All @@ -16,19 +16,19 @@ public partial class DrawableCircleSingerAvatar : DrawableSingerAvatar
private readonly IBindable<float> bindableHue = new Bindable<float>();

[BackgroundDependencyLoader]
private void load(LargeTextureStore textures)
private void load(OsuColour colour)
{
Masking = true;
CornerRadius = Math.Min(DrawSize.X, DrawSize.Y) / 2f;
BorderThickness = 5;

bindableHue.BindValueChanged(_ =>
{
BorderColour = SingerUtils.GetContentColour(Singer);
BorderColour = Singer != null ? SingerUtils.GetContentColour(Singer) : colour.Gray0;
}, true);
}

public override ISinger Singer
public override ISinger? Singer
{
get => base.Singer;
set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private partial class DrawableSinger : DrawableCircleSingerAvatar, IHasCustomToo
{
public ITooltip<ISinger> GetCustomTooltip() => new SingerToolTip();

public ISinger TooltipContent => Singer;
public ISinger? TooltipContent => Singer;
}
}

Expand Down

0 comments on commit 877db56

Please sign in to comment.