mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:05:29 +08:00
Merge pull request #735 from peppy/general-fixes
Fix broken test cases, remove some recursive lookup methods.
This commit is contained in:
commit
c5f6a1ec93
@ -142,7 +142,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout),
|
||||
@"Beatmaps did not import to the database in allocated time");
|
||||
|
||||
var set = host.Dependencies.Get<BeatmapDatabase>().GetChildren(resultSets.First(), true);
|
||||
var set = host.Dependencies.Get<BeatmapDatabase>().GetChildren(resultSets.First());
|
||||
|
||||
Assert.IsTrue(set.Beatmaps.Count == resultBeatmaps.Count(),
|
||||
$@"Incorrect database beatmap count post-import ({resultBeatmaps.Count()} but should be {set.Beatmaps.Count}).");
|
||||
|
@ -267,6 +267,9 @@ namespace osu.Game.Database
|
||||
|
||||
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false)
|
||||
{
|
||||
if (beatmapInfo.BeatmapSet == null)
|
||||
beatmapInfo = GetChildren(beatmapInfo, true);
|
||||
|
||||
if (beatmapInfo.BeatmapSet == null)
|
||||
throw new InvalidOperationException($@"Beatmap set {beatmapInfo.BeatmapSetInfoID} is not in the local database.");
|
||||
|
||||
|
@ -48,11 +48,9 @@ namespace osu.Game.Database
|
||||
return Connection.Table<T>();
|
||||
}
|
||||
|
||||
public T GetWithChildren<T>(object id, bool recursive = false) where T : class
|
||||
{
|
||||
return Connection.GetWithChildren<T>(id, recursive);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is expensive. Use with caution.
|
||||
/// </summary>
|
||||
public List<T> GetAllWithChildren<T>(Expression<Func<T, bool>> filter = null, bool recursive = true)
|
||||
where T : class
|
||||
{
|
||||
|
@ -110,12 +110,18 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
MoveToY(0, transition_length, EasingTypes.OutQuint);
|
||||
FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
|
||||
inputTextBox.HoldFocus = true;
|
||||
base.PopIn();
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
MoveToY(DrawSize.Y, transition_length, EasingTypes.InSine);
|
||||
FadeOut(transition_length, EasingTypes.InSine);
|
||||
|
||||
inputTextBox.HoldFocus = false;
|
||||
base.PopOut();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -79,7 +79,7 @@ namespace osu.Game.Screens.Menu
|
||||
if (count > 0)
|
||||
{
|
||||
var beatmap = query.ElementAt(RNG.Next(0, count - 1));
|
||||
beatmaps.GetChildren(beatmap, true);
|
||||
beatmaps.GetChildren(beatmap);
|
||||
Beatmap = beatmaps.GetWorkingBeatmap(beatmap.Beatmaps[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user