From 88d80016aa72499ec90e1d85ced314a9ad805cfe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 10:40:03 +0900 Subject: [PATCH 01/23] Fix out of bounds exception during indexing --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index f064d53358..41056a2536 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,8 +122,14 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; + if (l > 0) + { + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; + } + + // If the binary search failed, l will be unaffected + return list[l]; } } } From 117c514479bda0f92be4e430ec7a2887bb548edf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:07:25 +0900 Subject: [PATCH 02/23] Fix lazy slider calculation inaccuracy What were we doing... On /b/1221540 stable's repeat points happen 90% through the length of each span! We should use lazer's more accurate calculations. --- .../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs index d8e3b340c9..1752caf74b 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -101,8 +101,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing float approxFollowCircleRadius = (float)(slider.Radius * 3); var computeVertex = new Action(t => { - double progress = ((int)t - (int)slider.StartTime) / (float)(int)slider.SpanDuration; - if (progress % 2 > 1) + double progress = (t - slider.StartTime) / slider.SpanDuration; + if (progress % 2 >= 1) progress = 1 - progress % 1; else progress = progress % 1; From e44bc57a3da642d24f1e576953cc24b5ea234a15 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:15:52 +0900 Subject: [PATCH 03/23] Fix minDistanceFromEnd using seconds rather than milliseconds Velocity in stable is defined as distance per SECOND, while lazer defines it as distance per MILLISECOND. --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 44185fb83a..69da1bef6f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Osu.Objects if (tickDistance == 0) return; - var minDistanceFromEnd = Velocity * 0.01; + var minDistanceFromEnd = Velocity * 10; var spanCount = this.SpanCount(); From 5ecc07b729803c0c101c2a3783aa07995668837a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 20 Jan 2019 12:05:08 +0900 Subject: [PATCH 04/23] Revert "Fix out of bounds exception during indexing" This reverts commit 88d80016aa72499ec90e1d85ced314a9ad805cfe. --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index 41056a2536..f064d53358 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,14 +122,8 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - if (l > 0) - { - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; - } - - // If the binary search failed, l will be unaffected - return list[l]; + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; } } } From 4eb5e67075d1a100db4e597c56b15c890a9bf5eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 21 Jan 2019 19:34:35 +0900 Subject: [PATCH 05/23] Fix overlays not being correctly offset by toolbar padding --- osu.Game/OsuGame.cs | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 58af93a88b..f0a8d6ab56 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -359,11 +359,11 @@ namespace osu.Game { RelativeSizeAxes = Axes.Both, }, - mainContent = new Container + overlayContent = new Container { RelativeSizeAxes = Axes.Both, }, - overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, + floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, idleTracker = new IdleTracker(6000) }); @@ -382,32 +382,32 @@ namespace osu.Game CloseAllOverlays(false); intro?.ChildScreen?.MakeCurrent(); }, - }, overlayContent.Add); + }, floatingOverlayContent.Add); - loadComponentSingleFile(volume = new VolumeOverlay(), overlayContent.Add); + loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add); loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); loadComponentSingleFile(screenshotManager, Add); //overlay elements - loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); - loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, mainContent.Add); + loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add); + loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add); loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal); - loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, mainContent.Add); + loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add); loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset, Depth = -1 - }, overlayContent.Add); - loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); - loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, mainContent.Add); + }, floatingOverlayContent.Add); + loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add); + loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add); loadComponentSingleFile(musicController = new MusicController { Depth = -5, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(notifications = new NotificationOverlay { @@ -415,22 +415,22 @@ namespace osu.Game Depth = -4, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(accountCreation = new AccountCreationOverlay { Depth = -6, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(dialogOverlay = new DialogOverlay { Depth = -7, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener { Depth = -8, - }, overlayContent.Add); + }, floatingOverlayContent.Add); dependencies.Cache(idleTracker); dependencies.Cache(settings); @@ -649,10 +649,10 @@ namespace osu.Game public bool OnReleased(GlobalAction action) => false; - private Container mainContent; - private Container overlayContent; + private Container floatingOverlayContent; + private OsuScreen currentScreen; private FrameworkConfigManager frameworkConfig; private ScalingContainer screenContainer; @@ -696,6 +696,7 @@ namespace osu.Game Beatmap.Disabled = applyBeatmapRulesetRestrictions; screenContainer.Padding = new MarginPadding { Top = ToolbarOffset }; + overlayContent.Padding = new MarginPadding { Top = ToolbarOffset }; MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; } From 09553550a33848156d3ac1369f0c82d8561e1794 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 00:19:39 +0900 Subject: [PATCH 06/23] Remove remaining supporter check --- osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs index 8406dada44..658287eb71 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons { public class DownloadButton : HeaderButton, IHasTooltip { - public string TooltipText => Enabled ? null : "You gotta be an osu!supporter to download for now 'yo"; + public string TooltipText => "Download this beatmap"; private readonly IBindable localUser = new Bindable(); @@ -101,12 +101,9 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons private void load(APIAccess api) { localUser.BindTo(api.LocalUser); - localUser.BindValueChanged(userChanged, true); Enabled.BindValueChanged(enabledChanged, true); } - private void userChanged(User user) => Enabled.Value = user.IsSupporter; - private void enabledChanged(bool enabled) => this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint); } } From 09a2b287f9a227aa07b89463ac8c9948af6f9660 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 18:29:30 +0100 Subject: [PATCH 07/23] Fix Tooltip not updating in special case When the Bindvalue of the Sliderbar gets changed by a line like "Bindable.Value = ..." the sliderbar will only update the nubs but wont run any methods which contain the updateToolTipText(T value) function. Example scenario: Two interlinked sliderbars which change the value of each other in certain cases. --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index e0f38a13d0..23766e22a1 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,6 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); + CurrentNumber.ValueChanged += _ => updateTooltipText(_); } protected override bool OnHover(HoverEvent e) @@ -126,7 +127,6 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); - updateTooltipText(value); } private void playSample(T value) From 3f96231b2f65fa700bb33c7363f7897fb294ee66 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 19:34:26 +0100 Subject: [PATCH 08/23] convert to method group --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 23766e22a1..84e1882dea 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += _ => updateTooltipText(_); + CurrentNumber.ValueChanged += updateTooltipText; } protected override bool OnHover(HoverEvent e) From cabcfffdeb2960df5cb1fc4b0fee19e26253350b Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 01:16:37 +0100 Subject: [PATCH 09/23] Fix autoplay rewind/skip usable when UI hidden --- osu.Game/Screens/Play/HUDOverlay.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index dac05c23b1..8d50b58c3b 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -102,6 +102,7 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); + showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) From f01ba17d1f3ee0f73666a63ce315d3fe1cd78646 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:12:40 +0100 Subject: [PATCH 10/23] add check if replay is loaded before allowseeking can be overwitten --- osu.Game/Screens/Play/SongProgress.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 336f9cc430..a892b9afd6 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - + if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 12503b4d074b1243a4fb986a0db87918c1106571 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:37:17 +0100 Subject: [PATCH 11/23] revert and make VisibilityContainer not AlwaysPresent --- osu.Game/Screens/Play/HUDOverlay.cs | 2 -- osu.Game/Screens/Play/SongProgress.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 8d50b58c3b..cbd36d75c6 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -48,7 +48,6 @@ namespace osu.Game.Screens.Play { visibilityContainer = new Container { RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated Children = new Drawable[] { new Container { Anchor = Anchor.TopCentre, @@ -102,7 +101,6 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); - showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index a892b9afd6..328f54423d 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,6 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 13ba9d64d09a8fa2a8aa28bce02691368c23a655 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:56:00 +0100 Subject: [PATCH 12/23] revert empty line --- osu.Game/Screens/Play/SongProgress.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 328f54423d..336f9cc430 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,6 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; + allowSeeking = value; updateBarVisibility(); } From 47181cf5d76c42904e7eb01653b960e36d57e94e Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:21:09 +0100 Subject: [PATCH 13/23] add back update in onUserChange --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 84e1882dea..294d7da40f 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -127,6 +127,7 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); + updateTooltipText(value); } private void playSample(T value) From fe5d34a6573895d70184fa96079eddbfa2508e61 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:25:56 +0100 Subject: [PATCH 14/23] replace as requested --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 294d7da40f..9db7af48b2 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += updateTooltipText; + CurrentNumber.BindValueChanged(updateTooltipText, true); } protected override bool OnHover(HoverEvent e) From 260011fc13a4066584ca834e1a994905aa4bae22 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 04:05:03 +0100 Subject: [PATCH 15/23] remove manual update misunderstood that earlier --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 9db7af48b2..26a5c11d5d 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -94,7 +94,6 @@ namespace osu.Game.Graphics.UserInterface protected override void LoadComplete() { - updateTooltipText(Current.Value); base.LoadComplete(); CurrentNumber.BindValueChanged(updateTooltipText, true); } From f107a922b42593148ddc12885ac6b6ecf23dd110 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:43:23 +0900 Subject: [PATCH 16/23] Add tests for key counter inside player heirarchy --- osu.Game.Tests/Visual/TestCaseAutoplay.cs | 9 ++++++++- osu.Game/Screens/Play/Player.cs | 8 ++++---- osu.Game/Tests/Visual/TestCasePlayer.cs | 9 ++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseAutoplay.cs b/osu.Game.Tests/Visual/TestCaseAutoplay.cs index 4abfec4371..d81dcb3799 100644 --- a/osu.Game.Tests/Visual/TestCaseAutoplay.cs +++ b/osu.Game.Tests/Visual/TestCaseAutoplay.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.ComponentModel; using System.Linq; using osu.Game.Rulesets; @@ -23,11 +24,17 @@ namespace osu.Game.Tests.Visual }; } - protected override bool ContinueCondition(Player player) => base.ContinueCondition(player) && ((ScoreAccessiblePlayer)player).ScoreProcessor.TotalScore > 0; + protected override void AddCheckSteps(Func player) + { + base.AddCheckSteps(player); + AddUntilStep(() => ((ScoreAccessiblePlayer)player()).ScoreProcessor.TotalScore > 0, "score above zero"); + AddUntilStep(() => ((ScoreAccessiblePlayer)player()).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 0), "key counter counted keys"); + } private class ScoreAccessiblePlayer : Player { public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; + public new HUDOverlay HUDOverlay => base.HUDOverlay; } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d5c99f5729..5ae50adb72 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play protected ScoreProcessor ScoreProcessor; protected RulesetContainer RulesetContainer; - private HUDOverlay hudOverlay; + protected HUDOverlay HUDOverlay; private FailOverlay failOverlay; private DrawableStoryboard storyboard; @@ -199,7 +199,7 @@ namespace osu.Game.Screens.Play { Child = RulesetContainer.Cursor?.CreateProxy() ?? new Container(), }, - hudOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, offsetClock, adjustableClock) + HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, offsetClock, adjustableClock) { Clock = Clock, // hud overlay doesn't want to use the audio clock directly ProcessCustomClock = false, @@ -232,8 +232,8 @@ namespace osu.Game.Screens.Play } }; - hudOverlay.HoldToQuit.Action = performUserRequestedExit; - hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); + HUDOverlay.HoldToQuit.Action = performUserRequestedExit; + HUDOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 47bf787bb5..d52a406915 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual { Player p = null; AddStep(ruleset.RulesetInfo.Name, () => p = loadPlayerFor(ruleset)); - AddUntilStep(() => ContinueCondition(p)); + AddCheckSteps(() => p); } else { @@ -52,7 +52,7 @@ namespace osu.Game.Tests.Visual { Player p = null; AddStep(r.Name, () => p = loadPlayerFor(r)); - AddUntilStep(() => ContinueCondition(p)); + AddCheckSteps(() => p); AddUntilStep(() => { @@ -79,7 +79,10 @@ namespace osu.Game.Tests.Visual } } - protected virtual bool ContinueCondition(Player player) => player.IsLoaded; + protected virtual void AddCheckSteps(Func player) + { + AddUntilStep(() => player().IsLoaded, "player loaded"); + } protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo); From 49633b3394cca135abadd6393dabd97ebc64a7d1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:51:06 +0900 Subject: [PATCH 17/23] Fix key counter receptor getting overwritten by async load drawables --- osu.Game/Rulesets/UI/RulesetContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index c8c7f3154b..0ea3377952 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -250,14 +250,14 @@ namespace osu.Game.Rulesets.UI [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - KeyBindingInputManager.Children = new Drawable[] + KeyBindingInputManager.AddRange(new Drawable[] { content = new Container { RelativeSizeAxes = Axes.Both, }, Playfield - }; + }); if (Cursor != null) KeyBindingInputManager.Add(Cursor); From c18ce2c23a773d34db552cd226e1d29464b9570c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:51:13 +0900 Subject: [PATCH 18/23] Formatting fixes --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 16 ++++++++-------- osu.Game/Screens/Play/HUDOverlay.cs | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index a76942e3fa..e85a048c34 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -27,14 +27,6 @@ namespace osu.Game.Rulesets.UI public abstract class RulesetInputManager : PassThroughInputManager, ICanAttachKeyCounter, IHasReplayHandler where T : struct { - public class RulesetKeyBindingContainer : DatabasedKeyBindingContainer - { - public RulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) - : base(ruleset, variant, unique) - { - } - } - protected override InputState CreateInitialState() { var state = base.CreateInitialState(); @@ -251,6 +243,14 @@ namespace osu.Game.Rulesets.UI protected virtual RulesetKeyBindingContainer CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) => new RulesetKeyBindingContainer(ruleset, variant, unique); + + public class RulesetKeyBindingContainer : DatabasedKeyBindingContainer + { + public RulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) + : base(ruleset, variant, unique) + { + } + } } /// diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cbd36d75c6..2fef8dc4f4 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -46,17 +46,21 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { - visibilityContainer = new Container { + visibilityContainer = new Container + { RelativeSizeAxes = Axes.Both, - Children = new Drawable[] { - new Container { + Children = new Drawable[] + { + new Container + { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Y = 30, AutoSizeAxes = Axes.Both, AutoSizeDuration = 200, AutoSizeEasing = Easing.Out, - Children = new Drawable[] { + Children = new Drawable[] + { AccuracyCounter = CreateAccuracyCounter(), ScoreCounter = CreateScoreCounter(), ComboCounter = CreateComboCounter(), From f4ebab2d3ace823dc7c251136c7dc4ceeed54e7b Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 08:52:25 +0100 Subject: [PATCH 19/23] Fix backgrounds being transparent in some scaling modes by replacing `.FadeTo` at the necessary places with `.FadeColour`. restoring the `.FadeColour` in `fadeOut` of the Player Screen which is ran in every exit scenario. --- osu.Game/Screens/Play/Player.cs | 3 ++- osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d5c99f5729..d833a8f83d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -401,6 +401,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; Content.FadeOut(fadeOutDuration); + Background?.FadeColour(OsuColour.Gray(1f), fadeOutDuration, Easing.OutQuint); } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; @@ -438,7 +439,7 @@ namespace osu.Game.Screens.Play .FadeTo(storyboardVisible && BackgroundOpacity > 0 ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint); if (storyboardVisible && beatmap.Storyboard.ReplacesBackground) - Background?.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(OsuColour.Gray(0f), BACKGROUND_FADE_DURATION, Easing.OutQuint); } protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score); diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 3846b45d2f..890103485a 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -6,6 +6,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Screens; using osu.Game.Configuration; +using osu.Game.Graphics; using osu.Game.Screens.Backgrounds; using osuTK; @@ -67,7 +68,7 @@ namespace osu.Game.Screens.Play { if (!IsCurrentScreen) return; - Background?.FadeTo(BackgroundOpacity, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(OsuColour.Gray(BackgroundOpacity), BACKGROUND_FADE_DURATION, Easing.OutQuint); Background?.BlurTo(new Vector2((float)BlurLevel.Value * 25), BACKGROUND_FADE_DURATION, Easing.OutQuint); } } From bb56c4a1a79e8f16adb210ae2a2b6b052dbf9441 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 09:08:34 +0100 Subject: [PATCH 20/23] use Color4.Black and White + using osuTK.Graphics --- osu.Game/Screens/Play/Player.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d833a8f83d..f243f1016d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -32,6 +32,7 @@ using osu.Game.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Skinning; using osu.Game.Storyboards.Drawables; +using osuTK.Graphics; namespace osu.Game.Screens.Play { @@ -401,7 +402,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; Content.FadeOut(fadeOutDuration); - Background?.FadeColour(OsuColour.Gray(1f), fadeOutDuration, Easing.OutQuint); + Background?.FadeColour(Color4.White, fadeOutDuration, Easing.OutQuint); } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; @@ -439,7 +440,7 @@ namespace osu.Game.Screens.Play .FadeTo(storyboardVisible && BackgroundOpacity > 0 ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint); if (storyboardVisible && beatmap.Storyboard.ReplacesBackground) - Background?.FadeColour(OsuColour.Gray(0f), BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(Color4.Black, BACKGROUND_FADE_DURATION, Easing.OutQuint); } protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score); From 4180ca75bca22e452a1d2de6083a39024dfdd4f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 17:14:08 +0900 Subject: [PATCH 21/23] Fix typo in comment --- osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 890103485a..61dc70c4ae 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -61,7 +61,7 @@ namespace osu.Game.Screens.Play protected virtual void InitializeBackgroundElements() => UpdateBackgroundElements(); /// - /// Called wen background elements require updates, usually due to a user changing a setting. + /// Called when background elements require updates, usually due to a user changing a setting. /// /// protected virtual void UpdateBackgroundElements() From 1025c51e0de90c64ec8a6276414878f31610df22 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 17:30:05 +0900 Subject: [PATCH 22/23] Allow filtering settings matching based on dropdown content --- osu.Game/Overlays/Settings/SettingsDropdown.cs | 2 ++ osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index 1c3eb6c245..864147c21d 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Settings } } + public override IEnumerable FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.ToString())); + protected sealed override Drawable CreateControl() => CreateDropdown(); protected virtual OsuDropdown CreateDropdown() => new DropdownControl { Items = Items }; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 1d7e6350ae..cf25e80820 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -72,7 +72,7 @@ namespace osu.Game.Overlays.Settings } } - public IEnumerable FilterTerms => new[] { LabelText }; + public virtual IEnumerable FilterTerms => new[] { LabelText }; public bool MatchingFilter { From 03e3247bafe8bdbf03b414f128d8642bd5a58fa1 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 09:40:38 +0100 Subject: [PATCH 23/23] replace FadeTo in PlayerLoader didnt notice that interaction yet. yes this makes it neccessary. --- osu.Game/Screens/Play/PlayerLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index ded25f013a..44866846d2 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play protected override void InitializeBackgroundElements() { - Background?.FadeTo(1, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(Color4.White, BACKGROUND_FADE_DURATION, Easing.OutQuint); Background?.BlurTo(background_blur, BACKGROUND_FADE_DURATION, Easing.OutQuint); }