mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Merge pull request #1190 from peppy/concurrent-overlay-limits
Ensure other full-screen overlays are closed when direct is open (and vice-versa)
This commit is contained in:
commit
11fd91bc68
@ -226,9 +226,21 @@ namespace osu.Game
|
|||||||
dependencies.Cache(notificationOverlay);
|
dependencies.Cache(notificationOverlay);
|
||||||
dependencies.Cache(dialogOverlay);
|
dependencies.Cache(dialogOverlay);
|
||||||
|
|
||||||
// ensure both overlays aren't presented at the same time
|
// ensure only one of these overlays are open at once.
|
||||||
chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State;
|
var singleDisplayOverlays = new OverlayContainer[] { chat, social, direct };
|
||||||
social.StateChanged += (container, state) => chat.State = state == Visibility.Visible ? Visibility.Hidden : chat.State;
|
foreach (var overlay in singleDisplayOverlays)
|
||||||
|
{
|
||||||
|
overlay.StateChanged += (container, state) =>
|
||||||
|
{
|
||||||
|
if (state == Visibility.Hidden) return;
|
||||||
|
|
||||||
|
foreach (var c in singleDisplayOverlays)
|
||||||
|
{
|
||||||
|
if (c == container) continue;
|
||||||
|
c.State = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
LoadComponentAsync(Toolbar = new Toolbar
|
LoadComponentAsync(Toolbar = new Toolbar
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user