diff --git a/osu.Game.Rulesets.Catch/UI/CatcherSprite.cs b/osu.Game.Rulesets.Catch/UI/CatcherSprite.cs index 1308a9b7a1..df396279fc 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherSprite.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherSprite.cs @@ -1,11 +1,9 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; using osu.Game.Skinning; using osuTK; @@ -22,22 +20,13 @@ namespace osu.Game.Rulesets.Catch.UI } [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load() { - InternalChild = new Container + InternalChild = new SkinnableSprite(@"Play/Catch/fruit-catcher-idle") { RelativeSizeAxes = Axes.Both, - Child = new SkinnableDrawable("fruit-catcher-idle", _ => new Sprite - { - Texture = textures.Get(@"Play/Catch/fruit-catcher-idle"), - RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - }, restrictSize: true) - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - } + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, }; } } diff --git a/osu.Game/Skinning/SkinnableDrawable.cs b/osu.Game/Skinning/SkinnableDrawable.cs index 64ef50111c..dcbb63435a 100644 --- a/osu.Game/Skinning/SkinnableDrawable.cs +++ b/osu.Game/Skinning/SkinnableDrawable.cs @@ -23,7 +23,7 @@ namespace osu.Game.Skinning /// protected Drawable Drawable { get; private set; } - protected virtual T CreateDefault() => createDefault(componentName); + protected virtual T CreateDefault(string name) => createDefault(name); private readonly Func createDefault; @@ -63,7 +63,7 @@ namespace osu.Game.Skinning if (Drawable == null && allowFallback) { - Drawable = CreateDefault(); + Drawable = CreateDefault(componentName); isDefault = true; } diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index 4cf054b704..72b5740bd6 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,17 +12,14 @@ namespace osu.Game.Skinning { protected override bool ApplySizeToDefault => true; - private readonly string defaultName; - - protected override Sprite CreateDefault() => new Sprite { Texture = textures.Get(defaultName) }; + protected override Sprite CreateDefault(string name) => new Sprite { Texture = textures.Get(name) }; [Resolved] private TextureStore textures { get; set; } - public SkinnableSprite(string name, string defaultName, Func allowFallback = null, bool restrictSize = true) + public SkinnableSprite(string name, Func allowFallback = null, bool restrictSize = true) : base(name, allowFallback, restrictSize) { - this.defaultName = defaultName; } } }