mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Inline single usage of StoryboardFile
to avoid interface default method woes
This commit is contained in:
parent
8bfdfe3672
commit
4df5f93152
@ -107,12 +107,14 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
var decoder = Decoder.GetDecoder<Storyboard>(stream);
|
||||
|
||||
var storyboardFilename = BeatmapSetInfo?.Files.FirstOrDefault(f => f.Filename.EndsWith(".osb", StringComparison.OrdinalIgnoreCase))?.Filename;
|
||||
|
||||
// todo: support loading from both set-wide storyboard *and* beatmap specific.
|
||||
if (BeatmapSetInfo?.StoryboardFile == null)
|
||||
if (string.IsNullOrEmpty(storyboardFilename))
|
||||
storyboard = decoder.Decode(stream);
|
||||
else
|
||||
{
|
||||
using (var secondaryStream = new LineBufferedReader(GetStream(BeatmapSetInfo.GetPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||
using (var secondaryStream = new LineBufferedReader(GetStream(BeatmapSetInfo.GetPathForFile(storyboardFilename))))
|
||||
storyboard = decoder.Decode(stream, secondaryStream);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
|
||||
@ -62,9 +61,6 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public string Hash { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string StoryboardFile => ((IBeatmapSetInfo)this).StoryboardFile;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the storage path for the file in this beatmapset with the given filename, if any exists, otherwise null.
|
||||
/// The path returned is relative to the user file storage.
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Database;
|
||||
|
||||
#nullable enable
|
||||
@ -49,10 +48,5 @@ namespace osu.Game.Beatmaps
|
||||
/// The maximum BPM of all beatmaps in this set.
|
||||
/// </summary>
|
||||
double MaxBPM { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The filename for the storyboard.
|
||||
/// </summary>
|
||||
string StoryboardFile => Files.FirstOrDefault(f => f.Filename.EndsWith(@".osb", StringComparison.OrdinalIgnoreCase))?.Filename ?? string.Empty;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user