mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 22:22:55 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into percentage
This commit is contained in:
commit
6f44869875
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using SQLite.Net.Attributes;
|
using SQLite.Net.Attributes;
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
@ -31,6 +32,6 @@ namespace osu.Game.Database
|
|||||||
TitleUnicode,
|
TitleUnicode,
|
||||||
Source,
|
Source,
|
||||||
Tags
|
Tags
|
||||||
};
|
}.Where(s => !string.IsNullOrEmpty(s)).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -73,7 +73,14 @@ namespace osu.Game.Overlays.Music
|
|||||||
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
|
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
|
||||||
{
|
{
|
||||||
public string[] FilterTerms => new string[] { };
|
public string[] FilterTerms => new string[] { };
|
||||||
public bool MatchingCurrentFilter { set { } }
|
public bool MatchingCurrentFilter
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
InvalidateLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<IFilterable> FilterableChildren => Children;
|
public IEnumerable<IFilterable> FilterableChildren => Children;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
protected IEnumerable<BeatmapSetInfo> BeatmapSets;
|
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours)
|
private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
@ -260,17 +261,36 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
|
|
||||||
private WorkingBeatmap current;
|
private WorkingBeatmap current;
|
||||||
private TransformDirection queuedDirection = TransformDirection.Next;
|
private TransformDirection? queuedDirection;
|
||||||
|
|
||||||
private void beatmapChanged(WorkingBeatmap beatmap)
|
private void beatmapChanged(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
progressBar.IsEnabled = beatmap != null;
|
progressBar.IsEnabled = beatmap != null;
|
||||||
|
|
||||||
bool audioEquals = beatmapBacking.Value?.BeatmapInfo?.AudioEquals(current?.BeatmapInfo) ?? false;
|
bool audioEquals = beatmapBacking.Value?.BeatmapInfo?.AudioEquals(current?.BeatmapInfo) ?? false;
|
||||||
|
|
||||||
|
TransformDirection direction;
|
||||||
|
|
||||||
|
if (audioEquals)
|
||||||
|
direction = TransformDirection.None;
|
||||||
|
else if (queuedDirection.HasValue)
|
||||||
|
{
|
||||||
|
direction = queuedDirection.Value;
|
||||||
|
queuedDirection = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//figure out the best direction based on order in playlist.
|
||||||
|
var last = current == null ? -1 : playlist.BeatmapSets.TakeWhile(b => b.ID != current.BeatmapSetInfo.ID).Count();
|
||||||
|
var next = beatmapBacking.Value == null ? -1 : playlist.BeatmapSets.TakeWhile(b => b.ID != beatmapBacking.Value.BeatmapSetInfo.ID).Count();
|
||||||
|
|
||||||
|
direction = last > next ? TransformDirection.Prev : TransformDirection.Next;
|
||||||
|
}
|
||||||
|
|
||||||
current = beatmapBacking.Value;
|
current = beatmapBacking.Value;
|
||||||
|
|
||||||
updateDisplay(beatmapBacking, audioEquals ? TransformDirection.None : queuedDirection);
|
updateDisplay(beatmapBacking, direction);
|
||||||
queuedDirection = TransformDirection.Next;
|
queuedDirection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledDelegate pendingBeatmapSwitch;
|
private ScheduledDelegate pendingBeatmapSwitch;
|
||||||
|
Loading…
Reference in New Issue
Block a user