diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index e41c568403..7d1d77ae96 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -6,6 +6,7 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; using osu.Framework.Input.Events; using osu.Game.Rulesets.Objects.Types; using osuTK.Graphics; @@ -14,7 +15,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { - public class SliderBall : CircularContainer, ISliderProgress + public class SliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition { private const float width = 128; @@ -107,18 +108,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private Vector2? lastScreenSpaceMousePosition; - protected override bool OnMouseDown(MouseDownEvent e) - { - lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition; - return base.OnMouseDown(e); - } - - protected override bool OnMouseUp(MouseUpEvent e) - { - lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition; - return base.OnMouseUp(e); - } - protected override bool OnMouseMove(MouseMoveEvent e) { lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition; diff --git a/osu.Game.Tests/Visual/Background/TestCaseBackgroundScreenBeatmap.cs b/osu.Game.Tests/Visual/Background/TestCaseBackgroundScreenBeatmap.cs index e56156752b..420a52c6b7 100644 --- a/osu.Game.Tests/Visual/Background/TestCaseBackgroundScreenBeatmap.cs +++ b/osu.Game.Tests/Visual/Background/TestCaseBackgroundScreenBeatmap.cs @@ -92,7 +92,7 @@ namespace osu.Game.Tests.Visual.Background public void PlayerLoaderSettingsHoverTest() { setupUserSettings(); - AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer()))); + AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer { BlockLoad = true }))); AddUntilStep("Wait for Player Loader to load", () => playerLoader?.IsLoaded ?? false); AddAssert("Background retained from song select", () => songSelect.IsBackgroundCurrent()); AddStep("Trigger background preview", () => @@ -255,14 +255,7 @@ namespace osu.Game.Tests.Visual.Background { setupUserSettings(); - AddStep("Start player loader", () => - { - songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer - { - AllowPause = allowPause, - Ready = true, - })); - }); + AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer { AllowPause = allowPause, }))); AddUntilStep("Wait for Player Loader to load", () => playerLoader.IsLoaded); AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos)); AddUntilStep("Wait for player to load", () => player.IsLoaded); @@ -351,7 +344,7 @@ namespace osu.Game.Tests.Visual.Background public UserDimContainer CurrentStoryboardContainer => StoryboardContainer; // Whether or not the player should be allowed to load. - public bool Ready; + public bool BlockLoad; public Bindable StoryboardEnabled; public readonly Bindable ReplacesBackground = new Bindable(); @@ -362,10 +355,11 @@ namespace osu.Game.Tests.Visual.Background public bool IsStoryboardInvisible() => ((TestUserDimContainer)CurrentStoryboardContainer).CurrentAlpha <= 1; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(OsuConfigManager config, CancellationToken token) { - while (!Ready) + while (BlockLoad && !token.IsCancellationRequested) Thread.Sleep(1); + StoryboardEnabled = config.GetBindable(OsuSetting.ShowStoryboard); ReplacesBackground.BindTo(Background.StoryboardReplacesBackground); DrawableRuleset.IsPaused.BindTo(IsPaused); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 7277990987..7ab4494a69 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -390,11 +390,9 @@ namespace osu.Game logoContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, - overlayContent = new Container - { - RelativeSizeAxes = Axes.Both, - }, - floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, + overlayContent = new Container { RelativeSizeAxes = Axes.Both }, + floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both }, + topMostOverlayContent = new Container { RelativeSizeAxes = Axes.Both }, idleTracker = new GameIdleTracker(6000) }); @@ -414,13 +412,12 @@ namespace osu.Game loadComponentSingleFile(Toolbar = new Toolbar { - Depth = -5, OnHome = delegate { CloseAllOverlays(false); menuScreen?.MakeCurrent(); }, - }, floatingOverlayContent.Add); + }, topMostOverlayContent.Add); loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add); loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); @@ -428,47 +425,32 @@ namespace osu.Game loadComponentSingleFile(screenshotManager, Add); //overlay elements - loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add); - loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add); + loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add); + loadComponentSingleFile(social = new SocialOverlay(), overlayContent.Add); loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal); - loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add); - loadComponentSingleFile(settings = new MainSettings + loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add); + loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset }, floatingOverlayContent.Add); + loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add); + loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add); + loadComponentSingleFile(notifications = new NotificationOverlay { GetToolbarHeight = () => ToolbarOffset, - Depth = -1 + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, }, 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, }, floatingOverlayContent.Add); - loadComponentSingleFile(notifications = new NotificationOverlay - { - GetToolbarHeight = () => ToolbarOffset, - Depth = -4, - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - }, floatingOverlayContent.Add); + loadComponentSingleFile(accountCreation = new AccountCreationOverlay(), topMostOverlayContent.Add); - loadComponentSingleFile(accountCreation = new AccountCreationOverlay - { - Depth = -6, - }, floatingOverlayContent.Add); + loadComponentSingleFile(dialogOverlay = new DialogOverlay(), topMostOverlayContent.Add); - loadComponentSingleFile(dialogOverlay = new DialogOverlay - { - Depth = -7, - }, floatingOverlayContent.Add); - - loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener - { - Depth = -8, - }, floatingOverlayContent.Add); + loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener(), topMostOverlayContent.Add); dependencies.CacheAs(idleTracker); dependencies.Cache(settings); @@ -714,6 +696,8 @@ namespace osu.Game private Container floatingOverlayContent; + private Container topMostOverlayContent; + private FrameworkConfigManager frameworkConfig; private ScalingContainer screenContainer; diff --git a/osu.Game/Screens/Multi/MultiplayerSubScreen.cs b/osu.Game/Screens/Multi/MultiplayerSubScreen.cs index ad72072981..65e501b114 100644 --- a/osu.Game/Screens/Multi/MultiplayerSubScreen.cs +++ b/osu.Game/Screens/Multi/MultiplayerSubScreen.cs @@ -14,8 +14,6 @@ namespace osu.Game.Screens.Multi { public override bool DisallowExternalBeatmapRulesetChanges => false; - public override bool RemoveWhenNotAlive => false; - public virtual string ShortTitle => Title; [Resolved(CanBeNull = true)] diff --git a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs index 90b5178169..78f9103a74 100644 --- a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs +++ b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs @@ -7,7 +7,6 @@ using osu.Framework.Graphics.Textures; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Rulesets; -using osuTK; namespace osu.Game.Tests.Beatmaps { @@ -68,7 +67,7 @@ namespace osu.Game.Tests.Beatmaps public override bool Seek(double seek) { - offset = MathHelper.Clamp(seek, 0, Length); + offset = Math.Min(seek, Length); lastReferenceTime = null; return true; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 71324ea0f0..eb5d0fd8ee 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -16,7 +16,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 02099a59bb..c3792a48a1 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + +