From cb2b14e501aefd9133af3b5090e11d043316de60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 14:18:06 +0900 Subject: [PATCH 1/6] Centralise fullscreen overlay logic --- osu.Game/Overlays/BeatmapSetOverlay.cs | 23 +------- osu.Game/Overlays/DirectOverlay.cs | 11 +--- osu.Game/Overlays/FullscreenOverlay.cs | 58 +++++++++++++++++++ .../SearchableList/SearchableListOverlay.cs | 4 +- osu.Game/Overlays/SocialOverlay.cs | 19 ++---- osu.Game/Overlays/UserProfileOverlay.cs | 37 +----------- 6 files changed, 70 insertions(+), 82 deletions(-) create mode 100644 osu.Game/Overlays/FullscreenOverlay.cs diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 82bac71f5e..5cfdd4050b 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -4,10 +4,8 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; using osu.Game.Beatmaps; @@ -19,11 +17,10 @@ using osu.Game.Overlays.BeatmapSet; using osu.Game.Overlays.BeatmapSet.Scores; using osu.Game.Rulesets; using osuTK; -using osuTK.Graphics; namespace osu.Game.Overlays { - public class BeatmapSetOverlay : WaveOverlayContainer + public class BeatmapSetOverlay : FullscreenOverlay { private const int fade_duration = 300; @@ -46,24 +43,6 @@ namespace osu.Game.Overlays { Info info; ScoresContainer scores; - Waves.FirstWaveColour = OsuColour.Gray(0.4f); - Waves.SecondWaveColour = OsuColour.Gray(0.3f); - Waves.ThirdWaveColour = OsuColour.Gray(0.2f); - Waves.FourthWaveColour = OsuColour.Gray(0.1f); - - Anchor = Anchor.TopCentre; - Origin = Anchor.TopCentre; - RelativeSizeAxes = Axes.Both; - Width = 0.85f; - - Masking = true; - EdgeEffect = new EdgeEffectParameters - { - Colour = Color4.Black.Opacity(0), - Type = EdgeEffectType.Shadow, - Radius = 3, - Offset = new Vector2(0f, 1f), - }; Children = new Drawable[] { diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 40c4c90fca..975bf4e3ca 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -14,7 +14,6 @@ using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Direct; using osu.Game.Overlays.SearchableList; @@ -28,7 +27,6 @@ namespace osu.Game.Overlays { private const float panel_padding = 10f; - private IAPIProvider api; private RulesetStore rulesets; private readonly FillFlowContainer resultCountsContainer; @@ -87,8 +85,6 @@ namespace osu.Game.Overlays public DirectOverlay() { - RelativeSizeAxes = Axes.Both; - // osu!direct colours are not part of the standard palette Waves.FirstWaveColour = OsuColour.FromHex(@"19b0e2"); @@ -165,9 +161,8 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(OsuColour colours, IAPIProvider api, RulesetStore rulesets, PreviewTrackManager previewTrackManager) + private void load(OsuColour colours, RulesetStore rulesets, PreviewTrackManager previewTrackManager) { - this.api = api; this.rulesets = rulesets; this.previewTrackManager = previewTrackManager; @@ -260,7 +255,7 @@ namespace osu.Game.Overlays if (State == Visibility.Hidden) return; - if (api == null) + if (API == null) return; previewTrackManager.StopAnyPlaying(this); @@ -286,7 +281,7 @@ namespace osu.Game.Overlays }); }; - api.Queue(getSetsRequest); + API.Queue(getSetsRequest); } private int distinctCount(List list) => list.Distinct().ToArray().Length; diff --git a/osu.Game/Overlays/FullscreenOverlay.cs b/osu.Game/Overlays/FullscreenOverlay.cs new file mode 100644 index 0000000000..36de40be3e --- /dev/null +++ b/osu.Game/Overlays/FullscreenOverlay.cs @@ -0,0 +1,58 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Effects; +using osu.Game.Graphics; +using osu.Game.Online.API; +using osuTK.Graphics; + +namespace osu.Game.Overlays +{ + public abstract class FullscreenOverlay : WaveOverlayContainer, IOnlineComponent + { + [Resolved] + protected IAPIProvider API { get; private set; } + + protected FullscreenOverlay() + { + Waves.FirstWaveColour = OsuColour.Gray(0.4f); + Waves.SecondWaveColour = OsuColour.Gray(0.3f); + Waves.ThirdWaveColour = OsuColour.Gray(0.2f); + Waves.FourthWaveColour = OsuColour.Gray(0.1f); + + RelativeSizeAxes = Axes.Both; + RelativePositionAxes = Axes.Both; + Width = 0.85f; + Anchor = Anchor.TopCentre; + Origin = Anchor.TopCentre; + + Masking = true; + + EdgeEffect = new EdgeEffectParameters + { + Colour = Color4.Black.Opacity(0), + Type = EdgeEffectType.Shadow, + Radius = 10 + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + API.Register(this); + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + API.Unregister(this); + } + + public virtual void APIStateChanged(IAPIProvider api, APIState state) + { + } + } +} diff --git a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs index 87c369e246..293ee4bcda 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs @@ -11,7 +11,7 @@ using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.SearchableList { - public abstract class SearchableListOverlay : WaveOverlayContainer + public abstract class SearchableListOverlay : FullscreenOverlay { public static readonly float WIDTH_PADDING = 80; } @@ -32,8 +32,6 @@ namespace osu.Game.Overlays.SearchableList protected SearchableListOverlay() { - RelativeSizeAxes = Axes.Both; - Children = new Drawable[] { new Box diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index e6d0c2fe40..2baa614365 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; -using osu.Framework.Allocation; using osu.Framework.Bindables; using osuTK; using osuTK.Graphics; @@ -20,9 +19,8 @@ using osu.Framework.Threading; namespace osu.Game.Overlays { - public class SocialOverlay : SearchableListOverlay, IOnlineComponent + public class SocialOverlay : SearchableListOverlay { - private IAPIProvider api; private readonly LoadingAnimation loading; private FillFlowContainer panels; @@ -88,13 +86,6 @@ namespace osu.Game.Overlays currentQuery.BindTo(Filter.Search.Current); } - [BackgroundDependencyLoader] - private void load(IAPIProvider api) - { - this.api = api; - api.Register(this); - } - private void recreatePanels(PanelDisplayStyle displayStyle) { clearPanels(); @@ -159,7 +150,7 @@ namespace osu.Game.Overlays loading.Hide(); getUsersRequest?.Cancel(); - if (api?.IsLoggedIn != true) + if (API?.IsLoggedIn != true) return; switch (Header.Tabs.Current.Value) @@ -167,13 +158,13 @@ namespace osu.Game.Overlays case SocialTab.Friends: var friendRequest = new GetFriendsRequest(); // TODO filter arguments? friendRequest.Success += updateUsers; - api.Queue(getUsersRequest = friendRequest); + API.Queue(getUsersRequest = friendRequest); break; default: var userRequest = new GetUsersRequest(); // TODO filter arguments! userRequest.Success += response => updateUsers(response.Select(r => r.User)); - api.Queue(getUsersRequest = userRequest); + API.Queue(getUsersRequest = userRequest); break; } @@ -196,7 +187,7 @@ namespace osu.Game.Overlays } } - public void APIStateChanged(IAPIProvider api, APIState state) + public override void APIStateChanged(IAPIProvider api, APIState state) { switch (state) { diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 1c242e3768..2d2840107d 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -3,64 +3,31 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Profile; using osu.Game.Overlays.Profile.Sections; using osu.Game.Users; using osuTK; -using osuTK.Graphics; namespace osu.Game.Overlays { - public class UserProfileOverlay : WaveOverlayContainer + public class UserProfileOverlay : FullscreenOverlay { private ProfileSection lastSection; private ProfileSection[] sections; private GetUserRequest userReq; - private IAPIProvider api; protected ProfileHeader Header; private SectionsContainer sectionsContainer; private ProfileTabControl tabs; public const float CONTENT_X_MARGIN = 70; - public UserProfileOverlay() - { - Waves.FirstWaveColour = OsuColour.Gray(0.4f); - Waves.SecondWaveColour = OsuColour.Gray(0.3f); - Waves.ThirdWaveColour = OsuColour.Gray(0.2f); - Waves.FourthWaveColour = OsuColour.Gray(0.1f); - - RelativeSizeAxes = Axes.Both; - RelativePositionAxes = Axes.Both; - Width = 0.85f; - Anchor = Anchor.TopCentre; - Origin = Anchor.TopCentre; - - Masking = true; - EdgeEffect = new EdgeEffectParameters - { - Colour = Color4.Black.Opacity(0), - Type = EdgeEffectType.Shadow, - Radius = 10 - }; - } - - [BackgroundDependencyLoader] - private void load(IAPIProvider api) - { - this.api = api; - } - protected override void PopIn() { base.PopIn(); @@ -154,7 +121,7 @@ namespace osu.Game.Overlays { userReq = new GetUserRequest(user.Id); userReq.Success += userLoadComplete; - api.Queue(userReq); + API.Queue(userReq); } else { From ca2662e941705c6f9b364f69c4e4c9dbedda7c1b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 14:58:36 +0900 Subject: [PATCH 2/6] Rename incorrectly named test cases --- .../Online/{TestCaseDirect.cs => TestCaseDirectOverlay.cs} | 2 +- .../Online/{TestCaseSocial.cs => TestCaseSocialOverlay.cs} | 5 ++--- osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs | 2 +- ...{TestCaseUserProfile.cs => TestCaseUserProfileOverlay.cs} | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) rename osu.Game.Tests/Visual/Online/{TestCaseDirect.cs => TestCaseDirectOverlay.cs} (99%) rename osu.Game.Tests/Visual/Online/{TestCaseSocial.cs => TestCaseSocialOverlay.cs} (96%) rename osu.Game.Tests/Visual/Online/{TestCaseUserProfile.cs => TestCaseUserProfileOverlay.cs} (96%) diff --git a/osu.Game.Tests/Visual/Online/TestCaseDirect.cs b/osu.Game.Tests/Visual/Online/TestCaseDirectOverlay.cs similarity index 99% rename from osu.Game.Tests/Visual/Online/TestCaseDirect.cs rename to osu.Game.Tests/Visual/Online/TestCaseDirectOverlay.cs index ff57104d8a..677b49e1af 100644 --- a/osu.Game.Tests/Visual/Online/TestCaseDirect.cs +++ b/osu.Game.Tests/Visual/Online/TestCaseDirectOverlay.cs @@ -11,7 +11,7 @@ using osu.Game.Rulesets; namespace osu.Game.Tests.Visual.Online { [TestFixture] - public class TestCaseDirect : OsuTestCase + public class TestCaseDirectOverlay : OsuTestCase { private DirectOverlay direct; private RulesetStore rulesets; diff --git a/osu.Game.Tests/Visual/Online/TestCaseSocial.cs b/osu.Game.Tests/Visual/Online/TestCaseSocialOverlay.cs similarity index 96% rename from osu.Game.Tests/Visual/Online/TestCaseSocial.cs rename to osu.Game.Tests/Visual/Online/TestCaseSocialOverlay.cs index 48325713df..2c524da99d 100644 --- a/osu.Game.Tests/Visual/Online/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/Online/TestCaseSocialOverlay.cs @@ -11,19 +11,18 @@ using osu.Game.Users; namespace osu.Game.Tests.Visual.Online { [TestFixture] - public class TestCaseSocial : OsuTestCase + public class TestCaseSocialOverlay : OsuTestCase { public override IReadOnlyList RequiredTypes => new[] { typeof(UserPanel), typeof(SocialPanel), typeof(FilterControl), - typeof(SocialOverlay), typeof(SocialGridPanel), typeof(SocialListPanel) }; - public TestCaseSocial() + public TestCaseSocialOverlay() { SocialOverlay s = new SocialOverlay { diff --git a/osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs b/osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs index 5f5ba89186..887228c06e 100644 --- a/osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs +++ b/osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs @@ -38,7 +38,7 @@ namespace osu.Game.Tests.Visual.Online header = new ProfileHeader(); Add(header); - AddStep("Show offline dummy", () => header.User.Value = TestCaseUserProfile.TEST_USER); + AddStep("Show offline dummy", () => header.User.Value = TestCaseUserProfileOverlay.TEST_USER); AddStep("Show null dummy", () => header.User.Value = new User { diff --git a/osu.Game.Tests/Visual/Online/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/Online/TestCaseUserProfileOverlay.cs similarity index 96% rename from osu.Game.Tests/Visual/Online/TestCaseUserProfile.cs rename to osu.Game.Tests/Visual/Online/TestCaseUserProfileOverlay.cs index 0789c14b32..6940392f32 100644 --- a/osu.Game.Tests/Visual/Online/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/Online/TestCaseUserProfileOverlay.cs @@ -17,7 +17,7 @@ using osu.Game.Users; namespace osu.Game.Tests.Visual.Online { [TestFixture] - public class TestCaseUserProfile : OsuTestCase + public class TestCaseUserProfileOverlay : OsuTestCase { private readonly TestUserProfileOverlay profile; @@ -27,7 +27,6 @@ namespace osu.Game.Tests.Visual.Online public override IReadOnlyList RequiredTypes => new[] { typeof(ProfileHeader), - typeof(UserProfileOverlay), typeof(RankGraph), typeof(LineGraph), typeof(SectionsContainer<>), @@ -72,7 +71,7 @@ namespace osu.Game.Tests.Visual.Online Achievements = new User.UserAchievement[0], }; - public TestCaseUserProfile() + public TestCaseUserProfileOverlay() { Add(profile = new TestUserProfileOverlay()); } From 29bdc97ab7a669709f4c2fd050e01eecd90e9538 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 15:07:18 +0900 Subject: [PATCH 3/6] Remove unnecessary DI --- osu.Game/Overlays/BeatmapSetOverlay.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 5cfdd4050b..2cf400f776 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -11,7 +11,6 @@ using osu.Framework.Input.Events; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Containers; -using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.BeatmapSet; using osu.Game.Overlays.BeatmapSet.Scores; @@ -29,7 +28,6 @@ namespace osu.Game.Overlays private readonly Header header; - private IAPIProvider api; private RulesetStore rulesets; private readonly ScrollContainer scroll; @@ -81,9 +79,8 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(IAPIProvider api, RulesetStore rulesets) + private void load(RulesetStore rulesets) { - this.api = api; this.rulesets = rulesets; } @@ -114,7 +111,7 @@ namespace osu.Game.Overlays beatmapSet.Value = res.ToBeatmapSet(rulesets); header.Picker.Beatmap.Value = header.BeatmapSet.Value.Beatmaps.First(b => b.OnlineBeatmapID == beatmapId); }; - api.Queue(req); + API.Queue(req); Show(); } @@ -123,7 +120,7 @@ namespace osu.Game.Overlays beatmapSet.Value = null; var req = new GetBeatmapSetRequest(beatmapSetId); req.Success += res => beatmapSet.Value = res.ToBeatmapSet(rulesets); - api.Queue(req); + API.Queue(req); Show(); } From a765f2502daa9760786e9c20baf688ddcb8a4a27 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 15:14:00 +0900 Subject: [PATCH 4/6] Add simple test case for FullscreenOverlay --- .../Online/TestCaseFullscreenOverlay.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 osu.Game.Tests/Visual/Online/TestCaseFullscreenOverlay.cs diff --git a/osu.Game.Tests/Visual/Online/TestCaseFullscreenOverlay.cs b/osu.Game.Tests/Visual/Online/TestCaseFullscreenOverlay.cs new file mode 100644 index 0000000000..925e6e1349 --- /dev/null +++ b/osu.Game.Tests/Visual/Online/TestCaseFullscreenOverlay.cs @@ -0,0 +1,40 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Game.Overlays; +using osuTK.Graphics; + +namespace osu.Game.Tests.Visual.Online +{ + [TestFixture] + public class TestCaseFullscreenOverlay : OsuTestCase + { + private FullscreenOverlay overlay; + + protected override void LoadComplete() + { + base.LoadComplete(); + + Add(overlay = new TestFullscreenOverlay()); + AddStep(@"toggle", overlay.ToggleVisibility); + } + + private class TestFullscreenOverlay : FullscreenOverlay + { + public TestFullscreenOverlay() + { + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + }, + }; + } + } + } +} From e893925417d9b7bd2a453e6ec2e9d5429d0372b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 15:19:23 +0900 Subject: [PATCH 5/6] Move shadow fade logic --- osu.Game/Overlays/BeatmapSetOverlay.cs | 12 +++--------- osu.Game/Overlays/FullscreenOverlay.cs | 17 +++++++++++++++++ osu.Game/Overlays/UserProfileOverlay.cs | 12 ------------ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 2cf400f776..3ed398d31a 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -84,16 +84,10 @@ namespace osu.Game.Overlays this.rulesets = rulesets; } - protected override void PopIn() + protected override void PopOutComplete() { - base.PopIn(); - FadeEdgeEffectTo(0.25f, WaveContainer.APPEAR_DURATION, Easing.In); - } - - protected override void PopOut() - { - base.PopOut(); - FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out).OnComplete(_ => beatmapSet.Value = null); + base.PopOutComplete(); + beatmapSet.Value = null; } protected override bool OnClick(ClickEvent e) diff --git a/osu.Game/Overlays/FullscreenOverlay.cs b/osu.Game/Overlays/FullscreenOverlay.cs index 36de40be3e..921dcd316d 100644 --- a/osu.Game/Overlays/FullscreenOverlay.cs +++ b/osu.Game/Overlays/FullscreenOverlay.cs @@ -6,6 +6,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Effects; using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Online.API; using osuTK.Graphics; @@ -39,6 +40,22 @@ namespace osu.Game.Overlays }; } + protected override void PopIn() + { + base.PopIn(); + FadeEdgeEffectTo(0.4f, WaveContainer.APPEAR_DURATION, Easing.Out); + } + + protected override void PopOut() + { + base.PopOut(); + FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.In).OnComplete(_ => PopOutComplete()); + } + + protected virtual void PopOutComplete() + { + } + protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 2d2840107d..8a133a1d1e 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -28,18 +28,6 @@ namespace osu.Game.Overlays public const float CONTENT_X_MARGIN = 70; - protected override void PopIn() - { - base.PopIn(); - FadeEdgeEffectTo(0.5f, WaveContainer.APPEAR_DURATION, Easing.In); - } - - protected override void PopOut() - { - base.PopOut(); - FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out); - } - public void ShowUser(long userId) => ShowUser(new User { Id = userId }); public void ShowUser(User user, bool fetchOnline = true) From fad9e7399940946d90f4314f9344d8871af68df6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 17:08:42 +0900 Subject: [PATCH 6/6] Add null check in disposal clause --- osu.Game/Overlays/FullscreenOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/FullscreenOverlay.cs b/osu.Game/Overlays/FullscreenOverlay.cs index 921dcd316d..9706f75087 100644 --- a/osu.Game/Overlays/FullscreenOverlay.cs +++ b/osu.Game/Overlays/FullscreenOverlay.cs @@ -65,7 +65,7 @@ namespace osu.Game.Overlays protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - API.Unregister(this); + API?.Unregister(this); } public virtual void APIStateChanged(IAPIProvider api, APIState state)