2020-10-14 15:46:13 +08:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
|
|
|
public class SkinnableComboCounter : SkinnableDrawable, IComboCounter
|
|
|
|
{
|
2020-10-15 14:37:40 +08:00
|
|
|
public Bindable<int> Current { get; } = new Bindable<int>();
|
|
|
|
|
2020-10-14 15:46:13 +08:00
|
|
|
public SkinnableComboCounter()
|
2020-10-15 14:37:40 +08:00
|
|
|
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), skinComponent => new DefaultComboCounter())
|
2020-10-14 15:46:13 +08:00
|
|
|
{
|
2020-10-14 16:20:10 +08:00
|
|
|
CentreComponent = false;
|
2020-10-14 15:46:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private IComboCounter skinnedCounter;
|
|
|
|
|
|
|
|
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
|
|
|
{
|
|
|
|
base.SkinChanged(skin, allowFallback);
|
|
|
|
|
2020-10-14 22:52:58 +08:00
|
|
|
skinnedCounter = Drawable as IComboCounter;
|
|
|
|
skinnedCounter?.Current.BindTo(Current);
|
2020-10-14 15:46:13 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|