mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into replay_speed
This commit is contained in:
@ -58,6 +58,23 @@ namespace osu.Game.Beatmaps
|
||||
ComboColors = original?.ComboColors ?? ComboColors;
|
||||
HitObjects = original?.HitObjects ?? HitObjects;
|
||||
Storyboard = original?.Storyboard ?? Storyboard;
|
||||
|
||||
if (original == null && Metadata == null)
|
||||
{
|
||||
// we may have no metadata in cases we weren't sourced from the database.
|
||||
// let's fill it (and other related fields) so we don't need to null-check it in future usages.
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = @"Unknown",
|
||||
Title = @"Unknown",
|
||||
Author = @"Unknown Creator",
|
||||
},
|
||||
Version = @"Normal",
|
||||
Difficulty = new BeatmapDifficulty()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ namespace osu.Game.Rulesets
|
||||
|
||||
protected override void Prepare(bool reset = false)
|
||||
{
|
||||
|
||||
Connection.CreateTable<RulesetInfo>();
|
||||
|
||||
if (reset)
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -18,31 +19,39 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public class TestCasePlayer : OsuTestCase
|
||||
{
|
||||
private readonly Type ruleset;
|
||||
|
||||
protected Player Player;
|
||||
private RulesetStore rulesets;
|
||||
|
||||
public override string Description => @"Showing everything to play the game.";
|
||||
|
||||
/// <summary>
|
||||
/// Create a TestCase which runs through the Player screen.
|
||||
/// </summary>
|
||||
/// <param name="ruleset">An optional ruleset type which we want to target. If not provided we'll allow all rulesets to be tested.</param>
|
||||
protected TestCasePlayer(Type ruleset)
|
||||
{
|
||||
this.ruleset = ruleset;
|
||||
}
|
||||
|
||||
public TestCasePlayer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetStore rulesets)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Add(new Box
|
||||
{
|
||||
RelativeSizeAxes = Framework.Graphics.Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
});
|
||||
|
||||
foreach (var r in rulesets.Query<RulesetInfo>())
|
||||
AddStep(r.Name, () => loadPlayerFor(r));
|
||||
string instantiation = ruleset?.AssemblyQualifiedName;
|
||||
|
||||
loadPlayerFor(rulesets.Query<RulesetInfo>().First());
|
||||
foreach (var r in rulesets.Query<RulesetInfo>(rs => rs.Available && (instantiation == null || rs.InstantiationInfo == instantiation)))
|
||||
AddStep(r.Name, () => loadPlayerFor(r));
|
||||
}
|
||||
|
||||
protected virtual Beatmap CreateBeatmap()
|
||||
|
Reference in New Issue
Block a user