1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Move Control Group timing data into it's own component

This commit is contained in:
Jai Sharma 2022-11-27 02:47:02 +00:00
parent b6d7bec240
commit 792334a190

View File

@ -90,32 +90,38 @@ namespace osu.Game.Screens.Edit.Timing
{ {
return new Drawable[] return new Drawable[]
{ {
new FillFlowContainer new ControlGroupTiming(group),
{ new ControlGroupAttributes(group, c => c is not TimingControlPoint)
RelativeSizeAxes = Axes.Y,
Width = TIMING_COLUMN_WIDTH,
Spacing = new Vector2(5),
Children = new Drawable[]
{
new OsuSpriteText
{
Text = group.Time.ToEditorFormattedString(),
Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold),
Width = 70,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new ControlGroupAttributes(group, c => c is TimingControlPoint)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
}
}
},
new ControlGroupAttributes(group, c => !(c is TimingControlPoint))
}; };
} }
private partial class ControlGroupTiming : FillFlowContainer
{
public ControlGroupTiming(ControlPointGroup group)
{
Name = @"ControlGroupTiming";
RelativeSizeAxes = Axes.Y;
Width = TIMING_COLUMN_WIDTH;
Spacing = new Vector2(5);
Children = new Drawable[]
{
new OsuSpriteText
{
Text = group.Time.ToEditorFormattedString(),
Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold),
Width = 70,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new ControlGroupAttributes(group, c => c is TimingControlPoint)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
}
};
}
}
private partial class ControlGroupAttributes : CompositeDrawable private partial class ControlGroupAttributes : CompositeDrawable
{ {
private readonly Func<ControlPoint, bool> matchFunction; private readonly Func<ControlPoint, bool> matchFunction;
@ -130,6 +136,7 @@ namespace osu.Game.Screens.Edit.Timing
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
Name = @"ControlGroupAttributes";
InternalChild = fill = new FillFlowContainer InternalChild = fill = new FillFlowContainer
{ {