Skip to content

Commit

Permalink
Fix skin vs store lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
goodtrailer committed Feb 1, 2024
1 parent d0df1da commit ba20bdf
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultApproachCircle()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.ApproachCircle).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.ApproachCircle);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultHitCircle()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HitCircle).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HitCircle);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultHitCircleOverlay()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HitCircleOverlay).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HitCircleOverlay);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultHoldOverlay()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HoldOverlay).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.HoldOverlay);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultInputOverlayBackground()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.InputOverlayBackground).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.InputOverlayBackground);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultInputOverlayKey()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.InputOverlayKey).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.InputOverlayKey);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public DefaultKiaiVisualizerSquare()
[BackgroundDependencyLoader]
private void load(TextureStore textures, ISkinSource skin)
{
var textureName = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.KiaiVisualizerSquare).LookupName;
var lookup = new SoyokazeSkinComponentLookup(SoyokazeSkinComponents.KiaiVisualizerSquare);
AddInternal(new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Texture = skin.GetTexture(textureName) ?? textures.Get(textureName),
Texture = skin.GetTexture(lookup.LookupName) ?? textures.Get(lookup.StoreName),
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public SoyokazeSkinComponentLookup(SoyokazeSkinComponents component)
{
}

public string LookupName => string.Join('/', new[] { "Gameplay", RulesetPrefix, ComponentName }.Where(s => !string.IsNullOrEmpty(s)));
// TODO: THIS IS A HORROR
public string LookupName => ComponentName;

public string StoreName => string.Join('/', new[] { "Gameplay", RulesetPrefix, ComponentName }.Where(s => !string.IsNullOrEmpty(s)));

protected override string RulesetPrefix => SoyokazeRuleset.SHORT_NAME;

Expand Down

0 comments on commit ba20bdf

Please sign in to comment.