mirror of https://github.com/ppy/osu
Fix informational overlays not hiding each other correctly
This commit is contained in:
parent
c86798f8b2
commit
8bfe6ba27c
|
@ -683,9 +683,8 @@ protected override void LoadComplete()
|
|||
{
|
||||
overlay.State.ValueChanged += state =>
|
||||
{
|
||||
if (state.NewValue == Visibility.Hidden) return;
|
||||
|
||||
informationalOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
||||
if (state.NewValue != Visibility.Hidden)
|
||||
showOverlayAboveOthers(overlay, informationalOverlays);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -699,12 +698,8 @@ protected override void LoadComplete()
|
|||
// informational overlays should be dismissed on a show or hide of a full overlay.
|
||||
informationalOverlays.ForEach(o => o.Hide());
|
||||
|
||||
if (state.NewValue == Visibility.Hidden) return;
|
||||
|
||||
singleDisplayOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
||||
|
||||
if (!overlay.IsPresent)
|
||||
overlayContent.ChangeChildDepth(overlay, (float)-Clock.CurrentTime);
|
||||
if (state.NewValue != Visibility.Hidden)
|
||||
showOverlayAboveOthers(overlay, singleDisplayOverlays);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -729,6 +724,15 @@ void updateScreenOffset()
|
|||
notifications.State.ValueChanged += _ => updateScreenOffset();
|
||||
}
|
||||
|
||||
private void showOverlayAboveOthers(OverlayContainer overlay, OverlayContainer[] otherOverlays)
|
||||
{
|
||||
otherOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
||||
|
||||
// show above others if not visible at all, else leave at current depth.
|
||||
if (!overlay.IsPresent)
|
||||
overlayContent.ChangeChildDepth(overlay, (float)-Clock.CurrentTime);
|
||||
}
|
||||
|
||||
public class GameIdleTracker : IdleTracker
|
||||
{
|
||||
private InputManager inputManager;
|
||||
|
|
Loading…
Reference in New Issue