1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

removed looping if only one song is in the list (temporarily)

It had one problem in relation to SongSelect disabling it when left and in general that topic belongs to another PR.
This commit is contained in:
Aergwyn 2017-12-03 16:41:21 +01:00
parent 9d13bf3602
commit 14096c90cc
2 changed files with 13 additions and 10 deletions

View File

@ -35,7 +35,11 @@ namespace osu.Game.Overlays.Music
set { base.Padding = value; }
}
public IEnumerable<BeatmapSetInfo> BeatmapSets { set { items.Sets = value; } }
public IEnumerable<BeatmapSetInfo> BeatmapSets
{
get { return items.Sets; }
set { items.Sets = value; }
}
public BeatmapSetInfo FirstVisibleSet => items.FirstVisibleSet;
public BeatmapSetInfo NextSet => items.NextSet;
@ -81,6 +85,7 @@ namespace osu.Game.Overlays.Music
public IEnumerable<BeatmapSetInfo> Sets
{
get { return items.Select(x => x.BeatmapSetInfo).ToList(); }
set
{
items.Clear();

View File

@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Music
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
public IEnumerable<BeatmapSetInfo> BeatmapSets;
public IEnumerable<BeatmapSetInfo> BeatmapSets => list.BeatmapSets;
[BackgroundDependencyLoader]
private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours)
@ -74,11 +74,10 @@ namespace osu.Game.Overlays.Music
},
};
beatmaps.BeatmapSetAdded += s => Schedule(() => list.AddBeatmapSet(s));
beatmaps.BeatmapSetRemoved += s => Schedule(() => list.RemoveBeatmapSet(s));
list.BeatmapSets = BeatmapSets = beatmaps.GetAllUsableBeatmapSets();
beatmaps.BeatmapSetAdded += delegate (BeatmapSetInfo set) { list.AddBeatmapSet(set); };
beatmaps.BeatmapSetRemoved += delegate (BeatmapSetInfo set) { list.RemoveBeatmapSet(set); };
list.BeatmapSets = beatmaps.GetAllUsableBeatmapSets();
beatmapBacking.BindTo(game.Beatmap);
@ -121,7 +120,7 @@ namespace osu.Game.Overlays.Music
return;
}
playSpecified(set.Beatmaps[0]);
playSpecified(set.Beatmaps.First());
}
public void PlayPrevious()
@ -130,7 +129,7 @@ namespace osu.Game.Overlays.Music
if (playable != null)
{
playSpecified(playable.Beatmaps[0]);
playSpecified(playable.Beatmaps.First());
list.SelectedSet = playable;
}
}
@ -141,7 +140,7 @@ namespace osu.Game.Overlays.Music
if (playable != null)
{
playSpecified(playable.Beatmaps[0]);
playSpecified(playable.Beatmaps.First());
list.SelectedSet = playable;
}
}
@ -149,7 +148,6 @@ namespace osu.Game.Overlays.Music
private void playSpecified(BeatmapInfo info)
{
beatmapBacking.Value = beatmaps.GetWorkingBeatmap(info, beatmapBacking);
beatmapBacking.Value.Track.Looping = BeatmapSets?.Count() == 1;
beatmapBacking.Value.Track.Start();
}
}