From b25c564ecb5134b633d36143f8100ff6496227a9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 19 Mar 2018 20:14:46 +0900 Subject: [PATCH] Integrate into editor's compose screen --- .../Visual/TestCaseBeatSnapVisualiser.cs | 4 ++- .../Visual/TestCaseEditorCompose.cs | 3 +++ .../Compose/BeatSnap/BeatSnapVisualiser.cs | 1 - .../Screens/Edit/Screens/Compose/Compose.cs | 26 ++++++++++++++----- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatSnapVisualiser.cs b/osu.Game.Tests/Visual/TestCaseBeatSnapVisualiser.cs index 5ccad31f7d..632c54ecfd 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatSnapVisualiser.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatSnapVisualiser.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Screens.Edit.Screens.Compose.BeatSnap; +using OpenTK; namespace osu.Game.Tests.Visual { @@ -24,7 +25,8 @@ namespace osu.Game.Tests.Visual { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Y = -200 + Y = -200, + Size = new Vector2(100, 110) }; } } diff --git a/osu.Game.Tests/Visual/TestCaseEditorCompose.cs b/osu.Game.Tests/Visual/TestCaseEditorCompose.cs index 15bccac172..221b40e2ba 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorCompose.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorCompose.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using NUnit.Framework; using osu.Framework.Allocation; using osu.Game.Beatmaps; @@ -12,6 +13,8 @@ namespace osu.Game.Tests.Visual [TestFixture] public class TestCaseEditorCompose : OsuTestCase { + public override IReadOnlyList RequiredTypes => new[] { typeof(Compose) }; + private readonly Random random; private readonly Compose compose; diff --git a/osu.Game/Screens/Edit/Screens/Compose/BeatSnap/BeatSnapVisualiser.cs b/osu.Game/Screens/Edit/Screens/Compose/BeatSnap/BeatSnapVisualiser.cs index 076fa926eb..696d491c21 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/BeatSnap/BeatSnapVisualiser.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/BeatSnap/BeatSnapVisualiser.cs @@ -27,7 +27,6 @@ namespace osu.Game.Screens.Edit.Screens.Compose.BeatSnap [BackgroundDependencyLoader] private void load(OsuColour colours) { - Size = new Vector2(100, 110); Masking = true; CornerRadius = 5; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs index d42c0bfdac..a3098b7712 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Logging; using osu.Game.Beatmaps; +using osu.Game.Screens.Edit.Screens.Compose.BeatSnap; using osu.Game.Screens.Edit.Screens.Compose.Timeline; namespace osu.Game.Screens.Edit.Screens.Compose @@ -47,15 +48,28 @@ namespace osu.Game.Screens.Edit.Screens.Compose Name = "Timeline content", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Horizontal = horizontal_margins, Vertical = vertical_margins }, - Children = new Drawable[] + Child = new GridContainer { - new Container + RelativeSizeAxes = Axes.Both, + Content = new[] { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Right = 115 }, - Child = timeline = new ScrollableTimeline { RelativeSizeAxes = Axes.Both } + new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Right = 5 }, + Child = timeline = new ScrollableTimeline { RelativeSizeAxes = Axes.Both } + }, + new BeatSnapVisualiser { RelativeSizeAxes = Axes.Both } + }, + }, + ColumnDimensions = new[] + { + new Dimension(), + new Dimension(GridSizeMode.Absolute, 90), } - } + }, } } }