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:
parent
bd1e2da1c2
commit
095b7f8668
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user