mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:13:20 +08:00
readd storyboard to beatmap + minor cleanup
This commit is contained in:
parent
96f5bd3323
commit
016057ab01
@ -41,6 +41,11 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
public double TotalBreakTime => Breaks.Sum(b => b.Duration);
|
||||
|
||||
/// <summary>
|
||||
/// The Beatmap's Storyboard.
|
||||
/// </summary>
|
||||
public Storyboard Storyboard = new Storyboard();
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new beatmap.
|
||||
/// </summary>
|
||||
@ -52,6 +57,7 @@ namespace osu.Game.Beatmaps
|
||||
Breaks = original?.Breaks ?? Breaks;
|
||||
ComboColors = original?.ComboColors ?? ComboColors;
|
||||
HitObjects = original?.HitObjects ?? HitObjects;
|
||||
Storyboard = original?.Storyboard ?? Storyboard;
|
||||
|
||||
if (original == null && Metadata == null)
|
||||
{
|
||||
|
@ -569,16 +569,11 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
try
|
||||
{
|
||||
Beatmap beatmap;
|
||||
|
||||
BeatmapDecoder decoder;
|
||||
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
|
||||
{
|
||||
decoder = BeatmapDecoder.GetDecoder(stream);
|
||||
beatmap = decoder.Decode(stream);
|
||||
BeatmapDecoder decoder = BeatmapDecoder.GetDecoder(stream);
|
||||
return decoder.Decode(stream);
|
||||
}
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -622,9 +617,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
try
|
||||
{
|
||||
Beatmap beatmap = Beatmap;
|
||||
|
||||
if (beatmap == null || BeatmapSetInfo.StoryboardFile == null)
|
||||
if (Beatmap == null || BeatmapSetInfo.StoryboardFile == null)
|
||||
return new Storyboard();
|
||||
|
||||
BeatmapDecoder decoder;
|
||||
@ -632,9 +625,9 @@ namespace osu.Game.Beatmaps
|
||||
decoder = BeatmapDecoder.GetDecoder(stream);
|
||||
|
||||
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
|
||||
decoder.Decode(stream, beatmap);
|
||||
decoder.Decode(stream, Beatmap);
|
||||
|
||||
return beatmap.Storyboard;
|
||||
return Beatmap.Storyboard;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void initializeStoryboard(bool asyncLoad)
|
||||
{
|
||||
var beatmap = Beatmap.Value.Beatmap;
|
||||
var beatmap = Beatmap.Value;
|
||||
|
||||
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
|
||||
storyboard.Masking = true;
|
||||
@ -388,7 +388,7 @@ namespace osu.Game.Screens.Play
|
||||
initializeStoryboard(true);
|
||||
|
||||
var beatmap = Beatmap.Value;
|
||||
var storyboardVisible = showStoryboard && beatmap.Beatmap.Storyboard.HasDrawable;
|
||||
var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable;
|
||||
|
||||
storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800);
|
||||
storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0);
|
||||
|
Loading…
Reference in New Issue
Block a user