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 @@ protected override void ToggleContentVisibility()
{
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 @@ public virtual void BindRulesetContainer(RulesetContainer rulesetContainer)
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 @@ private void load(AudioManager audio, OsuConfigManager config, APIAccess api)
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;