mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 08:22:56 +08:00
Decouple ModSelectOverlay from global SelectedMods
This commit is contained in:
parent
fb51ffc169
commit
7bf2e9b369
@ -47,7 +47,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
protected readonly Container ModSettingsContainer;
|
||||
|
||||
protected readonly Bindable<IReadOnlyList<Mod>> SelectedMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||
public readonly Bindable<IReadOnlyList<Mod>> SelectedMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||
|
||||
private Bindable<Dictionary<ModType, IReadOnlyList<Mod>>> availableMods;
|
||||
|
||||
@ -321,14 +321,13 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuColour colours, AudioManager audio, Bindable<IReadOnlyList<Mod>> selectedMods, OsuGameBase osu)
|
||||
private void load(OsuColour colours, AudioManager audio, OsuGameBase osu)
|
||||
{
|
||||
LowMultiplierColour = colours.Red;
|
||||
HighMultiplierColour = colours.Green;
|
||||
UnrankedLabel.Colour = colours.Blue;
|
||||
|
||||
availableMods = osu.AvailableMods.GetBoundCopy();
|
||||
SelectedMods.BindTo(selectedMods);
|
||||
|
||||
sampleOn = audio.Samples.Get(@"UI/check-on");
|
||||
sampleOff = audio.Samples.Get(@"UI/check-off");
|
||||
|
@ -75,6 +75,9 @@ namespace osu.Game.Screens.Select
|
||||
[Resolved(canBeNull: true)]
|
||||
private NotificationOverlay notificationOverlay { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Bindable<IReadOnlyList<Mod>> selectedMods { get; set; }
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
|
||||
|
||||
protected BeatmapCarousel Carousel { get; private set; }
|
||||
@ -468,6 +471,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
this.FadeInFromZero(250);
|
||||
FilterControl.Activate();
|
||||
|
||||
ModSelect.SelectedMods.BindTo(selectedMods);
|
||||
}
|
||||
|
||||
private const double logo_transition = 250;
|
||||
@ -508,6 +513,12 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public override void OnResuming(IScreen last)
|
||||
{
|
||||
base.OnResuming(last);
|
||||
|
||||
// required due to https://github.com/ppy/osu-framework/issues/3218
|
||||
ModSelect.SelectedMods.Disabled = false;
|
||||
ModSelect.SelectedMods.BindTo(selectedMods);
|
||||
|
||||
BeatmapDetails.Leaderboard.RefreshScores();
|
||||
|
||||
Beatmap.Value.Track.Looping = true;
|
||||
@ -532,6 +543,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
{
|
||||
ModSelect.SelectedMods.UnbindFrom(selectedMods);
|
||||
ModSelect.Hide();
|
||||
|
||||
BeatmapOptions.Hide();
|
||||
|
Loading…
Reference in New Issue
Block a user