Skip to content

Commit

Permalink
allow skinning results grades
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Sep 5, 2024
1 parent 3b56779 commit 6b47d35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fluXis.Game/Skinning/Custom/CustomSkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ public AbstractJudgementText GetJudgement(Judgement judgement, bool isLate)
return null;
}

public Drawable GetResultsScoreRank(ScoreRank rank) => null;
public Drawable GetResultsScoreRank(ScoreRank rank)
{
var path = SkinJson.GetOverrideOrDefault($"Results/rank-{rank.ToString().ToLower()}") + ".png";
return storage.Exists(path) ? new SkinnableSprite(textures.Get(path)) : null;
}

public Sample GetHitSample() => samples.Get("Samples/Gameplay/hit");

Expand Down
6 changes: 6 additions & 0 deletions fluXis.Game/Skinning/SkinnableSprite.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;

namespace fluXis.Game.Skinning;

public partial class SkinnableSprite : Sprite
{
public SkinnableSprite(Texture texture = null)
{
Texture = texture;
}

protected override void Update()
{
if (Texture != null)
Expand Down

0 comments on commit 6b47d35

Please sign in to comment.