mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 01:42:59 +08:00
Strip @2x
scale modifiers when looking up legacy skin textures
This commit is contained in:
parent
8e5ff201a1
commit
cbaa3de548
@ -474,13 +474,18 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
foreach (string name in getFallbackNames(componentName))
|
||||
{
|
||||
// some component names (especially user-controlled ones, like `HitX` in mania)
|
||||
// may contain `@2x` scale specifications.
|
||||
// stable happens to check for that and strip them, so do the same to match stable behaviour.
|
||||
string lookupName = name.Replace(@"@2x", string.Empty);
|
||||
|
||||
float ratio = 2;
|
||||
var texture = Textures?.Get($"{name}@2x", wrapModeS, wrapModeT);
|
||||
var texture = Textures?.Get(@$"{lookupName}@2x", wrapModeS, wrapModeT);
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
ratio = 1;
|
||||
texture = Textures?.Get(name, wrapModeS, wrapModeT);
|
||||
texture = Textures?.Get(lookupName, wrapModeS, wrapModeT);
|
||||
}
|
||||
|
||||
if (texture == null)
|
||||
|
Loading…
Reference in New Issue
Block a user