1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:23:20 +08:00

Ensure only one information overlay is open at once

This commit is contained in:
Dean Herbert 2017-11-15 18:48:37 +09:00
parent 530b1e8d91
commit 8a407a68b3

View File

@ -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)