mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 19:03:20 +08:00
Merge pull request #2780 from smoogipoo/timeline-markers
Add centre marker to the editor timeline
This commit is contained in:
commit
60d1295bc6
@ -21,7 +21,13 @@ namespace osu.Game.Tests.Visual
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseEditorComposeTimeline : EditorClockTestCase
|
public class TestCaseEditorComposeTimeline : EditorClockTestCase
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(TimelineArea), typeof(Timeline), typeof(TimelineButton) };
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(TimelineArea),
|
||||||
|
typeof(Timeline),
|
||||||
|
typeof(TimelineButton),
|
||||||
|
typeof(CentreMarker)
|
||||||
|
};
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||||
|
{
|
||||||
|
public class CentreMarker : CompositeDrawable
|
||||||
|
{
|
||||||
|
private const float triangle_width = 20;
|
||||||
|
private const float triangle_height = 10;
|
||||||
|
private const float bar_width = 2;
|
||||||
|
|
||||||
|
public CentreMarker()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
Size = new Vector2(20, 1);
|
||||||
|
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = bar_width,
|
||||||
|
},
|
||||||
|
new Triangle
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
Size = new Vector2(triangle_width, triangle_height),
|
||||||
|
Scale = new Vector2(1, -1)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
Colour = colours.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -42,6 +42,9 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
Depth = float.MaxValue
|
Depth = float.MaxValue
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// We don't want the centre marker to scroll
|
||||||
|
AddInternal(new CentreMarker());
|
||||||
|
|
||||||
WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);
|
WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);
|
||||||
|
|
||||||
Beatmap.BindTo(beatmap);
|
Beatmap.BindTo(beatmap);
|
||||||
|
Loading…
Reference in New Issue
Block a user