1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Miscellaneous fixes that don't fit elsewhere

This commit is contained in:
Dean Herbert 2021-11-22 16:10:13 +09:00
parent df088f96f4
commit e6fdd0e969
5 changed files with 5 additions and 9 deletions

View File

@ -37,7 +37,6 @@ namespace osu.Game.Tests.Visual.SongSelect
private BeatmapInfo exampleBeatmapInfo => new BeatmapInfo
{
RulesetID = 0,
Ruleset = rulesets.AvailableRulesets.First(),
BaseDifficulty = new BeatmapDifficulty
{

View File

@ -378,11 +378,7 @@ namespace osu.Game.Tests.Visual.SongSelect
var rulesetBeatmapSet = TestResources.CreateTestBeatmapSetInfo(1);
var taikoRuleset = rulesets.AvailableRulesets.ElementAt(1);
rulesetBeatmapSet.Beatmaps.ForEach(b =>
{
b.Ruleset = taikoRuleset;
b.RulesetID = 1;
});
rulesetBeatmapSet.Beatmaps.ForEach(b => b.Ruleset = taikoRuleset);
sets.Add(rulesetBeatmapSet);
});

View File

@ -458,7 +458,7 @@ namespace osu.Game
// Use all beatmaps if predicate matched nothing
if (beatmaps.Count == 0)
beatmaps = databasedSet.Beatmaps;
beatmaps = databasedSet.Beatmaps.ToList();
// Prefer recommended beatmap if recommendations are available, else fallback to a sane selection.
var selection = difficultyRecommender.GetRecommendedBeatmap(beatmaps)

View File

@ -184,7 +184,7 @@ namespace osu.Game.Screens.Select
private void load(OsuColour colours, LocalisationManager localisation, BeatmapDifficultyCache difficultyCache)
{
var beatmapInfo = working.BeatmapInfo;
var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
var metadata = beatmapInfo.Metadata;
RelativeSizeAxes = Axes.Both;

View File

@ -96,7 +96,8 @@ namespace osu.Game.Storyboards
public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore)
{
Drawable drawable = null;
string storyboardPath = BeatmapInfo.BeatmapSet?.Files.Find(f => f.Filename.Equals(path, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath();
string storyboardPath = BeatmapInfo.BeatmapSet?.Files.FirstOrDefault(f => f.Filename.Equals(path, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath();
if (!string.IsNullOrEmpty(storyboardPath))
drawable = new Sprite { Texture = textureStore.Get(storyboardPath) };