From f9faf8e3d826610200e5d32a2e8f2c455a528883 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Feb 2018 22:01:52 +0900 Subject: [PATCH] Localise offset clock usage out of Player as much as possible --- osu.Game/Screens/Play/Player.cs | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e89d522d90..cab791f3a5 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -56,11 +56,6 @@ namespace osu.Game.Screens.Play private IAdjustableClock sourceClock; - /// - /// The final usable gameplay clock with user-set offsets applied. - /// - private FramedOffsetClock offsetClock; - /// /// The decoupled clock used for gameplay. Should be used for seeks and clock control. /// @@ -156,7 +151,8 @@ namespace osu.Game.Screens.Play adjustableClock.ProcessFrame(); - offsetClock = new FramedOffsetClock(adjustableClock); + // the final usable gameplay clock with user-set offsets applied. + var offsetClock = new FramedOffsetClock(adjustableClock); userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); userAudioOffset.ValueChanged += v => offsetClock.Offset = v; @@ -179,28 +175,23 @@ namespace osu.Game.Screens.Play OnResume = () => hudOverlay.KeyCounter.IsCounting = true, Children = new Drawable[] { - new Container + storyboardContainer = new Container { RelativeSizeAxes = Axes.Both, - Clock = offsetClock, - ProcessCustomClock = false, - Children = new[] - { - storyboardContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - }, - RulesetContainer, - } + Alpha = 0, }, + RulesetContainer, new SkipButton(firstObjectTime) { + Clock = Clock, // skip button doesn't want to use the audio clock directly + ProcessCustomClock = false, AdjustableClock = adjustableClock, FramedClock = offsetClock, }, hudOverlay = new HUDOverlay(scoreProcessor, RulesetContainer, working, offsetClock, adjustableClock) { + Clock = Clock, // hud overlay doesn't want to use the audio clock directly + ProcessCustomClock = false, Anchor = Anchor.Centre, Origin = Anchor.Centre }, @@ -208,7 +199,6 @@ namespace osu.Game.Screens.Play { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Clock = offsetClock, ProcessCustomClock = false, Breaks = beatmap.Breaks }