1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge pull request #22103 from mk56-spn/bar_visibility_toggle_clean

Add the ability to toggle the main bar component of `BarHitErrorMeter`
This commit is contained in:
Dean Herbert 2023-01-10 18:07:47 +09:00 committed by GitHub
commit 7177225f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,9 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
Precision = 0.1f,
};
[SettingSource("Show colour bars")]
public Bindable<bool> ColourBarVisibility { get; } = new Bindable<bool>(true);
[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);
@ -108,6 +111,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
Origin = Anchor.TopCentre,
Width = bar_width,
RelativeSizeAxes = Axes.Y,
Alpha = 0,
Height = 0.5f,
Scale = new Vector2(1, -1),
},
@ -115,6 +119,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
Alpha = 0,
Width = bar_width,
RelativeSizeAxes = Axes.Y,
Height = 0.5f,
@ -178,6 +183,11 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
CentreMarkerStyle.BindValueChanged(style => recreateCentreMarker(style.NewValue), true);
LabelStyle.BindValueChanged(style => recreateLabels(style.NewValue), true);
ColourBarVisibility.BindValueChanged(visible =>
{
colourBarsEarly.FadeTo(visible.NewValue ? 1 : 0, 500, Easing.OutQuint);
colourBarsLate.FadeTo(visible.NewValue ? 1 : 0, 500, Easing.OutQuint);
}, true);
// delay the appearance animations for only the initial appearance.
using (arrowContainer.BeginDelayedSequence(450))