mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 15:07:20 +09:00
Revert SkinnableSprite lookups to old behaviour
This commit is contained in:
parent
10862f40c6
commit
d1cdf49dd5
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string RulesetPrefix => CatchRuleset.SHORT_NAME;
|
protected override string RulesetPrefix => "catch"; // todo: use CatchRuleset.SHORT_NAME;
|
||||||
|
|
||||||
protected override string ComponentName => Component.ToString().ToLower();
|
protected override string ComponentName => Component.ToString().ToLower();
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,5 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
public enum CatchSkinComponents
|
public enum CatchSkinComponents
|
||||||
{
|
{
|
||||||
Catcher
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
InternalChild = new SkinnableSprite(new CatchSkinComponent(CatchSkinComponents.Catcher))
|
InternalChild = new SkinnableSprite("Gameplay/catch/fruit-catcher-idle")
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
private class SkinnableApproachCircle : SkinnableSprite
|
private class SkinnableApproachCircle : SkinnableSprite
|
||||||
{
|
{
|
||||||
public SkinnableApproachCircle()
|
public SkinnableApproachCircle()
|
||||||
: base(new OsuSkinComponent(OsuSkinComponents.ApproachCircle))
|
: base("Gameplay/osu/approachcircle")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,11 +19,23 @@ namespace osu.Game.Skinning
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private TextureStore textures { get; set; }
|
private TextureStore textures { get; set; }
|
||||||
|
|
||||||
public SkinnableSprite(ISkinComponent component, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.ScaleDownToFit)
|
public SkinnableSprite(string textureName, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.ScaleDownToFit)
|
||||||
: base(component, allowFallback, confineMode)
|
: base(new SpriteComponent(textureName), allowFallback, confineMode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateDefault(ISkinComponent component) => new Sprite { Texture = textures.Get(component.LookupName) };
|
protected override Drawable CreateDefault(ISkinComponent component) => new Sprite { Texture = textures.Get(component.LookupName) };
|
||||||
|
|
||||||
|
private class SpriteComponent : ISkinComponent
|
||||||
|
{
|
||||||
|
private readonly string textureName;
|
||||||
|
|
||||||
|
public SpriteComponent(string textureName)
|
||||||
|
{
|
||||||
|
this.textureName = textureName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LookupName => textureName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user