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
2 changed files with 16 additions and 0 deletions

View File

@ -335,6 +335,20 @@ namespace osu.Game.Tests.Visual.Navigation
exitViaBackButtonAndConfirm(); 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] [Test]
public void TestExitMultiWithEscape() public void TestExitMultiWithEscape()
{ {

View File

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