diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e656c7256e..4a40a6b5df 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -302,6 +302,21 @@ namespace osu.Game }; } + var singleDisplaySideOverlays = new OverlayContainer[] { settings, notifications }; + foreach (var overlay in singleDisplaySideOverlays) + { + overlay.StateChanged += state => + { + if (state == Visibility.Hidden) return; + + foreach (var c in singleDisplaySideOverlays) + { + if (c == overlay) continue; + c.State = Visibility.Hidden; + } + }; + } + // 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)