1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 10:07:27 +08:00

Fix skin texture lookups not handling paths with extensions

This commit is contained in:
Salman Ahmed 2022-04-07 15:07:14 +03:00
parent 5b29ddd2ed
commit fb9fe4213d

View File

@ -443,9 +443,7 @@ namespace osu.Game.Skinning
string lookupName = name.Replace(@"@2x", string.Empty); string lookupName = name.Replace(@"@2x", string.Empty);
float ratio = 2; float ratio = 2;
string twoTimesFilename = Path.HasExtension(lookupName) string twoTimesFilename = $"{Path.ChangeExtension(lookupName, null)}@2x{Path.GetExtension(lookupName)}";
? @$"{Path.GetFileNameWithoutExtension(lookupName)}@2x{Path.GetExtension(lookupName)}"
: @$"{lookupName}@2x";
var texture = Textures?.Get(twoTimesFilename, wrapModeS, wrapModeT); var texture = Textures?.Get(twoTimesFilename, wrapModeS, wrapModeT);