mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 16:52:57 +08:00
Add node sample pieces to timeline blueprint
This commit is contained in:
parent
32f945d304
commit
e945846759
@ -32,6 +32,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
private const float circle_size = 38;
|
||||
|
||||
private Container? repeatsContainer;
|
||||
private Container? nodeSamplesContainer;
|
||||
|
||||
public Action<DragEvent?>? OnDragHandled = null!;
|
||||
|
||||
@ -49,6 +50,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
private readonly Border border;
|
||||
|
||||
private readonly Container colouredComponents;
|
||||
private readonly Container sampleComponents;
|
||||
private readonly OsuSpriteText comboIndexText;
|
||||
|
||||
[Resolved]
|
||||
@ -101,10 +103,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
},
|
||||
}
|
||||
},
|
||||
sampleComponents = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new SamplePointPiece(Item)
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopCentre
|
||||
Origin = Anchor.TopCentre,
|
||||
X = Item is IHasRepeats ? -10 : 0
|
||||
},
|
||||
});
|
||||
|
||||
@ -233,6 +240,25 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
X = (float)(i + 1) / (repeats.RepeatCount + 1)
|
||||
});
|
||||
}
|
||||
|
||||
// Add node sample pieces
|
||||
nodeSamplesContainer?.Expire();
|
||||
|
||||
sampleComponents.Add(nodeSamplesContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
});
|
||||
|
||||
for (int i = 0; i < repeats.RepeatCount + 2; i++)
|
||||
{
|
||||
nodeSamplesContainer.Add(new NodeSamplePointPiece(Item, i)
|
||||
{
|
||||
X = (float)i / (repeats.RepeatCount + 1),
|
||||
RelativePositionAxes = Axes.X,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopCentre,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ShouldBeConsideredForInput(Drawable child) => true;
|
||||
|
Loading…
Reference in New Issue
Block a user