1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Rewrite code to account for non-loaded edge case

This commit is contained in:
Dean Herbert 2021-03-19 20:09:12 +09:00
parent bd1e2da1c2
commit 095b7f8668

View File

@ -758,13 +758,15 @@ namespace osu.Game
{
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)
// Partially visible so leave it at the current depth.
if (overlay.IsPresent)
return;
// show above others if not visible at all, else leave at current depth.
if (!overlay.IsPresent)
// Show above all other overlays.
if (overlay.IsLoaded)
overlayContent.ChangeChildDepth(overlay, (float)-Clock.CurrentTime);
else
overlay.Depth = (float)-Clock.CurrentTime;
}
private void forwardLoggedErrorsToNotifications()