mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Give storyboards a BeatmapInfo to reduce weird method calls
Also removes unnecessary background texture (the actual storyboard background spec wasn't implemented correctly anyway).
This commit is contained in:
@ -75,23 +75,32 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
protected override Storyboard GetStoryboard()
|
||||
{
|
||||
Storyboard storyboard;
|
||||
try
|
||||
{
|
||||
using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
|
||||
{
|
||||
Decoder decoder = Decoder.GetDecoder(beatmap);
|
||||
|
||||
if (BeatmapSetInfo?.StoryboardFile == null)
|
||||
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap);
|
||||
// todo: support loading from both set-wide storyboard *and* baetmap specific.
|
||||
|
||||
using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard);
|
||||
if (BeatmapSetInfo?.StoryboardFile == null)
|
||||
storyboard = decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap);
|
||||
else
|
||||
{
|
||||
using (var reader = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||
storyboard = decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Storyboard();
|
||||
storyboard = new Storyboard();
|
||||
}
|
||||
|
||||
storyboard.BeatmapInfo = BeatmapInfo;
|
||||
|
||||
return storyboard;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Beatmaps
|
||||
protected abstract Texture GetBackground();
|
||||
protected abstract Track GetTrack();
|
||||
protected virtual Waveform GetWaveform() => new Waveform();
|
||||
protected virtual Storyboard GetStoryboard() => new Storyboard();
|
||||
protected virtual Storyboard GetStoryboard() => new Storyboard { BeatmapInfo = BeatmapInfo };
|
||||
|
||||
public bool BeatmapLoaded => beatmap.IsResultAvailable;
|
||||
public Beatmap Beatmap => beatmap.Value.Result;
|
||||
|
Reference in New Issue
Block a user