Move default skin cross-component dependencies out to default specifications

This commit is contained in:
Dean Herbert
2021-05-11 14:12:28 +09:00
parent 12684de66e
commit 944f09ec98
4 changed files with 64 additions and 48 deletions

View File

@ -9,14 +9,11 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Screens.Play.HUD
{
public class DefaultComboCounter : RollingCounter<int>, ISkinnableComponent
{
private readonly Vector2 offset = new Vector2(20, 5);
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
@ -32,17 +29,6 @@ namespace osu.Game.Screens.Play.HUD
Current.BindTo(scoreProcessor.Combo);
}
protected override void Update()
{
base.Update();
if (hud?.ScoreCounter.Drawable is DefaultScoreCounter score)
{
// for now align with the score counter. eventually this will be user customisable.
Position = Parent.ToLocalSpace(score.ScreenSpaceDrawQuad.TopRight) + offset;
}
}
protected override string FormatCount(int count)
{
return $@"{count}x";