2023-02-16 06:18:02 +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.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2023-04-06 03:34:36 +08:00
|
|
|
using osu.Game.Screens.Play.HUD;
|
2023-02-16 06:18:02 +08:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
{
|
|
|
|
public partial class ArgonKeyCounterDisplay : KeyCounterDisplay
|
|
|
|
{
|
|
|
|
private const int duration = 100;
|
|
|
|
|
2023-04-25 20:22:55 +08:00
|
|
|
protected override FillFlowContainer<KeyCounter> KeyFlow { get; }
|
2023-04-06 03:34:36 +08:00
|
|
|
|
|
|
|
public ArgonKeyCounterDisplay()
|
2023-02-16 06:18:02 +08:00
|
|
|
{
|
2023-04-25 20:22:55 +08:00
|
|
|
InternalChild = KeyFlow = new FillFlowContainer<KeyCounter>
|
2023-04-06 03:34:36 +08:00
|
|
|
{
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Alpha = 0,
|
|
|
|
Spacing = new Vector2(2),
|
|
|
|
};
|
2023-02-16 06:18:02 +08:00
|
|
|
}
|
|
|
|
|
2023-04-06 03:34:36 +08:00
|
|
|
protected override void Update()
|
2023-02-16 06:18:02 +08:00
|
|
|
{
|
2023-04-06 03:34:36 +08:00
|
|
|
base.Update();
|
2023-02-16 06:18:02 +08:00
|
|
|
|
2023-04-25 20:22:55 +08:00
|
|
|
Size = KeyFlow.Size;
|
2023-02-16 06:18:02 +08:00
|
|
|
}
|
|
|
|
|
2023-04-25 20:22:55 +08:00
|
|
|
protected override KeyCounter CreateCounter(InputTrigger trigger) => new ArgonKeyCounter(trigger);
|
2023-02-16 06:18:02 +08:00
|
|
|
|
|
|
|
protected override void UpdateVisibility()
|
2023-04-25 20:22:55 +08:00
|
|
|
=> KeyFlow.FadeTo(AlwaysVisible.Value || ConfigVisibility.Value ? 1 : 0, duration);
|
2023-02-16 06:18:02 +08:00
|
|
|
}
|
|
|
|
}
|