Move control point colour specifications to common location and use for formatting timing screen table

This commit is contained in:
Dean Herbert
2020-10-01 19:29:34 +09:00
parent fcccce8b4e
commit e96e30a19d
10 changed files with 57 additions and 12 deletions

View File

@ -15,12 +15,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public class DifficultyPointPiece : CompositeDrawable
{
private readonly DifficultyControlPoint difficultyPoint;
private OsuSpriteText speedMultiplierText;
private readonly BindableNumber<double> speedMultiplier;
public DifficultyPointPiece(DifficultyControlPoint point)
public DifficultyPointPiece(DifficultyControlPoint difficultyPoint)
{
speedMultiplier = point.SpeedMultiplierBindable.GetBoundCopy();
this.difficultyPoint = difficultyPoint;
speedMultiplier = difficultyPoint.SpeedMultiplierBindable.GetBoundCopy();
}
[BackgroundDependencyLoader]
@ -29,7 +32,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
Color4 colour = colours.GreenDark;
Color4 colour = difficultyPoint.GetRepresentingColour(colours);
InternalChildren = new Drawable[]
{

View File

@ -3,6 +3,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
@ -16,6 +17,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public class SamplePointPiece : CompositeDrawable
{
private readonly SampleControlPoint samplePoint;
private readonly Bindable<string> bank;
private readonly BindableNumber<int> volume;
@ -24,6 +27,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public SamplePointPiece(SampleControlPoint samplePoint)
{
this.samplePoint = samplePoint;
volume = samplePoint.SampleVolumeBindable.GetBoundCopy();
bank = samplePoint.SampleBankBindable.GetBoundCopy();
}
@ -37,7 +41,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
AutoSizeAxes = Axes.X;
RelativeSizeAxes = Axes.Y;
Color4 colour = colours.PinkDarker;
Color4 colour = samplePoint.GetRepresentingColour(colours);
InternalChildren = new Drawable[]
{
@ -57,7 +61,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
},
new Box
{
Colour = colours.Pink,
Colour = colour.Lighten(0.2f),
Width = 2,
RelativeSizeAxes = Axes.Y,
},

View File

@ -11,16 +11,20 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public class TimingPointPiece : CompositeDrawable
{
private readonly TimingControlPoint point;
private readonly BindableNumber<double> beatLength;
private OsuSpriteText bpmText;
public TimingPointPiece(TimingControlPoint point)
{
this.point = point;
beatLength = point.BeatLengthBindable.GetBoundCopy();
}
@ -32,12 +36,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
AutoSizeAxes = Axes.Both;
Color4 colour = point.GetRepresentingColour(colours);
InternalChildren = new Drawable[]
{
new Box
{
Alpha = 0.9f,
Colour = ColourInfo.GradientHorizontal(colours.YellowDark, colours.YellowDark.Opacity(0.5f)),
Colour = ColourInfo.GradientHorizontal(colour, colour.Opacity(0.5f)),
RelativeSizeAxes = Axes.Both,
},
bpmText = new OsuSpriteText