1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:42:56 +08:00

Stop time whenever visual settings are expanded

This commit is contained in:
TocoToucan 2018-01-11 01:24:34 +03:00
parent c48c7b085c
commit 98851e4a78
3 changed files with 18 additions and 7 deletions

View File

@ -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<double> 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;
}
}
}
}

View File

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

View File

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