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 @@ +