mirror of
https://github.com/ppy/osu.git
synced 2024-11-19 02:22:56 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
a6ecc2897a
@ -691,19 +691,19 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
protected override Storyboard GetStoryboard()
|
protected override Storyboard GetStoryboard()
|
||||||
{
|
{
|
||||||
if (BeatmapInfo?.Path == null && BeatmapSetInfo?.StoryboardFile == null)
|
|
||||||
return new Storyboard();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Decoder decoder;
|
|
||||||
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path))))
|
|
||||||
decoder = Decoder.GetDecoder(stream);
|
|
||||||
|
|
||||||
// try for .osb first and fall back to .osu
|
using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
|
||||||
string storyboardFile = BeatmapSetInfo.StoryboardFile ?? BeatmapInfo.Path;
|
{
|
||||||
using (var stream = new StreamReader(store.GetStream(getPathForFile(storyboardFile))))
|
Decoder decoder = Decoder.GetDecoder(beatmap);
|
||||||
return decoder.GetStoryboardDecoder().DecodeStoryboard(stream);
|
|
||||||
|
if (BeatmapSetInfo?.StoryboardFile == null)
|
||||||
|
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap);
|
||||||
|
|
||||||
|
using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||||
|
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -70,9 +70,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
protected abstract void ParseBeatmap(StreamReader stream, Beatmap beatmap);
|
protected abstract void ParseBeatmap(StreamReader stream, Beatmap beatmap);
|
||||||
|
|
||||||
public virtual Storyboard DecodeStoryboard(StreamReader stream)
|
public virtual Storyboard DecodeStoryboard(params StreamReader[] streams)
|
||||||
{
|
{
|
||||||
var storyboard = new Storyboard();
|
var storyboard = new Storyboard();
|
||||||
|
foreach (StreamReader stream in streams)
|
||||||
ParseStoryboard(stream, storyboard);
|
ParseStoryboard(stream, storyboard);
|
||||||
return storyboard;
|
return storyboard;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user