Skip to content

Commit

Permalink
Merge pull request #2279 from peppy/fix-settings-notification-verlay
Browse files Browse the repository at this point in the history
Only allow settings or notifications to be visible at once
  • Loading branch information
smoogipoo committed Mar 22, 2018
2 parents 61ef635 + e5f8353 commit a6bcb0b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions osu.Game/OsuGame.cs
Expand Up @@ -302,6 +302,21 @@ protected override void LoadComplete()
};
}

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)
Expand Down

0 comments on commit a6bcb0b

Please sign in to comment.