1
0
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:
Bartłomiej Dach 2022-01-16 19:44:04 +01:00
parent 8e5ff201a1
commit cbaa3de548
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -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)