diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs index ec461fa095..4bc28e6cef 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs @@ -15,6 +15,7 @@ namespace osu.Game.Storyboards.Drawables { public class DrawableStoryboard : Container { + [Cached] public Storyboard Storyboard { get; } protected override Container Content { get; } diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs index c3b6dde44b..8382f91d1f 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs @@ -117,19 +117,16 @@ namespace osu.Game.Storyboards.Drawables } [BackgroundDependencyLoader] - private void load(IBindable beatmap, TextureStore textureStore) + private void load(IBindable beatmap, TextureStore textureStore, Storyboard storyboard) { for (var frame = 0; frame < Animation.FrameCount; frame++) { var framePath = Animation.Path.Replace(".", frame + "."); var storyboardPath = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.Equals(framePath, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; - var frameSprite = storyboardPath != null - ? (Drawable)new Sprite - { - Texture = textureStore.Get(storyboardPath) - } - : new SkinnableSprite(framePath); // fall back to skin textures if not found in storyboard files. + var frameSprite = storyboard.UseSkinSprites && storyboardPath == null + ? (Drawable)new SkinnableSprite(framePath) + : new Sprite { Texture = textureStore.Get(storyboardPath) }; AddFrame(frameSprite, Animation.FrameDelay); } diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs index 95774de898..9599375c76 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs @@ -116,15 +116,12 @@ namespace osu.Game.Storyboards.Drawables } [BackgroundDependencyLoader] - private void load(IBindable beatmap, TextureStore textureStore) + private void load(IBindable beatmap, TextureStore textureStore, Storyboard storyboard) { var storyboardPath = beatmap.Value.BeatmapSetInfo?.Files?.Find(f => f.Filename.Equals(Sprite.Path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; - var sprite = storyboardPath != null - ? (Drawable)new Sprite - { - Texture = textureStore.Get(storyboardPath) - } - : new SkinnableSprite(Sprite.Path); // fall back to skin textures if not found in storyboard files. + var sprite = storyboard.UseSkinSprites && storyboardPath == null + ? (Drawable)new SkinnableSprite(Sprite.Path) + : new Sprite { Texture = textureStore.Get(storyboardPath) }; InternalChild = sprite.With(s => s.Anchor = s.Origin = Anchor.Centre);