diff --git a/osu-framework b/osu-framework index a4f3010768..8afa4fa7ae 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a4f301076810571bebe9595af7aeaa3c77ac0c59 +Subproject commit 8afa4fa7ae9bbd5f357f859b1cc944c78286751a diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 113e165d6a..14c44bbb43 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -27,16 +27,12 @@ namespace osu.Desktop.VisualTests.Tests public override string Description => @"Showing hitobjects and what not."; - FramedClock localClock; - - protected override IFrameBasedClock Clock => localClock; - public override void Reset() { base.Reset(); //ensure we are at offset 0 - localClock = new FramedClock(); + Clock = new FramedClock(); List objects = new List(); @@ -93,7 +89,7 @@ namespace osu.Desktop.VisualTests.Tests protected override void Update() { base.Update(); - localClock.ProcessFrame(); + Clock.ProcessFrame(); } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 2ea43ab175..31a1bc369e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -19,21 +19,17 @@ namespace osu.Desktop.VisualTests.Tests { public override string Name => @"Hit Objects"; - IFrameBasedClock ourClock; - - protected override IFrameBasedClock Clock => ourClock; - public TestCaseHitObjects() { var swClock = new StopwatchClock(true) { Rate = 1 }; - ourClock = new FramedClock(swClock); + Clock = new FramedClock(swClock); } public override void Reset() { base.Reset(); - ourClock.ProcessFrame(); + Clock.ProcessFrame(); Container approachContainer = new Container { Depth = float.MaxValue, }; @@ -45,7 +41,7 @@ namespace osu.Desktop.VisualTests.Tests { var h = new HitCircle { - StartTime = ourClock.CurrentTime + 1000 + i * 80, + StartTime = Clock.CurrentTime + 1000 + i * 80, Position = new Vector2((i - count / 2) * 14), }; @@ -65,7 +61,7 @@ namespace osu.Desktop.VisualTests.Tests protected override void Update() { base.Update(); - ourClock.ProcessFrame(); + Clock.ProcessFrame(); } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs index 72ab3b7a7f..2be742580a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs @@ -13,20 +13,17 @@ namespace osu.Desktop.VisualTests.Tests public override string Name => @"Music Controller"; public override string Description => @"Tests music controller ui."; - IFrameBasedClock ourClock; - protected override IFrameBasedClock Clock => ourClock; - protected MusicController mc; public TestCaseMusicController() { - ourClock = new FramedClock(); + Clock = new FramedClock(); } public override void Reset() { base.Reset(); - ourClock.ProcessFrame(); + Clock.ProcessFrame(); mc = new MusicController { Origin = Anchor.Centre, @@ -39,7 +36,7 @@ namespace osu.Desktop.VisualTests.Tests protected override void Update() { base.Update(); - ourClock.ProcessFrame(); + Clock.ProcessFrame(); } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 5a89d4bc8d..da21b38ec8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -8,8 +8,6 @@ using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Formats; using OpenTK; -using osu.Framework; -using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using osu.Game.Modes.Objects; using osu.Game.Modes.Osu.Objects; @@ -24,16 +22,12 @@ namespace osu.Desktop.VisualTests.Tests public override string Description => @"Showing everything to play the game."; - FramedClock localClock; - - protected override IFrameBasedClock Clock => localClock; - public override void Reset() { base.Reset(); //ensure we are at offset 0 - localClock = new FramedClock(); + Clock = new FramedClock(); var objects = new List(); @@ -75,7 +69,7 @@ namespace osu.Desktop.VisualTests.Tests protected override void Update() { base.Update(); - localClock.ProcessFrame(); + Clock.ProcessFrame(); } } } diff --git a/osu.Game/Screens/Play/PlaySongSelect.cs b/osu.Game/Screens/Play/PlaySongSelect.cs index 073c0b4f3b..9d5eca8bb3 100644 --- a/osu.Game/Screens/Play/PlaySongSelect.cs +++ b/osu.Game/Screens/Play/PlaySongSelect.cs @@ -103,6 +103,7 @@ namespace osu.Game.Screens.Play }, wedgedContainer = new Container { + Alpha = 0, Position = wedged_container_start_position, Size = wedged_container_size, Margin = new MarginPadding { Top = 20, Right = 20, }, @@ -179,17 +180,31 @@ namespace osu.Game.Screens.Play { base.OnEntering(last); ensurePlayingSelected(); - backgroundWedgesContainer.FadeInFromZero(250); changeBackground(Beatmap); + + Content.FadeInFromZero(250); } protected override void OnResuming(GameMode last) { changeBackground(Beatmap); - ensurePlayingSelected(); base.OnResuming(last); + + Content.FadeIn(250); + } + + protected override void OnSuspending(GameMode next) + { + Content.FadeOut(250); + base.OnSuspending(next); + } + + protected override bool OnExiting(GameMode next) + { + Content.FadeOut(100); + return base.OnExiting(next); } protected override void Dispose(bool isDisposing) @@ -232,6 +247,8 @@ namespace osu.Game.Screens.Play oldWedgedBeatmapInfo.Expire(); } + wedgedContainer.FadeIn(250); + BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo; BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; wedgedContainer.Add(wedgedBeatmapInfo = new BufferedContainer @@ -252,7 +269,7 @@ namespace osu.Game.Screens.Play }, // We use a container, such that we can set the colour gradient to go across the // vertices of the masked container instead of the vertices of the (larger) sprite. - new Container + beatmap.Background == null ? new Container() : new Container { RelativeSizeAxes = Axes.Both, ColourInfo = ColourInfo.GradientVertical(Color4.White, new Color4(1f, 1f, 1f, 0.3f)), diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c4641b9b6a..90abf55421 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -32,10 +32,7 @@ namespace osu.Game.Screens.Play public BeatmapInfo BeatmapInfo; public PlayMode PreferredPlayMode; - - protected override IFrameBasedClock Clock => playerClock; - - private InterpolatingFramedClock playerClock; + private IAdjustableClock sourceClock; private Ruleset ruleset; @@ -64,7 +61,7 @@ namespace osu.Game.Screens.Play } sourceClock = (IAdjustableClock)track ?? new StopwatchClock(); - playerClock = new InterpolatingFramedClock(sourceClock); + Clock = new InterpolatingFramedClock(sourceClock); Schedule(() => { @@ -118,7 +115,7 @@ namespace osu.Game.Screens.Play protected override void Update() { base.Update(); - playerClock.ProcessFrame(); + Clock.ProcessFrame(); } class PlayerInputManager : UserInputManager