From f8c6ce15c395a6faadeaa2fde8f1c7a9d1ef6f4c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 13:45:16 +0900 Subject: [PATCH 01/10] Fix weird RollingCounter behaviour. --- osu.Game/Graphics/UserInterface/RollingCounter.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 12eeb771dd..869ee37e11 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -108,8 +108,6 @@ namespace osu.Game.Graphics.UserInterface { base.LoadComplete(); - Flush(false, TransformType); - DisplayedCountSpriteText.Text = FormatCount(Current); DisplayedCountSpriteText.Anchor = Anchor; DisplayedCountSpriteText.Origin = Origin; @@ -205,8 +203,8 @@ namespace osu.Game.Graphics.UserInterface ? GetProportionalDuration(currentValue, newValue) : RollingDuration; - transform.StartTime = Time.Current; - transform.EndTime = Time.Current + rollingTotalDuration; + transform.StartTime = TransformStartTime; + transform.EndTime = TransformStartTime + rollingTotalDuration; transform.StartValue = currentValue; transform.EndValue = newValue; transform.Easing = RollingEasing; From 7ca0d6d11738975945e7a2b0798e12e137badf05 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 16:44:12 +0900 Subject: [PATCH 02/10] Adjust cursor popin/out to make it less ugly. --- osu.Game/Graphics/Cursor/MenuCursor.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 0fb7f59212..ceb3296bdf 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -80,14 +80,12 @@ namespace osu.Game.Graphics.Cursor protected override void PopIn() { ActiveCursor.FadeTo(1, 250, EasingTypes.OutQuint); - ActiveCursor.ScaleTo(1, 1000, EasingTypes.OutElastic); + ActiveCursor.ScaleTo(1, 400, EasingTypes.OutQuint); } protected override void PopOut() { - ActiveCursor.FadeTo(0, 1400, EasingTypes.OutQuint); - ActiveCursor.ScaleTo(1.1f, 100, EasingTypes.Out); - ActiveCursor.Delay(100); + ActiveCursor.FadeTo(0, 900, EasingTypes.OutQuint); ActiveCursor.ScaleTo(0, 500, EasingTypes.In); } From 9732110bd95b1435ab9010217d7d509943ac27f2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 17:25:56 +0900 Subject: [PATCH 03/10] Update TransformTo methods in line with framework changes. --- osu.Game/Graphics/IHasAccentColour.cs | 2 +- osu.Game/Overlays/DragBar.cs | 2 +- osu.Game/Screens/Tournament/ScrollingTeamContainer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/IHasAccentColour.cs b/osu.Game/Graphics/IHasAccentColour.cs index f959bc8760..e4647f22fd 100644 --- a/osu.Game/Graphics/IHasAccentColour.cs +++ b/osu.Game/Graphics/IHasAccentColour.cs @@ -28,7 +28,7 @@ namespace osu.Game.Graphics /// The tween easing. public static void FadeAccent(this IHasAccentColour accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) { - accentedDrawable.TransformTo(accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent()); + accentedDrawable.TransformTo(() => accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent()); } } } diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 90991bb195..53a01c9e9c 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -65,7 +65,7 @@ namespace osu.Game.Overlays private void updatePosition(float position) { position = MathHelper.Clamp(position, 0, 1); - fill.TransformTo(fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek()); + fill.TransformTo(() => fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek()); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index b80f76d281..08f270741c 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -298,7 +298,7 @@ namespace osu.Game.Screens.Tournament private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) { DelayReset(); - TransformTo(speed, value, duration, easing, new TransformScrollSpeed()); + TransformTo(() => speed, value, duration, easing, new TransformScrollSpeed()); } private enum ScrollState From 7d7bea7198fd472e8c9243fef80a0ebddcbe1100 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 18:40:39 +0900 Subject: [PATCH 04/10] Fix crash on restart after update. Also make update process more graceful. --- osu.Desktop/Overlays/VersionManager.cs | 9 +++++++-- osu.Game/OsuGame.cs | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 70925f6cf4..9532652bfe 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -189,19 +189,24 @@ namespace osu.Desktop.Overlays private class UpdateProgressNotification : ProgressNotification { + private OsuGame game; + protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification() { Text = @"Update ready to install. Click to restart!", Activated = () => { - UpdateManager.RestartApp(); + UpdateManager.RestartAppWhenExited(); + game.GracefullyExit(); return true; } }; [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, OsuGame game) { + this.game = game; + IconContent.Add(new Drawable[] { new Box diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 7172aba3be..ccea6ef458 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -307,6 +307,18 @@ namespace osu.Game return base.OnExiting(); } + /// + /// Use to programatically exit the game as if the user was triggering via alt-f4. + /// Will keep persisting until an exit occurs (exit may be blocked multiple times). + /// + public void GracefullyExit() + { + if (!OnExiting()) + Exit(); + else + Scheduler.AddDelayed(GracefullyExit, 2000); + } + protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); From 1a2db87668d254315cbd2a1d52cbb9dc902354a3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 19:19:54 +0900 Subject: [PATCH 05/10] Fix osu! mode adding combos twice. --- osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs index 0bd587e8ea..00c797e97d 100644 --- a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs @@ -30,21 +30,6 @@ namespace osu.Game.Modes.Osu.Scoring protected override void OnNewJudgement(OsuJudgement judgement) { - if (judgement != null) - { - switch (judgement.Result) - { - case HitResult.Hit: - Combo.Value++; - Health.Value += 0.1f; - break; - case HitResult.Miss: - Combo.Value = 0; - Health.Value -= 0.2f; - break; - } - } - int score = 0; int maxScore = 0; From 9e6fa965b21003966c21372e4623280953dcf601 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 19:38:03 +0900 Subject: [PATCH 06/10] TestCasePlayer doesn't need a PlayerLoader. --- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index f36889b02a..624723ed35 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -83,10 +83,7 @@ namespace osu.Desktop.VisualTests.Tests Colour = Color4.Black, }); - Add(new PlayerLoader(Player = CreatePlayer(beatmap)) - { - Beatmap = beatmap - }); + Add(Player = CreatePlayer(beatmap)); } protected virtual Player CreatePlayer(WorkingBeatmap beatmap) From 1a1607aaaa0c0e240f6f0d5aa12650a556a079b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 19:58:57 +0900 Subject: [PATCH 07/10] Improve the look of the transition on hotkey retry (and retry in general). --- osu.Game/Screens/Play/Player.cs | 35 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a7108eda1b..94e82860f2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -116,7 +116,12 @@ namespace osu.Game.Screens.Play scoreProcessor = HitRenderer.CreateScoreProcessor(); - hudOverlay = new StandardHudOverlay(); + hudOverlay = new StandardHudOverlay() + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }; + hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys()); hudOverlay.BindProcessor(scoreProcessor); hudOverlay.BindHitRenderer(HitRenderer); @@ -160,7 +165,12 @@ namespace osu.Game.Screens.Play }, new HotkeyRetryOverlay { - Action = Restart, + Action = () => { + //we want to hide the hitrenderer immediately (looks better). + //we may be able to remove this once the mouse cursor trail is improved. + HitRenderer?.Hide(); + Restart(); + }, } }; } @@ -304,8 +314,7 @@ namespace osu.Game.Screens.Play protected override void OnSuspending(Screen next) { - Content.FadeOut(350); - Content.ScaleTo(0.7f, 750, EasingTypes.InQuint); + fadeOut(); base.OnSuspending(next); } @@ -324,14 +333,22 @@ namespace osu.Game.Screens.Play } } - HitRenderer?.FadeOut(60); - - FadeOut(250); - Content.ScaleTo(0.7f, 750, EasingTypes.InQuint); - Background?.FadeTo(1f, 200); + fadeOut(); return base.OnExiting(next); } + private void fadeOut() + { + const float fade_out_duration = 250; + + HitRenderer?.FadeOut(fade_out_duration); + Content.FadeOut(fade_out_duration); + + hudOverlay.ScaleTo(0.7f, fade_out_duration * 3, EasingTypes.In); + + Background?.FadeTo(1f, fade_out_duration); + } + private Bindable mouseWheelDisabled; protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused; From f64af9bce3b3ca839f3efebd4410028b774dc911 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 23:59:08 +0900 Subject: [PATCH 08/10] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 1490f00327..4caf0c918e 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1490f003273d7aab6589e489f6e4b02d204c9f27 +Subproject commit 4caf0c918edfd9d3be0358e2b2cfc4d40908e330 From a1aed44f109c0e38d9da85bea51f2e6a4ed6094c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Apr 2017 00:05:21 +0900 Subject: [PATCH 09/10] Fix health not being calculated in osu! mode (regression). --- osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs index 00c797e97d..3b798a2fad 100644 --- a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs @@ -30,6 +30,19 @@ namespace osu.Game.Modes.Osu.Scoring protected override void OnNewJudgement(OsuJudgement judgement) { + if (judgement != null) + { + switch (judgement.Result) + { + case HitResult.Hit: + Health.Value += 0.1f; + break; + case HitResult.Miss: + Health.Value -= 0.2f; + break; + } + } + int score = 0; int maxScore = 0; From bc98e53aff3c5aa934942950fff73fb815a3d74f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 12 Apr 2017 00:09:45 +0900 Subject: [PATCH 10/10] I helped. --- osu.Game/Screens/Play/Player.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 94e82860f2..e2712a64e4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -168,7 +168,7 @@ namespace osu.Game.Screens.Play Action = () => { //we want to hide the hitrenderer immediately (looks better). //we may be able to remove this once the mouse cursor trail is improved. - HitRenderer?.Hide(); + HitRenderer?.Hide(); Restart(); }, } @@ -353,4 +353,4 @@ namespace osu.Game.Screens.Play protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused; } -} \ No newline at end of file +}