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; 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(); 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/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index e0f38a13d0..26a5c11d5d 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -94,8 +94,8 @@ namespace osu.Game.Graphics.UserInterface protected override void LoadComplete() { - updateTooltipText(Current.Value); base.LoadComplete(); + CurrentNumber.BindValueChanged(updateTooltipText, true); } protected override bool OnHover(HoverEvent e) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 2dbf7989d7..3dde3d2c60 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -364,11 +364,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) }); @@ -387,32 +387,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 { @@ -420,22 +420,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); @@ -654,10 +654,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; @@ -701,6 +701,7 @@ namespace osu.Game Beatmap.Disabled = applyBeatmapRulesetRestrictions; screenContainer.Padding = new MarginPadding { Top = ToolbarOffset }; + overlayContent.Padding = new MarginPadding { Top = ToolbarOffset }; MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; } 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); } } 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 { 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); 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 dac05c23b1..2fef8dc4f4 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -46,18 +46,21 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { - visibilityContainer = new Container { + 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 { + 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(), diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d5c99f5729..a3f46a285e 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 { @@ -82,7 +83,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 +200,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 +233,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); @@ -401,6 +402,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; Content.FadeOut(fadeOutDuration); + Background?.FadeColour(Color4.White, fadeOutDuration, Easing.OutQuint); } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; @@ -438,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?.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(Color4.Black, BACKGROUND_FADE_DURATION, Easing.OutQuint); } protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score); 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); } diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 3846b45d2f..61dc70c4ae 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; @@ -60,14 +61,14 @@ 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() { 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); } } 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);