2023-10-23 06:58:41 +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;
|
2023-11-07 05:54:34 +08:00
|
|
|
using osu.Framework.Extensions.LocalisationExtensions;
|
2023-10-23 06:58:41 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Localisation;
|
|
|
|
using osu.Game.Configuration;
|
2023-11-15 12:45:23 +08:00
|
|
|
using osu.Game.Localisation.SkinComponents;
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2023-10-23 06:58:41 +08:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
|
|
|
public partial class ArgonScoreCounter : GameplayScoreCounter, ISerialisableDrawable
|
|
|
|
{
|
2023-11-10 14:06:19 +08:00
|
|
|
protected override double RollingDuration => 500;
|
|
|
|
protected override Easing RollingEasing => Easing.OutQuint;
|
|
|
|
|
2023-10-23 06:58:41 +08:00
|
|
|
[SettingSource("Wireframe opacity", "Controls the opacity of the wire frames behind the digits.")]
|
2023-11-10 14:39:17 +08:00
|
|
|
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.25f)
|
2023-10-23 06:58:41 +08:00
|
|
|
{
|
|
|
|
Precision = 0.01f,
|
|
|
|
MinValue = 0,
|
|
|
|
MaxValue = 1,
|
|
|
|
};
|
|
|
|
|
2023-11-15 12:45:23 +08:00
|
|
|
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.ShowLabel), nameof(SkinnableComponentStrings.ShowLabelDescription))]
|
2023-11-16 13:18:49 +08:00
|
|
|
public Bindable<bool> ShowLabel { get; } = new BindableBool(true);
|
2023-11-15 12:45:23 +08:00
|
|
|
|
2023-10-23 06:58:41 +08:00
|
|
|
public bool UsesFixedAnchor { get; set; }
|
|
|
|
|
2023-11-07 05:54:34 +08:00
|
|
|
protected override LocalisableString FormatCount(long count) => count.ToLocalisableString();
|
|
|
|
|
2023-11-15 12:45:23 +08:00
|
|
|
protected override IHasText CreateText() => new ArgonScoreTextComponent(Anchor.TopRight, BeatmapsetsStrings.ShowScoreboardHeadersScore.ToUpper())
|
2023-10-23 06:58:41 +08:00
|
|
|
{
|
2023-11-07 05:54:34 +08:00
|
|
|
RequiredDisplayDigits = { BindTarget = RequiredDisplayDigits },
|
|
|
|
WireframeOpacity = { BindTarget = WireframeOpacity },
|
2023-11-15 12:45:23 +08:00
|
|
|
ShowLabel = { BindTarget = ShowLabel },
|
2023-10-23 06:58:41 +08:00
|
|
|
};
|
2023-11-08 06:49:13 +08:00
|
|
|
|
|
|
|
private partial class ArgonScoreTextComponent : ArgonCounterTextComponent
|
|
|
|
{
|
|
|
|
public ArgonScoreTextComponent(Anchor anchor, LocalisableString? label = null)
|
|
|
|
: base(anchor, label)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2023-10-23 06:58:41 +08:00
|
|
|
}
|
|
|
|
}
|