From 8a407a68b3e94f438cc8fea88a319b8db326370f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 18:48:37 +0900 Subject: [PATCH 1/4] Ensure only one information overlay is open at once --- osu.Game/OsuGame.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fc5b607810..e603375e9c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -255,6 +255,22 @@ namespace osu.Game }; } + // eventually informational overlays should be displayed in a stack, but for now let's only allow one to stay open at a time. + var informationalOverlays = new OverlayContainer[] { beatmapSetOverlay, userProfile }; + foreach (var overlay in informationalOverlays) + { + overlay.StateChanged += state => + { + if (state == Visibility.Hidden) return; + + foreach (var c in informationalOverlays) + { + if (c == overlay) continue; + c.State = Visibility.Hidden; + } + }; + } + settings.StateChanged += delegate { switch (settings.State) From af03d883f168fbc3244fe7f51a4ad24307dbc4bb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 19:01:30 +0900 Subject: [PATCH 2/4] Ensure overlay containers scroll to top when new information is presented --- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 ++ osu.Game/Overlays/BeatmapSetOverlay.cs | 5 ++++- osu.Game/Overlays/UserProfileOverlay.cs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index 6e5c3c8183..1e2826189b 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -139,6 +139,8 @@ namespace osu.Game.Graphics.Containers public void ScrollTo(Drawable section) => scrollContainer.ScrollTo(scrollContainer.GetChildPosInContent(section) - (FixedHeader?.BoundingBox.Height ?? 0)); + public void ScrollToTop() => scrollContainer.ScrollTo(0); + private float lastKnownScroll; protected override void UpdateAfterChildren() { diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index ddd146bcb6..940ac433fc 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -30,6 +30,8 @@ namespace osu.Game.Overlays private APIAccess api; private RulesetStore rulesets; + private readonly ScrollContainer scroll; + // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; @@ -61,7 +63,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - new ScrollContainer + scroll = new ScrollContainer { RelativeSizeAxes = Axes.Both, ScrollbarVisible = false, @@ -120,6 +122,7 @@ namespace osu.Game.Overlays { header.BeatmapSet = info.BeatmapSet = set; Show(); + scroll.ScrollTo(0); } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index ce35f7e547..dd31a43290 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -164,6 +164,7 @@ namespace osu.Game.Overlays } Show(); + sectionsContainer.ScrollToTop(); } private void userLoadComplete(User user) From fda810eb8fc288b085670a18f2091da812c3122f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 19:02:56 +0900 Subject: [PATCH 3/4] Remove scrollability from sub-areas in beatmap overaly The areas that are scrollable inside the beatmap overlay make for a very frustrating experience. Let's disable them for now. --- osu.Game/Overlays/BeatmapSet/Info.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 4a59591a72..bd108a193b 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -74,20 +74,18 @@ namespace osu.Game.Overlays.BeatmapSet { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = metadata_width + BeatmapSetOverlay.RIGHT_WIDTH + spacing * 2 }, - Child = new ScrollContainer + Child = new Container { RelativeSizeAxes = Axes.Both, - ScrollbarVisible = false, Child = description = new MetadataSection("Description"), }, }, - new ScrollContainer + new Container { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = metadata_width, - ScrollbarVisible = false, Padding = new MarginPadding { Horizontal = 10 }, Margin = new MarginPadding { Right = BeatmapSetOverlay.RIGHT_WIDTH + spacing }, Child = new FillFlowContainer From 801104854092a5677e4531e7fb514b98801ee8c1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 20:03:18 +0900 Subject: [PATCH 4/4] Fix hard crash when clicking play button with no map selected Resolves #1507. --- osu.Game/Screens/Play/Player.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 675d20fe63..3e57e18963 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -231,6 +231,8 @@ namespace osu.Game.Screens.Play private void applyRateFromMods() { + if (adjustableSourceClock == null) return; + adjustableSourceClock.Rate = 1; foreach (var mod in Beatmap.Value.Mods.Value.OfType()) mod.ApplyToClock(adjustableSourceClock);