From 937dbb7bf690c22fff07cade2d4cadd6c8c9128a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Oct 2019 16:06:16 +0900 Subject: [PATCH] Initial layout for timing screen --- .../Visual/Editor/TestSceneTimingScreen.cs | 21 ++++ osu.Game/Screens/Edit/Timing/TimingScreen.cs | 97 ++++++++++++++++++- 2 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Tests/Visual/Editor/TestSceneTimingScreen.cs diff --git a/osu.Game.Tests/Visual/Editor/TestSceneTimingScreen.cs b/osu.Game.Tests/Visual/Editor/TestSceneTimingScreen.cs new file mode 100644 index 0000000000..be84ae2cf9 --- /dev/null +++ b/osu.Game.Tests/Visual/Editor/TestSceneTimingScreen.cs @@ -0,0 +1,21 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Game.Rulesets.Osu; +using osu.Game.Screens.Edit.Timing; + +namespace osu.Game.Tests.Visual.Editor +{ + [TestFixture] + public class TestSceneTimingScreen : EditorClockTestScene + { + [BackgroundDependencyLoader] + private void load() + { + Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); + Child = new TimingScreen(); + } + } +} diff --git a/osu.Game/Screens/Edit/Timing/TimingScreen.cs b/osu.Game/Screens/Edit/Timing/TimingScreen.cs index 9ded4207e5..b723ffac9a 100644 --- a/osu.Game/Screens/Edit/Timing/TimingScreen.cs +++ b/osu.Game/Screens/Edit/Timing/TimingScreen.cs @@ -1,13 +1,104 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; + namespace osu.Game.Screens.Edit.Timing { - public class TimingScreen : EditorScreen + public class TimingScreen : EditorScreenWithTimeline { - public TimingScreen() + protected override Drawable CreateMainContent() => new GridContainer { - Child = new ScreenWhiteBox.UnderConstructionMessage("Timing mode"); + RelativeSizeAxes = Axes.Both, + ColumnDimensions = new[] + { + new Dimension(), + new Dimension(GridSizeMode.Absolute, 200), + }, + Content = new[] + { + new Drawable[] + { + new ControlPointList(), + new ControlPointSettings(), + }, + } + }; + + public class ControlPointList : CompositeDrawable + { + [Resolved] + protected IBindable Beatmap { get; private set; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = colours.Gray0, + RelativeSizeAxes = Axes.Both, + }, + new OsuScrollContainer + { + RelativeSizeAxes = Axes.Both, + Child = new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new ControlPointRow(), + new ControlPointRow(), + new ControlPointRow(), + new ControlPointRow(), + new ControlPointRow(), + new ControlPointRow(), + } + }, + } + }; + } + + private class ControlPointRow : CompositeDrawable + { + public ControlPointRow() + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + + InternalChildren = new Drawable[] + { + new OsuSpriteText { Text = "sample row" }, + }; + } + } + } + + public class ControlPointSettings : CompositeDrawable + { + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + RelativeSizeAxes = Axes.Both; + + InternalChild = new Box + { + Colour = colours.Gray3, + RelativeSizeAxes = Axes.Both, + }; + } } } }