mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 06:02:56 +08:00
Remove weird "after load" action
This was pretty pointless anyway and from its usages, doesn't look to need to exist.
This commit is contained in:
parent
5b536aebe7
commit
fd7bf70b7d
@ -46,8 +46,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="interactive">If the test player should behave like the production one.</param>
|
/// <param name="interactive">If the test player should behave like the production one.</param>
|
||||||
/// <param name="beforeLoadAction">An action to run before player load but after bindable leases are returned.</param>
|
/// <param name="beforeLoadAction">An action to run before player load but after bindable leases are returned.</param>
|
||||||
/// <param name="afterLoadAction">An action to run after container load.</param>
|
public void ResetPlayer(bool interactive, Action beforeLoadAction = null)
|
||||||
public void ResetPlayer(bool interactive, Action beforeLoadAction = null, Action afterLoadAction = null)
|
|
||||||
{
|
{
|
||||||
player = null;
|
player = null;
|
||||||
|
|
||||||
@ -55,18 +54,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
InputManager.Clear();
|
InputManager.Clear();
|
||||||
|
|
||||||
|
container = new TestPlayerLoaderContainer(loader = new TestPlayerLoader(() => player = new TestPlayer(interactive, interactive)));
|
||||||
|
|
||||||
beforeLoadAction?.Invoke();
|
beforeLoadAction?.Invoke();
|
||||||
|
|
||||||
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
|
|
||||||
foreach (var mod in SelectedMods.Value.OfType<IApplicableToTrack>())
|
foreach (var mod in SelectedMods.Value.OfType<IApplicableToTrack>())
|
||||||
mod.ApplyToTrack(Beatmap.Value.Track);
|
mod.ApplyToTrack(Beatmap.Value.Track);
|
||||||
|
|
||||||
InputManager.Child = container = new TestPlayerLoaderContainer(
|
InputManager.Child = container;
|
||||||
loader = new TestPlayerLoader(() =>
|
|
||||||
{
|
|
||||||
afterLoadAction?.Invoke();
|
|
||||||
return player = new TestPlayer(interactive, interactive);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -197,19 +194,19 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestMutedNotificationMasterVolume()
|
public void TestMutedNotificationMasterVolume()
|
||||||
{
|
{
|
||||||
addVolumeSteps("master volume", () => audioManager.Volume.Value = 0, null, () => audioManager.Volume.IsDefault);
|
addVolumeSteps("master volume", () => audioManager.Volume.Value = 0, () => audioManager.Volume.IsDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMutedNotificationTrackVolume()
|
public void TestMutedNotificationTrackVolume()
|
||||||
{
|
{
|
||||||
addVolumeSteps("music volume", () => audioManager.VolumeTrack.Value = 0, null, () => audioManager.VolumeTrack.IsDefault);
|
addVolumeSteps("music volume", () => audioManager.VolumeTrack.Value = 0, () => audioManager.VolumeTrack.IsDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMutedNotificationMuteButton()
|
public void TestMutedNotificationMuteButton()
|
||||||
{
|
{
|
||||||
addVolumeSteps("mute button", null, () => container.VolumeOverlay.IsMuted.Value = true, () => !container.VolumeOverlay.IsMuted.Value);
|
addVolumeSteps("mute button", () => container.VolumeOverlay.IsMuted.Value = true, () => !container.VolumeOverlay.IsMuted.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
@ -217,13 +214,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="volumeName">What part of the volume system is checked</param>
|
/// <param name="volumeName">What part of the volume system is checked</param>
|
||||||
/// <param name="beforeLoad">The action to be invoked to set the volume before loading</param>
|
/// <param name="beforeLoad">The action to be invoked to set the volume before loading</param>
|
||||||
/// <param name="afterLoad">The action to be invoked to set the volume after loading</param>
|
|
||||||
/// <param name="assert">The function to be invoked and checked</param>
|
/// <param name="assert">The function to be invoked and checked</param>
|
||||||
private void addVolumeSteps(string volumeName, Action beforeLoad, Action afterLoad, Func<bool> assert)
|
private void addVolumeSteps(string volumeName, Action beforeLoad, Func<bool> assert)
|
||||||
{
|
{
|
||||||
AddStep("reset notification lock", () => sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce).Value = false);
|
AddStep("reset notification lock", () => sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce).Value = false);
|
||||||
|
|
||||||
AddStep("load player", () => ResetPlayer(false, beforeLoad, afterLoad));
|
AddStep("load player", () => ResetPlayer(false, beforeLoad));
|
||||||
AddUntilStep("wait for player", () => player?.LoadState == LoadState.Ready);
|
AddUntilStep("wait for player", () => player?.LoadState == LoadState.Ready);
|
||||||
|
|
||||||
AddAssert("check for notification", () => container.NotificationOverlay.UnreadCount.Value == 1);
|
AddAssert("check for notification", () => container.NotificationOverlay.UnreadCount.Value == 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user