mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Merge pull request #9831 from peppy/fix-informational-overlays
Fix informational overlays not hiding each other correctly
This commit is contained in:
commit
85182b19fe
@ -683,9 +683,8 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
overlay.State.ValueChanged += state =>
|
overlay.State.ValueChanged += state =>
|
||||||
{
|
{
|
||||||
if (state.NewValue == Visibility.Hidden) return;
|
if (state.NewValue != Visibility.Hidden)
|
||||||
|
showOverlayAboveOthers(overlay, informationalOverlays);
|
||||||
informationalOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -699,12 +698,8 @@ namespace osu.Game
|
|||||||
// informational overlays should be dismissed on a show or hide of a full overlay.
|
// informational overlays should be dismissed on a show or hide of a full overlay.
|
||||||
informationalOverlays.ForEach(o => o.Hide());
|
informationalOverlays.ForEach(o => o.Hide());
|
||||||
|
|
||||||
if (state.NewValue == Visibility.Hidden) return;
|
if (state.NewValue != Visibility.Hidden)
|
||||||
|
showOverlayAboveOthers(overlay, singleDisplayOverlays);
|
||||||
singleDisplayOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
|
||||||
|
|
||||||
if (!overlay.IsPresent)
|
|
||||||
overlayContent.ChangeChildDepth(overlay, (float)-Clock.CurrentTime);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -729,6 +724,15 @@ namespace osu.Game
|
|||||||
notifications.State.ValueChanged += _ => 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
|
public class GameIdleTracker : IdleTracker
|
||||||
{
|
{
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
Loading…
Reference in New Issue
Block a user