From c48c7b085c15a0da03acef175c34985eafc43887 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Wed, 10 Jan 2018 02:24:51 +0300 Subject: [PATCH 1/9] Visual settings initial commit --- .../Screens/Play/HUD/ReplaySettingsOverlay.cs | 4 +- osu.Game/Screens/Play/HUD/VisualSettings.cs | 59 +++++++++++++++++++ osu.Game/Screens/Play/HUDOverlay.cs | 3 +- osu.Game/Screens/Play/Player.cs | 3 +- .../Play/ReplaySettings/ReplayGroup.cs | 12 ++-- osu.Game/osu.Game.csproj | 1 + 6 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 osu.Game/Screens/Play/HUD/VisualSettings.cs diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs index cb30222831..8fda843bdc 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs @@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play.HUD public bool ReplayLoaded; public readonly PlaybackSettings PlaybackSettings; + public readonly VisualSettings VisualSettings; //public readonly CollectionSettings CollectionSettings; //public readonly DiscussionSettings DiscussionSettings; @@ -33,11 +34,12 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new[] + Children = new ReplayGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), PlaybackSettings = new PlaybackSettings(), + VisualSettings = new VisualSettings() } }; diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs new file mode 100644 index 0000000000..e9aabefc5d --- /dev/null +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Timing; +using osu.Game.Configuration; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Play.ReplaySettings; + +namespace osu.Game.Screens.Play.HUD +{ + public class VisualSettings : ReplayGroup + { + protected override string Title => "Visual settings"; + public IAdjustableClock AdjustableClock { get; set; } + + private readonly ReplaySliderBar dimSliderBar; + private readonly ReplayCheckbox showStoryboardToggle; + private readonly ReplayCheckbox mouseWheelDisabledToggle; + + public VisualSettings() + { + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "Background dim:" + }, + dimSliderBar = new ReplaySliderBar(), + new OsuSpriteText + { + Text = "Toggles:" + }, + showStoryboardToggle = new ReplayCheckbox {LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + }; + ToggleContentVisibility(); + } + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); + showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); + mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); + } + + protected override void ToggleContentVisibility() + { + base.ToggleContentVisibility(); + if (Expanded) + AdjustableClock?.Stop(); + else + AdjustableClock?.Start(); + } + } +} diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 721b5344ff..6593391da4 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -102,7 +102,8 @@ namespace osu.Game.Screens.Play // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) { - ReplaySettingsOverlay.Hide(); + ReplaySettingsOverlay.PlaybackSettings.Hide(); + ReplaySettingsOverlay.Delay(5000).FadeOut(200); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 87171ab561..0245491431 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,7 +228,8 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = + hudOverlay.ReplaySettingsOverlay.VisualSettings.AdjustableClock = adjustableSourceClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs index bf22250e12..3bd2928528 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.ReplaySettings private readonly FillFlowContainer content; private readonly IconButton button; - private bool expanded = true; + protected bool Expanded = true; private Color4 buttonActiveColour; @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.ReplaySettings Position = new Vector2(-15, 0), Icon = FontAwesome.fa_bars, Scale = new Vector2(0.75f), - Action = toggleContentVisibility, + Action = ToggleContentVisibility, }, } }, @@ -112,13 +112,13 @@ namespace osu.Game.Screens.Play.ReplaySettings protected override Container Content => content; - private void toggleContentVisibility() + protected virtual void ToggleContentVisibility() { content.ClearTransforms(); - expanded = !expanded; + Expanded = !Expanded; - if (expanded) + if (Expanded) content.AutoSizeAxes = Axes.Y; else { @@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play.ReplaySettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); + button.FadeColour(Expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f87f664199..693205b66d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,6 +315,7 @@ + From 98851e4a783843655f114087dd4c055a0d838657 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 11 Jan 2018 01:24:34 +0300 Subject: [PATCH 2/9] Stop time whenever visual settings are expanded --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 17 +++++++++++++---- osu.Game/Screens/Play/HUDOverlay.cs | 3 ++- osu.Game/Screens/Play/Player.cs | 5 +++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index e9aabefc5d..068783df34 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; @@ -14,7 +13,9 @@ namespace osu.Game.Screens.Play.HUD public class VisualSettings : ReplayGroup { protected override string Title => "Visual settings"; - public IAdjustableClock AdjustableClock { get; set; } + + public IAdjustableClock AudioClock { get; set; } + public FramedClock FramedClock { get; set; } private readonly ReplaySliderBar dimSliderBar; private readonly ReplayCheckbox showStoryboardToggle; @@ -51,9 +52,17 @@ namespace osu.Game.Screens.Play.HUD { base.ToggleContentVisibility(); if (Expanded) - AdjustableClock?.Stop(); + { + AudioClock?.Stop(); + if (FramedClock != null) + FramedClock.ProcessSourceClockFrames = false; + } else - AdjustableClock?.Start(); + { + AudioClock?.Start(); + if (FramedClock != null) + FramedClock.ProcessSourceClockFrames = true; + } } } } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 6593391da4..be37da04cd 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -103,7 +103,8 @@ namespace osu.Game.Screens.Play if (!replayLoaded) { ReplaySettingsOverlay.PlaybackSettings.Hide(); - ReplaySettingsOverlay.Delay(5000).FadeOut(200); + // TODO Hide VisualSettings correctly. At least, It shouldn't dissapear in expanded state. + //ReplaySettingsOverlay.VisualSettings.Delay(10000).FadeOut(200); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 0245491431..39d436bdf2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,8 +228,9 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = - hudOverlay.ReplaySettingsOverlay.VisualSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.VisualSettings.AudioClock = decoupledClock; + hudOverlay.ReplaySettingsOverlay.VisualSettings.FramedClock = offsetClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; From 3ec93966a0fd8630a0e6026f2a149d73167db523 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 11 Jan 2018 23:39:23 +0300 Subject: [PATCH 3/9] Implement VisualSettings autohiding --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 65 +++++++++++++++------ osu.Game/Screens/Play/HUDOverlay.cs | 3 +- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index 068783df34..778978d26e 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +using System; +using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Timing; @@ -17,6 +19,23 @@ namespace osu.Game.Screens.Play.HUD public IAdjustableClock AudioClock { get; set; } public FramedClock FramedClock { get; set; } + private bool autohide; + public bool Autohide + { + get => autohide; + set + { + autohide = value; + if (autohide && hideStopWatch == null) + hideStopWatch = Stopwatch.StartNew(); + else if (!autohide) + hideStopWatch = null; + } + } + + private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(5); + private Stopwatch hideStopWatch; + private readonly ReplaySliderBar dimSliderBar; private readonly ReplayCheckbox showStoryboardToggle; private readonly ReplayCheckbox mouseWheelDisabledToggle; @@ -25,19 +44,18 @@ namespace osu.Game.Screens.Play.HUD { Children = new Drawable[] { - new OsuSpriteText - { - Text = "Background dim:" - }, - dimSliderBar = new ReplaySliderBar(), - new OsuSpriteText - { - Text = "Toggles:" - }, - showStoryboardToggle = new ReplayCheckbox {LabelText = "Storyboards" }, - mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + new OsuSpriteText + { + Text = "Background dim:" + }, + dimSliderBar = new ReplaySliderBar(), + new OsuSpriteText + { + Text = "Toggles:" + }, + showStoryboardToggle = new ReplayCheckbox { LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } }; - ToggleContentVisibility(); } [BackgroundDependencyLoader] @@ -46,23 +64,34 @@ namespace osu.Game.Screens.Play.HUD dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); + + ToggleContentVisibility(); } protected override void ToggleContentVisibility() { base.ToggleContentVisibility(); + if (!Autohide) + return; if (Expanded) { - AudioClock?.Stop(); - if (FramedClock != null) - FramedClock.ProcessSourceClockFrames = false; + AudioClock.Stop(); + FramedClock.ProcessSourceClockFrames = false; + hideStopWatch.Stop(); } else { - AudioClock?.Start(); - if (FramedClock != null) - FramedClock.ProcessSourceClockFrames = true; + AudioClock.Start(); + FramedClock.ProcessSourceClockFrames = true; + hideStopWatch.Start(); } } + + protected override void Update() + { + base.Update(); + + if (Autohide && IsPresent && hideStopWatch.Elapsed > hideTimeSpan) this.FadeOut(100); + } } } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index be37da04cd..f677734d04 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -103,8 +103,7 @@ namespace osu.Game.Screens.Play if (!replayLoaded) { ReplaySettingsOverlay.PlaybackSettings.Hide(); - // TODO Hide VisualSettings correctly. At least, It shouldn't dissapear in expanded state. - //ReplaySettingsOverlay.VisualSettings.Delay(10000).FadeOut(200); + ReplaySettingsOverlay.VisualSettings.Autohide = true; ModDisplay.Delay(2000).FadeOut(200); } } From affbb7a8470076323c1c2b96a3dc8699f68536da Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 12 Jan 2018 00:37:28 +0300 Subject: [PATCH 4/9] Fix license header --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 3 ++- osu.sln.DotSettings | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index 252aa8371e..15efd22eeb 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Diagnostics; @@ -20,6 +20,7 @@ namespace osu.Game.Screens.Play.HUD public FramedClock FramedClock { get; set; } private bool autohide; + public bool Autohide { get => autohide; diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 20007e3306..8767e5374a 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -598,7 +598,7 @@ </TypePattern> </Patterns> Copyright (c) 2007-$CURRENT_YEAR$ ppy Pty Ltd <contact@ppy.sh>. -Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> From 43d2ae348a46974f43dd7a9b2106a797a7070c12 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sat, 13 Jan 2018 22:25:09 +0300 Subject: [PATCH 5/9] Rename ReplaySomething -> PlayerSomething --- .../Visual/TestCaseReplaySettingsOverlay.cs | 8 +++---- osu.Game/Rulesets/Edit/ToolboxGroup.cs | 4 ++-- ...ngsOverlay.cs => PlayerSettingsOverlay.cs} | 10 ++++----- osu.Game/Screens/Play/HUDOverlay.cs | 12 +++++------ osu.Game/Screens/Play/Player.cs | 6 +++--- .../CollectionSettings.cs | 6 +++--- .../DiscussionSettings.cs | 6 +++--- .../PlaybackSettings.cs | 10 ++++----- .../PlayerCheckbox.cs} | 4 ++-- .../PlayerGroup.cs} | 10 ++++----- .../PlayerSliderBar.cs} | 10 ++++----- .../{HUD => PlayerSettings}/VisualSettings.cs | 21 +++++++++---------- osu.Game/osu.Game.csproj | 16 +++++++------- 13 files changed, 61 insertions(+), 62 deletions(-) rename osu.Game/Screens/Play/HUD/{ReplaySettingsOverlay.cs => PlayerSettingsOverlay.cs} (86%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/CollectionSettings.cs (87%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/DiscussionSettings.cs (85%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/PlaybackSettings.cs (88%) rename osu.Game/Screens/Play/{ReplaySettings/ReplayCheckbox.cs => PlayerSettings/PlayerCheckbox.cs} (82%) rename osu.Game/Screens/Play/{ReplaySettings/ReplayGroup.cs => PlayerSettings/PlayerGroup.cs} (94%) rename osu.Game/Screens/Play/{ReplaySettings/ReplaySliderBar.cs => PlayerSettings/PlayerSliderBar.cs} (87%) rename osu.Game/Screens/Play/{HUD => PlayerSettings}/VisualSettings.cs (79%) diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index a5d8019bc1..2d4f1831de 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -4,7 +4,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play.HUD; -using osu.Game.Screens.Play.ReplaySettings; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Tests.Visual { @@ -14,7 +14,7 @@ namespace osu.Game.Tests.Visual { ExampleContainer container; - Add(new ReplaySettingsOverlay + Add(new PlayerSettingsOverlay { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual Text = @"Button", })); - AddStep(@"Add checkbox", () => container.Add(new ReplayCheckbox + AddStep(@"Add checkbox", () => container.Add(new PlayerCheckbox { LabelText = "Checkbox", })); @@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual })); } - private class ExampleContainer : ReplayGroup + private class ExampleContainer : PlayerGroup { protected override string Title => @"example"; } diff --git a/osu.Game/Rulesets/Edit/ToolboxGroup.cs b/osu.Game/Rulesets/Edit/ToolboxGroup.cs index 3b13cc38ab..e353191bc7 100644 --- a/osu.Game/Rulesets/Edit/ToolboxGroup.cs +++ b/osu.Game/Rulesets/Edit/ToolboxGroup.cs @@ -2,11 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Screens.Play.ReplaySettings; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Rulesets.Edit { - public class ToolboxGroup : ReplayGroup + public class ToolboxGroup : PlayerGroup { protected override string Title => "toolbox"; diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs similarity index 86% rename from osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs rename to osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 8fda843bdc..51cd3d55ab 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -3,14 +3,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Screens.Play.ReplaySettings; using OpenTK; using osu.Framework.Input; +using osu.Game.Screens.Play.PlayerSettings; using OpenTK.Input; namespace osu.Game.Screens.Play.HUD { - public class ReplaySettingsOverlay : VisibilityContainer + public class PlayerSettingsOverlay : VisibilityContainer { private const int fade_duration = 200; @@ -21,12 +21,12 @@ namespace osu.Game.Screens.Play.HUD //public readonly CollectionSettings CollectionSettings; //public readonly DiscussionSettings DiscussionSettings; - public ReplaySettingsOverlay() + public PlayerSettingsOverlay() { AlwaysPresent = true; RelativeSizeAxes = Axes.Both; - Child = new FillFlowContainer + Child = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new ReplayGroup[] + Children = new PlayerGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index f677734d04..bf3cf6b066 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -32,7 +32,7 @@ namespace osu.Game.Screens.Play public readonly HealthDisplay HealthDisplay; public readonly SongProgress Progress; public readonly ModDisplay ModDisplay; - public readonly ReplaySettingsOverlay ReplaySettingsOverlay; + public readonly PlayerSettingsOverlay PlayerSettingsOverlay; private Bindable showHud; private bool replayLoaded; @@ -56,7 +56,7 @@ namespace osu.Game.Screens.Play HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), - ReplaySettingsOverlay = CreateReplaySettingsOverlay(), + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), } }); } @@ -97,13 +97,13 @@ namespace osu.Game.Screens.Play replayLoaded = rulesetContainer.HasReplayLoaded; - ReplaySettingsOverlay.ReplayLoaded = replayLoaded; + PlayerSettingsOverlay.ReplayLoaded = replayLoaded; // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) { - ReplaySettingsOverlay.PlaybackSettings.Hide(); - ReplaySettingsOverlay.VisualSettings.Autohide = true; + PlayerSettingsOverlay.PlaybackSettings.Hide(); + PlayerSettingsOverlay.VisualSettings.Autohide = true; ModDisplay.Delay(2000).FadeOut(200); } } @@ -183,7 +183,7 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Top = 20, Right = 10 }, }; - protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay(); + protected virtual PlayerSettingsOverlay CreatePlayerSettingsOverlay() => new PlayerSettingsOverlay(); public virtual void BindProcessor(ScoreProcessor processor) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 3dcfd8b9c4..0218025e6b 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -230,9 +230,9 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; - hudOverlay.ReplaySettingsOverlay.VisualSettings.AudioClock = decoupledClock; - hudOverlay.ReplaySettingsOverlay.VisualSettings.FramedClock = offsetClock; + hudOverlay.PlayerSettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.PlayerSettingsOverlay.VisualSettings.AudioClock = decoupledClock; + hudOverlay.PlayerSettingsOverlay.VisualSettings.FramedClock = offsetClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs similarity index 87% rename from osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs index 9f29e085d1..4fca3649a2 100644 --- a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Music; -using System.Collections.Generic; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class CollectionSettings : ReplayGroup + public class CollectionSettings : PlayerGroup { protected override string Title => @"collections"; diff --git a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs similarity index 85% rename from osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs index cc7ccac7f5..acfe3aa510 100644 --- a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs @@ -6,9 +6,9 @@ using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class DiscussionSettings : ReplayGroup + public class DiscussionSettings : PlayerGroup { protected override string Title => @"discussions"; @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.ReplaySettings { Children = new Drawable[] { - new ReplayCheckbox + new PlayerCheckbox { LabelText = "Show floating comments", Bindable = config.GetBindable(OsuSetting.FloatingComments) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs similarity index 88% rename from osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index f8ac653f69..30f8d002d1 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Timing; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Timing; using osu.Game.Graphics.Sprites; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class PlaybackSettings : ReplayGroup + public class PlaybackSettings : PlayerGroup { private const int padding = 10; @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.ReplaySettings public IAdjustableClock AdjustableClock { set; get; } - private readonly ReplaySliderBar sliderbar; + private readonly PlayerSliderBar sliderbar; public PlaybackSettings() { @@ -47,7 +47,7 @@ namespace osu.Game.Screens.Play.ReplaySettings } }, }, - sliderbar = new ReplaySliderBar + sliderbar = new PlayerSliderBar { Bindable = new BindableDouble(1) { diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs similarity index 82% rename from osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs index f0b9ff623a..89fbbb8bf2 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class ReplayCheckbox : OsuCheckbox + public class PlayerCheckbox : OsuCheckbox { [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs similarity index 94% rename from osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs index 3bd2928528..bf17e18482 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -10,10 +8,12 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public abstract class ReplayGroup : Container + public abstract class PlayerGroup : Container { /// /// The title to be displayed in the header of this group. @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play.ReplaySettings private Color4 buttonActiveColour; - protected ReplayGroup() + protected PlayerGroup() { AutoSizeAxes = Axes.Y; Width = container_width; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs similarity index 87% rename from osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs index e6e909183d..4496523a13 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Allocation; -using osu.Game.Graphics.UserInterface; using System; -using osu.Game.Graphics; +using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class ReplaySliderBar : SettingsSlider + public class PlayerSliderBar : SettingsSlider where T : struct, IEquatable { protected override Drawable CreateControl() => new Sliderbar diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs similarity index 79% rename from osu.Game/Screens/Play/HUD/VisualSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 15efd22eeb..4e5f447b5f 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -8,11 +8,10 @@ using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Play.ReplaySettings; -namespace osu.Game.Screens.Play.HUD +namespace osu.Game.Screens.Play.PlayerSettings { - public class VisualSettings : ReplayGroup + public class VisualSettings : PlayerGroup { protected override string Title => "Visual settings"; @@ -37,10 +36,10 @@ namespace osu.Game.Screens.Play.HUD private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(3); private Stopwatch hideStopWatch; - private readonly ReplaySliderBar dimSliderBar; - private readonly ReplaySliderBar blurSliderBar; - private readonly ReplayCheckbox showStoryboardToggle; - private readonly ReplayCheckbox mouseWheelDisabledToggle; + private readonly PlayerSliderBar dimSliderBar; + private readonly PlayerSliderBar blurSliderBar; + private readonly PlayerCheckbox showStoryboardToggle; + private readonly PlayerCheckbox mouseWheelDisabledToggle; public VisualSettings() { @@ -50,18 +49,18 @@ namespace osu.Game.Screens.Play.HUD { Text = "Background dim:" }, - dimSliderBar = new ReplaySliderBar(), + dimSliderBar = new PlayerSliderBar(), new OsuSpriteText { Text = "Background blur:" }, - blurSliderBar = new ReplaySliderBar(), + blurSliderBar = new PlayerSliderBar(), new OsuSpriteText { Text = "Toggles:" }, - showStoryboardToggle = new ReplayCheckbox { LabelText = "Storyboards" }, - mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new PlayerCheckbox { LabelText = "Disable mouse wheel" } }; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 693205b66d..ee4ed1312d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,7 +315,7 @@ - + @@ -743,13 +743,13 @@ - - - - - - - + + + + + + + From 6e35484160b86fbb827476a394dd208b581407ed Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sat, 13 Jan 2018 23:09:43 +0300 Subject: [PATCH 6/9] Fix osu.Game.csproj which was broken during resolving merge conflict --- osu.Game/osu.Game.csproj | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ee4ed1312d..b716a137c2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -265,10 +265,12 @@ + + @@ -310,12 +312,24 @@ + + + + + + + + + + + + @@ -616,7 +630,6 @@ - @@ -667,16 +680,11 @@ - - - - - @@ -881,4 +889,4 @@ - \ No newline at end of file + From a81f32a388c83a5d8b534f04828504dedc481e1a Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Mon, 15 Jan 2018 20:52:52 +0300 Subject: [PATCH 7/9] PlayerGroup -> PlayerSettingsGroup --- osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs | 2 +- osu.Game/Rulesets/Edit/ToolboxGroup.cs | 2 +- osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs | 4 ++-- osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs | 2 +- osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs | 2 +- osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs | 2 +- .../PlayerSettings/{PlayerGroup.cs => PlayerSettingsGroup.cs} | 4 ++-- osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs | 2 +- osu.Game/osu.Game.csproj | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) rename osu.Game/Screens/Play/PlayerSettings/{PlayerGroup.cs => PlayerSettingsGroup.cs} (95%) diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 2d4f1831de..595a93b194 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual })); } - private class ExampleContainer : PlayerGroup + private class ExampleContainer : PlayerSettingsGroup { protected override string Title => @"example"; } diff --git a/osu.Game/Rulesets/Edit/ToolboxGroup.cs b/osu.Game/Rulesets/Edit/ToolboxGroup.cs index e353191bc7..e153607f47 100644 --- a/osu.Game/Rulesets/Edit/ToolboxGroup.cs +++ b/osu.Game/Rulesets/Edit/ToolboxGroup.cs @@ -6,7 +6,7 @@ using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Rulesets.Edit { - public class ToolboxGroup : PlayerGroup + public class ToolboxGroup : PlayerSettingsGroup { protected override string Title => "toolbox"; diff --git a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 51cd3d55ab..0f10721425 100644 --- a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Play.HUD AlwaysPresent = true; RelativeSizeAxes = Axes.Both; - Child = new FillFlowContainer + Child = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new PlayerGroup[] + Children = new PlayerSettingsGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), diff --git a/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs index 4fca3649a2..f18b0876a2 100644 --- a/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs @@ -9,7 +9,7 @@ using osu.Game.Overlays.Music; namespace osu.Game.Screens.Play.PlayerSettings { - public class CollectionSettings : PlayerGroup + public class CollectionSettings : PlayerSettingsGroup { protected override string Title => @"collections"; diff --git a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs index acfe3aa510..e6d4fe3e09 100644 --- a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play.PlayerSettings { - public class DiscussionSettings : PlayerGroup + public class DiscussionSettings : PlayerSettingsGroup { protected override string Title => @"discussions"; diff --git a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index 30f8d002d1..15d8e73a76 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.PlayerSettings { - public class PlaybackSettings : PlayerGroup + public class PlaybackSettings : PlayerSettingsGroup { private const int padding = 10; diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs similarity index 95% rename from osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index bf17e18482..005e97bd94 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -13,7 +13,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Play.PlayerSettings { - public abstract class PlayerGroup : Container + public abstract class PlayerSettingsGroup : Container { /// /// The title to be displayed in the header of this group. @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private Color4 buttonActiveColour; - protected PlayerGroup() + protected PlayerSettingsGroup() { AutoSizeAxes = Axes.Y; Width = container_width; diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 4e5f447b5f..f1468aba14 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -11,7 +11,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.PlayerSettings { - public class VisualSettings : PlayerGroup + public class VisualSettings : PlayerSettingsGroup { protected override string Title => "Visual settings"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b716a137c2..1e52fcb4d6 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -756,7 +756,7 @@ - + @@ -889,4 +889,4 @@ - + \ No newline at end of file From d82835107cda01d62dc9147d151f2e7303fbb19a Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 26 Jan 2018 22:20:24 +0300 Subject: [PATCH 8/9] Remove autohide and clock related logic from Visual settings overlay --- osu.Game/Screens/Play/HUDOverlay.cs | 5 +- .../PlayerSettings/PlayerSettingsGroup.cs | 12 ++-- .../Play/PlayerSettings/VisualSettings.cs | 55 ------------------- 3 files changed, 8 insertions(+), 64 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cdb9c2383d..e68a17f014 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -119,13 +119,12 @@ namespace osu.Game.Screens.Play if (loaded) { - PlayerSettingsOverlay.PlaybackSettings.Show(); + PlayerSettingsOverlay.Show(); ModDisplay.FadeIn(200); } else { - PlayerSettingsOverlay.PlaybackSettings.Hide(); - PlayerSettingsOverlay.VisualSettings.Autohide = true; + PlayerSettingsOverlay.Hide(); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 005e97bd94..e8a4bc6b27 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly FillFlowContainer content; private readonly IconButton button; - protected bool Expanded = true; + private bool expanded = true; private Color4 buttonActiveColour; @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.PlayerSettings Position = new Vector2(-15, 0), Icon = FontAwesome.fa_bars, Scale = new Vector2(0.75f), - Action = ToggleContentVisibility, + Action = toggleContentVisibility, }, } }, @@ -112,13 +112,13 @@ namespace osu.Game.Screens.Play.PlayerSettings protected override Container Content => content; - protected virtual void ToggleContentVisibility() + private void toggleContentVisibility() { content.ClearTransforms(); - Expanded = !Expanded; + expanded = !expanded; - if (Expanded) + if (expanded) content.AutoSizeAxes = Axes.Y; else { @@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play.PlayerSettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(Expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); + button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); } } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index fe8518c6a2..1a7b80ec9a 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -1,11 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; @@ -15,30 +12,6 @@ namespace osu.Game.Screens.Play.PlayerSettings { protected override string Title => "Visual settings"; - public IAdjustableClock AudioClock { get; set; } - public FramedClock FramedClock { get; set; } - - private bool autohide; - - public bool Autohide - { - get => autohide; - set - { - autohide = value; - if (autohide && hideStopWatch == null) - hideStopWatch = Stopwatch.StartNew(); - else if (!autohide) - { - this.FadeIn(50); - hideStopWatch = null; - } - } - } - - private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(3); - private Stopwatch hideStopWatch; - private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; @@ -74,34 +47,6 @@ namespace osu.Game.Screens.Play.PlayerSettings blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); - - ToggleContentVisibility(); - } - - protected override void ToggleContentVisibility() - { - base.ToggleContentVisibility(); - if (!Autohide) - return; - if (Expanded) - { - AudioClock.Stop(); - FramedClock.ProcessSourceClockFrames = false; - hideStopWatch.Stop(); - } - else - { - AudioClock.Start(); - FramedClock.ProcessSourceClockFrames = true; - hideStopWatch.Start(); - } - } - - protected override void Update() - { - base.Update(); - - if (Autohide && IsPresent && hideStopWatch.Elapsed > hideTimeSpan) this.FadeOut(50); } } } From ce4122b3c4240718d47f1bf87504ffd7381971be Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 26 Jan 2018 23:29:54 +0300 Subject: [PATCH 9/9] Display visual settings overlay on PlayerLoader screen --- osu.Game/Screens/Play/PlayerLoader.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index cf6c252bec..2950990779 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -13,6 +13,7 @@ using osu.Game.Screens.Backgrounds; using OpenTK; using osu.Framework.Localisation; using osu.Game.Screens.Menu; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Screens.Play { @@ -21,6 +22,7 @@ namespace osu.Game.Screens.Play private Player player; private BeatmapMetadataDisplay info; + private VisualSettings visualSettings; private bool showOverlays = true; public override bool ShowOverlaysOnEnter => showOverlays; @@ -49,6 +51,12 @@ namespace osu.Game.Screens.Play Anchor = Anchor.Centre, Origin = Anchor.Centre, }); + Add(visualSettings = new VisualSettings + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding(25) + }); LoadComponentAsync(player); } @@ -110,7 +118,7 @@ namespace osu.Game.Screens.Play private void pushWhenLoaded() { - if (player.LoadState != LoadState.Ready) + if (player.LoadState != LoadState.Ready || visualSettings.IsHovered) { Schedule(pushWhenLoaded); return;