From d5b7865ab8c73ae2f3aad743a190ef12d5ef983c Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 6 Apr 2019 17:40:48 +0200 Subject: [PATCH 1/4] Invert notification and loginOverlay depth order --- osu.Game/OsuGame.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 15cd6d73e5..4f92ff831c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -431,7 +431,7 @@ protected override void LoadComplete() loadComponentSingleFile(volume = new VolumeOverlay(), leftFloatingOverlayContent.Add); loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); - loadComponentSingleFile(loginOverlay = new LoginOverlay + loadComponentSingleFile(notifications = new NotificationOverlay { GetToolbarHeight = () => ToolbarOffset, Anchor = Anchor.TopRight, @@ -449,7 +449,7 @@ protected override void LoadComplete() loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add); loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add); - loadComponentSingleFile(notifications = new NotificationOverlay + loadComponentSingleFile(loginOverlay = new LoginOverlay { GetToolbarHeight = () => ToolbarOffset, Anchor = Anchor.TopRight, From 59410dbe3b739a5708604dddb8dd7e5df48236be Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 6 Apr 2019 18:05:13 +0200 Subject: [PATCH 2/4] Open login overlay when notification asking for signing in to play multi is clicked --- osu.Game/Screens/Menu/ButtonSystem.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index d3cf23dab8..77be5d08d9 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -103,6 +103,9 @@ public ButtonSystem() [Resolved(CanBeNull = true)] private NotificationOverlay notifications { get; set; } + [Resolved] + private LoginOverlay loginOverlay { get; set; } + [BackgroundDependencyLoader(true)] private void load(AudioManager audio, IdleTracker idleTracker, GameHost host) { @@ -134,8 +137,13 @@ private void onMulti() { notifications?.Post(new SimpleNotification { - Text = "You gotta be logged in to multi 'yo!", - Icon = FontAwesome.Solid.Globe + Text = "You gotta be logged in to multi 'yo!", + Icon = FontAwesome.Solid.Globe, + Activated = () => + { + loginOverlay.Show(); + return true; + } }); return; From 394f14965b88c745252a3932af9337c30d17037d Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 6 Apr 2019 18:23:56 +0200 Subject: [PATCH 3/4] Make appveyor happy with whitespaces --- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 77be5d08d9..d311664737 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -137,7 +137,7 @@ private void onMulti() { notifications?.Post(new SimpleNotification { - Text = "You gotta be logged in to multi 'yo!", + Text = "You gotta be logged in to multi 'yo!", Icon = FontAwesome.Solid.Globe, Activated = () => { From 3f2e6a9376e024ada4a91e565f7b66b3eb232439 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 6 Apr 2019 18:52:30 +0200 Subject: [PATCH 4/4] Allow loginOverlay to be null if there's no cached instance in DI (for testing cases) --- osu.Game/Screens/Menu/ButtonSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index d311664737..80fbce2cf8 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -103,7 +103,7 @@ public ButtonSystem() [Resolved(CanBeNull = true)] private NotificationOverlay notifications { get; set; } - [Resolved] + [Resolved(CanBeNull = true)] private LoginOverlay loginOverlay { get; set; } [BackgroundDependencyLoader(true)] @@ -141,7 +141,7 @@ private void onMulti() Icon = FontAwesome.Solid.Globe, Activated = () => { - loginOverlay.Show(); + loginOverlay?.Show(); return true; } });