mirror of
https://github.com/osukey/osukey.git
synced 2025-06-01 10:57:27 +09:00
Ensure only one information overlay is open at once
This commit is contained in:
parent
530b1e8d91
commit
8a407a68b3
@ -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
|
settings.StateChanged += delegate
|
||||||
{
|
{
|
||||||
switch (settings.State)
|
switch (settings.State)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user