1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 02:32:55 +08:00

Always hide other overlays, even if the new one is not loaded

This commit is contained in:
Dean Herbert 2021-03-19 19:09:39 +09:00
parent a9c4fa442a
commit bd1e2da1c2

View File

@ -756,12 +756,12 @@ namespace osu.Game
private void showOverlayAboveOthers(OverlayContainer overlay, OverlayContainer[] otherOverlays)
{
otherOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
// generally shouldn't ever hit this state, but protects against a crash on attempting to change ChildDepth.
if (overlay.LoadState < LoadState.Ready)
return;
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);