mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Move Control Group timing data into it's own component
This commit is contained in:
parent
b6d7bec240
commit
792334a190
@ -90,32 +90,38 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
return new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
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))
|
||||
new ControlGroupTiming(group),
|
||||
new ControlGroupAttributes(group, c => c is not 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 readonly Func<ControlPoint, bool> matchFunction;
|
||||
@ -130,6 +136,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
AutoSizeAxes = Axes.X;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Name = @"ControlGroupAttributes";
|
||||
|
||||
InternalChild = fill = new FillFlowContainer
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user