mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 08:12:56 +08:00
Add setting to show or hide the moving average arrow
This commit is contained in:
parent
3f92bef9df
commit
331cb2aa80
@ -30,6 +30,9 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
|||||||
Precision = 0.1f,
|
Precision = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[SettingSource("Show moving average arrow", "Whether an arrow should move beneath the bar showing the average error.")]
|
||||||
|
public Bindable<bool> ShowMovingAverage { get; } = new BindableBool(true);
|
||||||
|
|
||||||
private SpriteIcon arrow;
|
private SpriteIcon arrow;
|
||||||
private SpriteIcon iconEarly;
|
private SpriteIcon iconEarly;
|
||||||
private SpriteIcon iconLate;
|
private SpriteIcon iconLate;
|
||||||
@ -41,6 +44,12 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
|||||||
|
|
||||||
private double maxHitWindow;
|
private double maxHitWindow;
|
||||||
|
|
||||||
|
private double floatingAverage;
|
||||||
|
private Container colourBars;
|
||||||
|
private Container arrowContainer;
|
||||||
|
|
||||||
|
private const int max_concurrent_judgements = 50;
|
||||||
|
|
||||||
public BarHitErrorMeter()
|
public BarHitErrorMeter()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
@ -134,13 +143,16 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
arrowContainer = new Container
|
||||||
{
|
{
|
||||||
Name = "average chevron",
|
Name = "average chevron",
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreRight,
|
||||||
Width = chevron_size,
|
Width = chevron_size,
|
||||||
|
X = chevron_size,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Alpha = 0,
|
||||||
|
Scale = new Vector2(0, 1),
|
||||||
Child = arrow = new SpriteIcon
|
Child = arrow = new SpriteIcon
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -164,8 +176,15 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
|||||||
colourBars.Height = 0;
|
colourBars.Height = 0;
|
||||||
colourBars.ResizeHeightTo(1, 800, Easing.OutQuint);
|
colourBars.ResizeHeightTo(1, 800, Easing.OutQuint);
|
||||||
|
|
||||||
arrow.Alpha = 0;
|
// delay the arrow appearance animation for only the initial appearance.
|
||||||
arrow.Delay(200).FadeInFromZero(600);
|
using (arrowContainer.BeginDelayedSequence(250))
|
||||||
|
{
|
||||||
|
ShowMovingAverage.BindValueChanged(visible =>
|
||||||
|
{
|
||||||
|
arrowContainer.FadeTo(visible.NewValue ? 1 : 0, 250, Easing.OutQuint);
|
||||||
|
arrowContainer.ScaleTo(visible.NewValue ? new Vector2(1) : new Vector2(0, 1), 250, Easing.OutQuint);
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
@ -233,11 +252,6 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private double floatingAverage;
|
|
||||||
private Container colourBars;
|
|
||||||
|
|
||||||
private const int max_concurrent_judgements = 50;
|
|
||||||
|
|
||||||
protected override void OnNewJudgement(JudgementResult judgement)
|
protected override void OnNewJudgement(JudgementResult judgement)
|
||||||
{
|
{
|
||||||
const int arrow_move_duration = 800;
|
const int arrow_move_duration = 800;
|
||||||
|
Loading…
Reference in New Issue
Block a user