mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 04:22:55 +08:00
improve code
This commit is contained in:
parent
07b4f6115b
commit
fed338a42b
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -33,13 +31,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
var skin = source.FindProvider(s => getTexture(s, "A") != null);
|
||||
|
||||
rank.Texture = getTexture(skin, scoreProcessor.Rank.Value.ToString());
|
||||
|
||||
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = getTexture(skin, v.NewValue.ToString()));
|
||||
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = source.GetTexture($"ranking-{v.NewValue}-small"), true);
|
||||
}
|
||||
|
||||
private static Texture getTexture(ISkin skin, string name) => skin?.GetTexture($"ranking-{name}-small");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user