Merge branch 'master' into fix-disabled-set-crash

This commit is contained in:
Dan Balasescu
2019-03-05 17:25:13 +09:00
committed by GitHub
372 changed files with 3325 additions and 1072 deletions

View File

@ -29,7 +29,8 @@ namespace osu.Game.Overlays.Direct
protected override PlayButton PlayButton => playButton;
protected override Box PreviewBar => progressBar;
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap)
public DirectGridPanel(BeatmapSetInfo beatmap)
: base(beatmap)
{
Width = 380;
Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image)

View File

@ -158,7 +158,7 @@ namespace osu.Game.Overlays.Direct
public int Value
{
get { return value; }
get => value;
set
{
this.value = value;

View File

@ -2,7 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using Microsoft.EntityFrameworkCore.Internal;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Direct
{
if (setInfo.NewValue == null)
attachDownload(null);
else if (beatmaps.QueryBeatmapSets(s => s.OnlineBeatmapSetID == setInfo.NewValue.OnlineBeatmapSetID).Any())
else if (beatmaps.GetAllUsableBeatmapSetsEnumerable().Any(s => s.OnlineBeatmapSetID == setInfo.NewValue.OnlineBeatmapSetID))
State.Value = DownloadState.LocallyAvailable;
else
attachDownload(beatmaps.GetExistingDownload(setInfo.NewValue));
@ -63,8 +63,11 @@ namespace osu.Game.Overlays.Direct
{
base.Dispose(isDisposing);
beatmaps.BeatmapDownloadBegan -= attachDownload;
beatmaps.ItemAdded -= setAdded;
if (beatmaps != null)
{
beatmaps.BeatmapDownloadBegan -= attachDownload;
beatmaps.ItemAdded -= setAdded;
}
State.UnbindAll();

View File

@ -28,10 +28,13 @@ namespace osu.Game.Overlays.Direct
public enum DirectTab
{
Search,
[Description("Newest Maps")]
NewestMaps = DirectSortCriteria.Ranked,
[Description("Top Rated")]
TopRated = DirectSortCriteria.Rating,
[Description("Most Played")]
MostPlayed = DirectSortCriteria.Plays,
}

View File

@ -24,10 +24,11 @@ namespace osu.Game.Overlays.Direct
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
beatmapSet = value;
Preview?.Stop();