mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Fix restoration of enabled mods when cancelling song select
This commit is contained in:
parent
cf2feec7df
commit
6e821a426d
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -9,6 +10,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Screens.Multi;
|
using osu.Game.Screens.Multi;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
@ -23,6 +25,9 @@ namespace osu.Game.Screens.Select
|
|||||||
[Resolved(typeof(Room))]
|
[Resolved(typeof(Room))]
|
||||||
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
|
protected Bindable<PlaylistItem> CurrentItem { get; private set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
protected Bindable<IEnumerable<Mod>> CurrentMods { get; private set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmaps { get; set; }
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
@ -56,9 +61,8 @@ namespace osu.Game.Screens.Select
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
|
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
|
||||||
|
Beatmap.Value.Mods.Value = CurrentMods.Value = CurrentItem.Value?.RequiredMods;
|
||||||
Ruleset.Value = CurrentItem.Value?.Ruleset;
|
Ruleset.Value = CurrentItem.Value?.Ruleset;
|
||||||
CurrentItem.Value?.RequiredMods.Clear();
|
|
||||||
CurrentItem.Value?.RequiredMods.AddRange(SelectedMods.Value);
|
|
||||||
|
|
||||||
Beatmap.Disabled = true;
|
Beatmap.Disabled = true;
|
||||||
Ruleset.Disabled = true;
|
Ruleset.Disabled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user