mirror of
https://github.com/osukey/osukey.git
synced 2025-06-29 23:28:00 +09: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>
|
public class DrawableStoryboard : Container<DrawableStoryboardLayer>
|
||||||
{
|
{
|
||||||
|
[Cached]
|
||||||
public Storyboard Storyboard { get; }
|
public Storyboard Storyboard { get; }
|
||||||
|
|
||||||
protected override Container<DrawableStoryboardLayer> Content { get; }
|
protected override Container<DrawableStoryboardLayer> Content { get; }
|
||||||
|
@ -117,19 +117,16 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[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++)
|
for (var frame = 0; frame < Animation.FrameCount; frame++)
|
||||||
{
|
{
|
||||||
var framePath = Animation.Path.Replace(".", frame + ".");
|
var framePath = Animation.Path.Replace(".", frame + ".");
|
||||||
|
|
||||||
var storyboardPath = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.Equals(framePath, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
|
var storyboardPath = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.Equals(framePath, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
|
||||||
var frameSprite = storyboardPath != null
|
var frameSprite = storyboard.UseSkinSprites && storyboardPath == null
|
||||||
? (Drawable)new Sprite
|
? (Drawable)new SkinnableSprite(framePath)
|
||||||
{
|
: new Sprite { Texture = textureStore.Get(storyboardPath) };
|
||||||
Texture = textureStore.Get(storyboardPath)
|
|
||||||
}
|
|
||||||
: new SkinnableSprite(framePath); // fall back to skin textures if not found in storyboard files.
|
|
||||||
|
|
||||||
AddFrame(frameSprite, Animation.FrameDelay);
|
AddFrame(frameSprite, Animation.FrameDelay);
|
||||||
}
|
}
|
||||||
|
@ -116,15 +116,12 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[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 storyboardPath = beatmap.Value.BeatmapSetInfo?.Files?.Find(f => f.Filename.Equals(Sprite.Path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
|
||||||
var sprite = storyboardPath != null
|
var sprite = storyboard.UseSkinSprites && storyboardPath == null
|
||||||
? (Drawable)new Sprite
|
? (Drawable)new SkinnableSprite(Sprite.Path)
|
||||||
{
|
: new Sprite { Texture = textureStore.Get(storyboardPath) };
|
||||||
Texture = textureStore.Get(storyboardPath)
|
|
||||||
}
|
|
||||||
: new SkinnableSprite(Sprite.Path); // fall back to skin textures if not found in storyboard files.
|
|
||||||
|
|
||||||
InternalChild = sprite.With(s => s.Anchor = s.Origin = Anchor.Centre);
|
InternalChild = sprite.With(s => s.Anchor = s.Origin = Anchor.Centre);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user