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); } } }