1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00

Fix restoration of enabled mods when cancelling song select

This commit is contained in:
Jamie Taylor 2019-02-28 15:01:32 +09:00
parent cf2feec7df
commit 6e821a426d
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -9,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Multi;
namespace osu.Game.Screens.Select
@ -23,6 +25,9 @@ namespace osu.Game.Screens.Select
[Resolved(typeof(Room))]
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
[Resolved]
protected Bindable<IEnumerable<Mod>> CurrentMods { get; private set; }
[Resolved]
private BeatmapManager beatmaps { get; set; }
@ -56,9 +61,8 @@ namespace osu.Game.Screens.Select
return true;
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
Beatmap.Value.Mods.Value = CurrentMods.Value = CurrentItem.Value?.RequiredMods;
Ruleset.Value = CurrentItem.Value?.Ruleset;
CurrentItem.Value?.RequiredMods.Clear();
CurrentItem.Value?.RequiredMods.AddRange(SelectedMods.Value);
Beatmap.Disabled = true;
Ruleset.Disabled = true;