diff --git a/osu.Desktop.VisualTests/Tests/TestCaseOptionsContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseOptionsContainer.cs new file mode 100644 index 0000000000..7d1f2bda3c --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseOptionsContainer.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Testing; +using osu.Game.Overlays; +using osu.Game.Screens.Play.Options; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseOptionsContainer : TestCase + { + public override string Description => @"Setting visible in replay/auto"; + + public override void Reset() + { + base.Reset(); + + Add(new OptionsDisplay() + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + AutoSizeAxes = Axes.Both, + }); + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index dbb1750b72..1220f6a120 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -196,6 +196,7 @@ + diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 1e57c2ba2a..9a50b576e1 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -14,6 +14,7 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Screens.Play.HUD; using OpenTK.Input; +using osu.Game.Screens.Play.Options; namespace osu.Game.Screens.Play { @@ -29,6 +30,7 @@ namespace osu.Game.Screens.Play public readonly HealthDisplay HealthDisplay; public readonly SongProgress Progress; public readonly ModDisplay ModDisplay; + public readonly OptionsDisplay OptionsDisplay; private Bindable showKeyCounter; private Bindable showHud; @@ -42,6 +44,7 @@ namespace osu.Game.Screens.Play protected abstract HealthDisplay CreateHealthDisplay(); protected abstract SongProgress CreateProgress(); protected abstract ModDisplay CreateModsContainer(); + protected abstract OptionsDisplay CreateOptionsDisplay(); protected HUDOverlay() { @@ -60,6 +63,7 @@ namespace osu.Game.Screens.Play HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), + OptionsDisplay = CreateOptionsDisplay(), } }); } diff --git a/osu.Game/Screens/Play/Options/OptionContainer.cs b/osu.Game/Screens/Play/Options/OptionContainer.cs new file mode 100644 index 0000000000..12f50d6e37 --- /dev/null +++ b/osu.Game/Screens/Play/Options/OptionContainer.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Screens.Play.Options +{ + public abstract class OptionContainer : Container + { + /// + /// The title of this option. + /// + public abstract string Title { get; } + + public OptionContainer() + { + Masking = true; + Size = new Vector2(200, 100); + CornerRadius = 5; + BorderColour = Color4.Black; + BorderThickness = 2; + Depth = 10; + + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new OsuSpriteText + { + Origin = Anchor.TopLeft, + Anchor = Anchor.TopLeft, + Text = Title, + TextSize = 17, + Margin = new MarginPadding { Top = 5, Left = 10 }, + Font = @"Exo2.0-Bold", + }, + new SimpleButton + { + Origin = Anchor.TopRight, + Anchor = Anchor.TopRight, + Margin = new MarginPadding { Top = 5, Right = 10 }, + Icon = FontAwesome.fa_bars, + Scale = new Vector2(0.7f), + }, + }; + } + } +} diff --git a/osu.Game/Screens/Play/Options/OptionsDisplay.cs b/osu.Game/Screens/Play/Options/OptionsDisplay.cs new file mode 100644 index 0000000000..8069dd7308 --- /dev/null +++ b/osu.Game/Screens/Play/Options/OptionsDisplay.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Screens.Play.Options +{ + public class OptionsDisplay : FillFlowContainer + { + public OptionsDisplay() + { + Direction = FillDirection.Vertical; + Spacing = new Vector2(0, 20); + + Add(new PlaybackOption()); + Add(new PlaybackOption()); + Add(new PlaybackOption()); + } + } +} diff --git a/osu.Game/Screens/Play/Options/PlaybackOption.cs b/osu.Game/Screens/Play/Options/PlaybackOption.cs new file mode 100644 index 0000000000..0870399b56 --- /dev/null +++ b/osu.Game/Screens/Play/Options/PlaybackOption.cs @@ -0,0 +1,10 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Screens.Play.Options +{ + public class PlaybackOption : OptionContainer + { + public override string Title => "PLAYBACK"; + } +} diff --git a/osu.Game/Screens/Play/StandardHUDOverlay.cs b/osu.Game/Screens/Play/StandardHUDOverlay.cs index 87fbea6810..48167fabd5 100644 --- a/osu.Game/Screens/Play/StandardHUDOverlay.cs +++ b/osu.Game/Screens/Play/StandardHUDOverlay.cs @@ -8,6 +8,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Play.HUD; using OpenTK; +using osu.Game.Screens.Play.Options; namespace osu.Game.Screens.Play { @@ -71,6 +72,14 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Top = 20, Right = 10 }, }; + protected override OptionsDisplay CreateOptionsDisplay() => new OptionsDisplay + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + AutoSizeAxes = Axes.Both, + Margin = new MarginPadding { Top = 100, Right = 10 }, + }; + [BackgroundDependencyLoader] private void load(OsuColour colours) { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 63acdb1914..afd6a57d5e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -74,6 +74,7 @@ + @@ -231,6 +232,9 @@ + + +