Merge pull request #17400 from nagilson/screen-mod-retention

Fix mods from single player carrying over to multiplayer
This commit is contained in:
Dan Balasescu 2022-03-23 08:36:15 +09:00 committed by GitHub
commit 1ffa1e1219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -335,6 +335,20 @@ namespace osu.Game.Tests.Visual.Navigation
exitViaBackButtonAndConfirm();
}
[Test]
public void TestModsResetOnEnteringMultiplayer()
{
var osuAutomationMod = new OsuModAutoplay();
AddStep("Enable autoplay", () => { Game.SelectedMods.Value = new[] { osuAutomationMod }; });
PushAndConfirm(() => new Screens.OnlinePlay.Multiplayer.Multiplayer());
AddUntilStep("Mods are removed", () => Game.SelectedMods.Value.Count == 0);
AddStep("Return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
AddUntilStep("Mods are restored", () => Game.SelectedMods.Value.Contains(osuAutomationMod));
}
[Test]
public void TestExitMultiWithEscape()
{

View File

@ -115,6 +115,8 @@ namespace osu.Game.Screens.OnlinePlay
this.FadeIn();
waves.Show();
Mods.SetDefault();
if (loungeSubScreen.IsCurrentScreen())
loungeSubScreen.OnEntering(last);
else