2020-10-15 15:31:21 +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.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Graphics;
|
2021-04-30 11:42:32 +08:00
|
|
|
using osu.Game.Skinning;
|
2020-10-15 15:31:21 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
2021-05-07 15:30:08 +08:00
|
|
|
public class DefaultScoreCounter : GameplayScoreCounter, ISkinnableComponent
|
2020-10-15 15:31:21 +08:00
|
|
|
{
|
|
|
|
public DefaultScoreCounter()
|
|
|
|
: base(6)
|
|
|
|
{
|
|
|
|
Anchor = Anchor.TopCentre;
|
|
|
|
Origin = Anchor.TopCentre;
|
|
|
|
}
|
|
|
|
|
2020-10-15 15:56:05 +08:00
|
|
|
[Resolved(canBeNull: true)]
|
|
|
|
private HUDOverlay hud { get; set; }
|
|
|
|
|
2020-10-15 15:31:21 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
Colour = colours.BlueLighter;
|
2020-10-15 15:56:05 +08:00
|
|
|
|
|
|
|
// todo: check if default once health display is skinnable
|
|
|
|
hud?.ShowHealthbar.BindValueChanged(healthBar =>
|
|
|
|
{
|
|
|
|
this.MoveToY(healthBar.NewValue ? 30 : 0, HUDOverlay.FADE_DURATION, HUDOverlay.FADE_EASING);
|
|
|
|
}, true);
|
2020-10-15 15:31:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|