From e0625a9b30d0de40078d638496675580de6785f6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 17 May 2017 15:39:26 +0300 Subject: [PATCH] More overlays and overall fixes --- osu.Game/Configuration/OsuConfigManager.cs | 3 + .../Screens/Play/Options/CollectionOptions.cs | 31 ++++++++ .../Screens/Play/Options/DiscussionOptions.cs | 33 +++++++++ .../Screens/Play/Options/OptionContainer.cs | 73 ++++++++++++++----- .../Screens/Play/Options/OptionsDisplay.cs | 8 +- .../Screens/Play/Options/PlaybackOption.cs | 10 --- .../Screens/Play/Options/PlaybackOptions.cs | 26 +++++++ osu.Game/osu.Game.csproj | 5 +- 8 files changed, 157 insertions(+), 32 deletions(-) create mode 100644 osu.Game/Screens/Play/Options/CollectionOptions.cs create mode 100644 osu.Game/Screens/Play/Options/DiscussionOptions.cs delete mode 100644 osu.Game/Screens/Play/Options/PlaybackOption.cs create mode 100644 osu.Game/Screens/Play/Options/PlaybackOptions.cs diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8f177d6b56..eff41117f7 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -69,6 +69,8 @@ namespace osu.Game.Configuration Set(OsuSetting.ShowInterface, true); Set(OsuSetting.KeyOverlay, false); + Set(OsuSetting.FloatingComments, false); + // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -88,6 +90,7 @@ namespace osu.Game.Configuration AutoCursorSize, DimLevel, KeyOverlay, + FloatingComments, ShowInterface, MouseDisableButtons, MouseDisableWheel, diff --git a/osu.Game/Screens/Play/Options/CollectionOptions.cs b/osu.Game/Screens/Play/Options/CollectionOptions.cs new file mode 100644 index 0000000000..4269faa9fb --- /dev/null +++ b/osu.Game/Screens/Play/Options/CollectionOptions.cs @@ -0,0 +1,31 @@ +// 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.Graphics; +using osu.Game.Configuration; +using osu.Game.Graphics.Sprites; +using osu.Game.Overlays.Music; +using System.Collections.Generic; + +namespace osu.Game.Screens.Play.Options +{ + public class CollectionOptions : OptionContainer + { + public override string Title => @"COLLECTIONS"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Add(new OsuSpriteText + { + Text = @"Add current song to", + }); + Add(new CollectionsDropdown + { + RelativeSizeAxes = Axes.X, + Items = new[] { new KeyValuePair(@"All", PlaylistCollection.All) }, + }); + } + } +} diff --git a/osu.Game/Screens/Play/Options/DiscussionOptions.cs b/osu.Game/Screens/Play/Options/DiscussionOptions.cs new file mode 100644 index 0000000000..850950ba53 --- /dev/null +++ b/osu.Game/Screens/Play/Options/DiscussionOptions.cs @@ -0,0 +1,33 @@ +// 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.Graphics; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Settings; + +namespace osu.Game.Screens.Play.Options +{ + public class DiscussionOptions : OptionContainer + { + public override string Title => @"DISCUSSIONS"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Add(new SettingsCheckbox + { + LabelText = "Show floating coments", + Bindable = config.GetBindable(OsuSetting.FloatingComments) + }); + Add(new FocusedTextBox + { + RelativeSizeAxes = Axes.X, + Height = 30, + PlaceholderText = "Add Comment", + HoldFocus = false, + }); + } + } +} diff --git a/osu.Game/Screens/Play/Options/OptionContainer.cs b/osu.Game/Screens/Play/Options/OptionContainer.cs index 12f50d6e37..24e3d3a054 100644 --- a/osu.Game/Screens/Play/Options/OptionContainer.cs +++ b/osu.Game/Screens/Play/Options/OptionContainer.cs @@ -19,14 +19,17 @@ namespace osu.Game.Screens.Play.Options /// public abstract string Title { get; } + private Container header; + private FillFlowContainer content; + public OptionContainer() { + AutoSizeAxes = Axes.Y; + Width = 250; Masking = true; - Size = new Vector2(200, 100); CornerRadius = 5; BorderColour = Color4.Black; BorderThickness = 2; - Depth = 10; Children = new Drawable[] { @@ -36,24 +39,60 @@ namespace osu.Game.Screens.Play.Options Colour = Color4.Black, Alpha = 0.5f, }, - new OsuSpriteText + new FillFlowContainer { - 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), + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + + Children = new Drawable[] + { + header = new Container + { + RelativeSizeAxes = Axes.X, + Height = 30, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + + Children = new Drawable[] + { + new OsuSpriteText + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + Text = Title, + TextSize = 17, + Font = @"Exo2.0-Bold", + Margin = new MarginPadding { Left = 10 }, + }, + new SimpleButton + { + Origin = Anchor.Centre, + Anchor = Anchor.CentreRight, + Position = new Vector2(-15,0), + Icon = FontAwesome.fa_bars, + Scale = new Vector2(0.7f), + }, + } + }, + content = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Padding = new MarginPadding(15), + Spacing = new Vector2(0, 10), + } + } }, }; } + + public new void Add(Drawable drawable) + { + content.Add(drawable); + } } } diff --git a/osu.Game/Screens/Play/Options/OptionsDisplay.cs b/osu.Game/Screens/Play/Options/OptionsDisplay.cs index 8069dd7308..3ae3bb9caf 100644 --- a/osu.Game/Screens/Play/Options/OptionsDisplay.cs +++ b/osu.Game/Screens/Play/Options/OptionsDisplay.cs @@ -6,16 +6,16 @@ using osu.Framework.Graphics.Containers; namespace osu.Game.Screens.Play.Options { - public class OptionsDisplay : FillFlowContainer + public class OptionsDisplay : FillFlowContainer { public OptionsDisplay() { Direction = FillDirection.Vertical; Spacing = new Vector2(0, 20); - Add(new PlaybackOption()); - Add(new PlaybackOption()); - Add(new PlaybackOption()); + Add(new CollectionOptions()); + Add(new DiscussionOptions()); + Add(new PlaybackOptions()); } } } diff --git a/osu.Game/Screens/Play/Options/PlaybackOption.cs b/osu.Game/Screens/Play/Options/PlaybackOption.cs deleted file mode 100644 index 0870399b56..0000000000 --- a/osu.Game/Screens/Play/Options/PlaybackOption.cs +++ /dev/null @@ -1,10 +0,0 @@ -// 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/Options/PlaybackOptions.cs b/osu.Game/Screens/Play/Options/PlaybackOptions.cs new file mode 100644 index 0000000000..a38c6916e2 --- /dev/null +++ b/osu.Game/Screens/Play/Options/PlaybackOptions.cs @@ -0,0 +1,26 @@ +// 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.Graphics; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Settings; + +namespace osu.Game.Screens.Play.Options +{ + public class PlaybackOptions : OptionContainer + { + public override string Title => @"PLAYBACK"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Add(new SettingsSlider + { + LabelText = "Playback speed", + Bindable = config.GetBindable(OsuSetting.DimLevel), + }); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index afd6a57d5e..0c7e0ea705 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -78,6 +78,7 @@ + @@ -232,9 +233,11 @@ + + - +