Make AccentColour a bindable

This commit is contained in:
Dean Herbert
2019-07-22 14:45:25 +09:00
parent 38d39be678
commit 8327452fe1
15 changed files with 75 additions and 116 deletions

View File

@ -3,7 +3,6 @@
using System;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -23,11 +22,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
/// </summary>
public Func<double?> HoldStartTime;
private readonly Container glowContainer;
public DrawableHoldNoteTick(HoldNoteTick hitObject)
: base(hitObject)
{
Container glowContainer;
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
@ -53,23 +52,17 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
}
}
});
}
public override Color4 AccentColour
{
get => base.AccentColour;
set
AccentColour.BindValueChanged(colour =>
{
base.AccentColour = value;
glowContainer.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Radius = 2f,
Roundness = 15f,
Colour = value.Opacity(0.3f)
Colour = colour.NewValue.Opacity(0.3f)
};
}
}, true);
}
protected override void CheckForResult(bool userTriggered, double timeOffset)