mirror of
https://github.com/osukey/osukey.git
synced 2025-06-14 15:58:06 +09:00
Fix failing tests due to CurrentDialog
being unexpectedly not set after Push
This commit is contained in:
parent
383245f43a
commit
a27fcda9f1
@ -105,8 +105,6 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("dialog not displayed", () => overlay.CurrentDialog != dialog);
|
|
||||||
|
|
||||||
AddStep("complete load", () => ((SlowLoadingDialogOverlay)overlay).LoadEvent.Set());
|
AddStep("complete load", () => ((SlowLoadingDialogOverlay)overlay).LoadEvent.Set());
|
||||||
|
|
||||||
AddUntilStep("wait for load", () => overlay.IsLoaded);
|
AddUntilStep("wait for load", () => overlay.IsLoaded);
|
||||||
|
@ -47,23 +47,23 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public void Push(PopupDialog dialog)
|
public void Push(PopupDialog dialog)
|
||||||
{
|
{
|
||||||
if (!IsLoaded)
|
|
||||||
{
|
|
||||||
Schedule(() => Push(dialog));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dialog == CurrentDialog || dialog.State.Value != Visibility.Visible) return;
|
if (dialog == CurrentDialog || dialog.State.Value != Visibility.Visible) return;
|
||||||
|
|
||||||
// if any existing dialog is being displayed, dismiss it before showing a new one.
|
var lastDialog = CurrentDialog;
|
||||||
CurrentDialog?.Hide();
|
|
||||||
|
|
||||||
CurrentDialog = dialog;
|
CurrentDialog = dialog;
|
||||||
CurrentDialog.State.ValueChanged += state => onDialogOnStateChanged(dialog, state.NewValue);
|
|
||||||
|
|
||||||
dialogContainer.Add(CurrentDialog);
|
Scheduler.Add(() =>
|
||||||
|
{
|
||||||
|
// if any existing dialog is being displayed, dismiss it before showing a new one.
|
||||||
|
lastDialog?.Hide();
|
||||||
|
|
||||||
Show();
|
CurrentDialog = dialog;
|
||||||
|
CurrentDialog.State.ValueChanged += state => onDialogOnStateChanged(dialog, state.NewValue);
|
||||||
|
|
||||||
|
dialogContainer.Add(CurrentDialog);
|
||||||
|
|
||||||
|
Show();
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsPresent => Scheduler.HasPendingTasks || dialogContainer.Children.Count > 0;
|
public override bool IsPresent => Scheduler.HasPendingTasks || dialogContainer.Children.Count > 0;
|
||||||
@ -96,9 +96,6 @@ namespace osu.Game.Overlays
|
|||||||
base.PopOut();
|
base.PopOut();
|
||||||
this.FadeOut(PopupDialog.EXIT_DURATION, Easing.InSine);
|
this.FadeOut(PopupDialog.EXIT_DURATION, Easing.InSine);
|
||||||
|
|
||||||
// PopOut is called as part of VisibilityContainer's initialisation logic, but we don't want it to interact with a potentially waiting dialog.
|
|
||||||
if (!IsLoaded) return;
|
|
||||||
|
|
||||||
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, 100, Easing.InCubic);
|
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, 100, Easing.InCubic);
|
||||||
|
|
||||||
if (CurrentDialog?.State.Value == Visibility.Visible) CurrentDialog.Hide();
|
if (CurrentDialog?.State.Value == Visibility.Visible) CurrentDialog.Hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user