mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
fix load storyboard in osu file
This commit is contained in:
parent
5b6ddb984f
commit
fbffc8bb89
@ -696,14 +696,9 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
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
|
||||
string storyboardFile = BeatmapSetInfo.StoryboardFile ?? BeatmapInfo.Path;
|
||||
using (var stream = new StreamReader(store.GetStream(getPathForFile(storyboardFile))))
|
||||
return decoder.GetStoryboardDecoder().DecodeStoryboard(stream);
|
||||
using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path))))
|
||||
using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||
return Decoder.GetDecoder(beatmap).GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -70,10 +70,13 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
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();
|
||||
ParseStoryboard(stream, storyboard);
|
||||
foreach (StreamReader stream in streams)
|
||||
{
|
||||
ParseStoryboard(stream, storyboard);
|
||||
}
|
||||
return storyboard;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user