mirror of
https://github.com/ppy/osu
synced 2025-01-28 16:53:02 +00:00
Utilise UseSkinSprites value in storyboard sprite logic
This commit is contained in:
parent
cdd56ece87
commit
58a54c5b6c
@ -15,6 +15,7 @@ namespace osu.Game.Storyboards.Drawables
|
||||
{
|
||||
public class DrawableStoryboard : Container<DrawableStoryboardLayer>
|
||||
{
|
||||
[Cached]
|
||||
public Storyboard Storyboard { get; }
|
||||
|
||||
protected override Container<DrawableStoryboardLayer> Content { get; }
|
||||
|
@ -117,19 +117,16 @@ namespace osu.Game.Storyboards.Drawables
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
|
||||
private void load(IBindable<WorkingBeatmap> 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);
|
||||
}
|
||||
|
@ -116,15 +116,12 @@ namespace osu.Game.Storyboards.Drawables
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
|
||||
private void load(IBindable<WorkingBeatmap> 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user