mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 23:22:55 +08:00
Remove local bindable at song select, along with misplaced reset logic
This commit is contained in:
parent
1109d201c3
commit
c15f909d83
@ -30,7 +30,6 @@ using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osuTK.Input;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
@ -86,10 +85,6 @@ namespace osu.Game.Screens.Select
|
||||
[Resolved(canBeNull: true)]
|
||||
private MusicController music { get; set; }
|
||||
|
||||
[Cached]
|
||||
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
|
||||
private readonly Bindable<IReadOnlyList<Mod>> mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>()); // Bound to the game's mods, but is not reset on exiting
|
||||
|
||||
protected SongSelect()
|
||||
{
|
||||
AddRangeInternal(new Drawable[]
|
||||
@ -222,7 +217,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
if (Footer != null)
|
||||
{
|
||||
Footer.AddButton(new FooterButtonMods { Current = mods }, ModSelect);
|
||||
Footer.AddButton(new FooterButtonMods { Current = Mods }, ModSelect);
|
||||
Footer.AddButton(new FooterButtonRandom { Action = triggerRandom });
|
||||
Footer.AddButton(new FooterButtonOptions(), BeatmapOptions);
|
||||
|
||||
@ -262,13 +257,6 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
mods.BindTo(Mods);
|
||||
}
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
@ -390,7 +378,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Logger.Log($"ruleset changed from \"{decoupledRuleset.Value}\" to \"{ruleset}\"");
|
||||
|
||||
mods.Value = Array.Empty<Mod>();
|
||||
Mods.Value = Array.Empty<Mod>();
|
||||
decoupledRuleset.Value = ruleset;
|
||||
|
||||
// force a filter before attempting to change the beatmap.
|
||||
@ -538,9 +526,6 @@ namespace osu.Game.Screens.Select
|
||||
if (Beatmap.Value.Track != null)
|
||||
Beatmap.Value.Track.Looping = false;
|
||||
|
||||
mods.UnbindAll();
|
||||
Mods.Value = Array.Empty<Mod>();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user