mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Applied suggested changes
This commit is contained in:
@ -36,13 +36,11 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly Bindable<OsuScreen> currentScreenBacking = new Bindable<OsuScreen>();
|
||||
public bool AllowBeatmapChange = true;
|
||||
|
||||
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||
private InputManager inputManager;
|
||||
|
||||
private bool canBeatmapChange => currentScreenBacking.Value?.CanBeatmapChange != false;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours, UserInputManager inputManager)
|
||||
{
|
||||
@ -91,7 +89,6 @@ namespace osu.Game.Overlays.Music
|
||||
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList();
|
||||
|
||||
beatmapBacking.BindTo(game.Beatmap);
|
||||
currentScreenBacking.BindTo(game.CurrentScreen);
|
||||
|
||||
filter.Search.OnCommit = (sender, newText) => {
|
||||
var beatmap = list.FirstVisibleSet?.Beatmaps?.FirstOrDefault();
|
||||
@ -158,7 +155,7 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
private void playSpecified(BeatmapInfo info)
|
||||
{
|
||||
if (!canBeatmapChange)
|
||||
if (!AllowBeatmapChange)
|
||||
{
|
||||
beatmapBacking.Value?.Track?.Seek(0);
|
||||
return;
|
||||
|
@ -53,6 +53,21 @@ namespace osu.Game.Overlays
|
||||
private Container dragContainer;
|
||||
private Container playerContainer;
|
||||
|
||||
private bool allowBeatmapChange = true;
|
||||
|
||||
public bool AllowBeatmapChange
|
||||
{
|
||||
get
|
||||
{
|
||||
return allowBeatmapChange;
|
||||
}
|
||||
set
|
||||
{
|
||||
allowBeatmapChange = value;
|
||||
playlist.AllowBeatmapChange = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MusicController()
|
||||
{
|
||||
Width = 400;
|
||||
|
Reference in New Issue
Block a user