mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Update usage of CircularProgress.Current
This commit is contained in:
parent
09c6c5d79b
commit
6455c0583b
@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
Origin = Anchor.Centre,
|
||||
Colour = Color4.White.Opacity(0.25f),
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Current = { Value = arc_fill },
|
||||
Progress = arc_fill,
|
||||
Rotation = 90 - arc_fill * 180,
|
||||
InnerRadius = arc_radius,
|
||||
RoundedCaps = true,
|
||||
@ -71,9 +71,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
background.Alpha = spinner.Progress >= 1 ? 0 : 1;
|
||||
|
||||
fill.Alpha = (float)Interpolation.DampContinuously(fill.Alpha, spinner.Progress > 0 && spinner.Progress < 1 ? 1 : 0, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
fill.Current.Value = (float)Interpolation.DampContinuously(fill.Current.Value, spinner.Progress >= 1 ? 0 : arc_fill * spinner.Progress, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
fill.Progress = (float)Interpolation.DampContinuously(fill.Progress, spinner.Progress >= 1 ? 0 : arc_fill * spinner.Progress, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
|
||||
fill.Rotation = (float)(90 - fill.Current.Value * 180);
|
||||
fill.Rotation = (float)(90 - fill.Progress * 180);
|
||||
}
|
||||
|
||||
private partial class ProgressFill : CircularProgress
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Current = { Value = arc_fill },
|
||||
Progress = arc_fill,
|
||||
Rotation = -arc_fill * 180,
|
||||
InnerRadius = arc_radius,
|
||||
RoundedCaps = true,
|
||||
@ -44,10 +44,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
{
|
||||
base.Update();
|
||||
|
||||
fill.Current.Value = (float)Interpolation.DampContinuously(fill.Current.Value, spinner.Progress >= 1 ? arc_fill_complete : arc_fill, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
fill.Progress = (float)Interpolation.DampContinuously(fill.Progress, spinner.Progress >= 1 ? arc_fill_complete : arc_fill, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
fill.InnerRadius = (float)Interpolation.DampContinuously(fill.InnerRadius, spinner.Progress >= 1 ? arc_radius * 2.2f : arc_radius, 40f, (float)Math.Abs(Time.Elapsed));
|
||||
|
||||
fill.Rotation = (float)(-fill.Current.Value * 180);
|
||||
fill.Rotation = (float)(-fill.Progress * 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,11 +86,15 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
Dimmed.BindValueChanged(_ => updateState());
|
||||
|
||||
playButton.Playing.BindValueChanged(_ => updateState(), true);
|
||||
((IBindable<double>)progress.Current).BindTo(playButton.Progress);
|
||||
|
||||
FinishTransforms(true);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
progress.Progress = playButton.Progress.Value;
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
bool shouldDim = Dimmed.Value || playButton.Playing.Value;
|
||||
|
@ -235,7 +235,7 @@ namespace osu.Game.Overlays.Volume
|
||||
|
||||
Bindable.BindValueChanged(volume => { this.TransformTo(nameof(DisplayVolume), volume.NewValue, 400, Easing.OutQuint); }, true);
|
||||
|
||||
bgProgress.Current.Value = 0.75f;
|
||||
bgProgress.Progress = 0.75f;
|
||||
}
|
||||
|
||||
private int? displayVolumeInt;
|
||||
@ -265,8 +265,8 @@ namespace osu.Game.Overlays.Volume
|
||||
text.Text = intValue.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
|
||||
volumeCircle.Current.Value = displayVolume * 0.75f;
|
||||
volumeCircleGlow.Current.Value = displayVolume * 0.75f;
|
||||
volumeCircle.Progress = displayVolume * 0.75f;
|
||||
volumeCircleGlow.Progress = displayVolume * 0.75f;
|
||||
|
||||
if (intVolumeChanged && IsLoaded)
|
||||
Scheduler.AddOnce(playTickSound);
|
||||
|
@ -140,7 +140,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
Colour = this.baseColour = baseColour;
|
||||
|
||||
Current.Value = 1;
|
||||
Progress = 1;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -366,7 +366,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
new CircularProgress
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Current = { Value = 1f / light_count - angular_light_gap },
|
||||
Progress = 1f / light_count - angular_light_gap,
|
||||
Colour = colourProvider.Background2,
|
||||
},
|
||||
fillContent = new Container
|
||||
@ -379,7 +379,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
new CircularProgress
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Current = { Value = 1f / light_count - angular_light_gap },
|
||||
Progress = 1f / light_count - angular_light_gap,
|
||||
Blending = BlendingParameters.Additive
|
||||
},
|
||||
// Please do not try and make sense of this.
|
||||
@ -388,7 +388,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
Glow = new CircularProgress
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Current = { Value = 1f / light_count - 0.01f },
|
||||
Progress = 1f / light_count - 0.01f,
|
||||
Blending = BlendingParameters.Additive
|
||||
}.WithEffect(new GlowEffect
|
||||
{
|
||||
|
@ -198,9 +198,14 @@ namespace osu.Game.Screens.Play.HUD
|
||||
bind();
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
circularProgress.Progress = Progress.Value;
|
||||
}
|
||||
|
||||
private void bind()
|
||||
{
|
||||
((IBindable<double>)circularProgress.Current).BindTo(Progress);
|
||||
Progress.ValueChanged += progress =>
|
||||
{
|
||||
icon.Scale = new Vector2(1 + (float)progress.NewValue * 0.2f);
|
||||
|
@ -147,7 +147,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
Colour = OsuColour.Gray(47),
|
||||
Alpha = 0.5f,
|
||||
InnerRadius = accuracy_circle_radius + 0.01f, // Extends a little bit into the circle
|
||||
Current = { Value = 1 },
|
||||
Progress = 1,
|
||||
},
|
||||
accuracyCircle = new CircularProgress
|
||||
{
|
||||
@ -268,7 +268,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
if (targetAccuracy < 1 && targetAccuracy >= visual_alignment_offset)
|
||||
targetAccuracy -= visual_alignment_offset;
|
||||
|
||||
accuracyCircle.FillTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);
|
||||
accuracyCircle.ProgressTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);
|
||||
|
||||
if (withFlair)
|
||||
{
|
||||
@ -359,7 +359,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
.FadeOut(800, Easing.Out);
|
||||
|
||||
accuracyCircle
|
||||
.FillTo(accuracyS - GRADE_SPACING_PERCENTAGE / 2 - visual_alignment_offset, 70, Easing.OutQuint);
|
||||
.ProgressTo(accuracyS - GRADE_SPACING_PERCENTAGE / 2 - visual_alignment_offset, 70, Easing.OutQuint);
|
||||
|
||||
badges.Single(b => b.Rank == getRank(ScoreRank.S))
|
||||
.FadeOut(70, Easing.OutQuint);
|
||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
{
|
||||
public double RevealProgress
|
||||
{
|
||||
set => Current.Value = Math.Clamp(value, startProgress, endProgress) - startProgress;
|
||||
set => Progress = Math.Clamp(value, startProgress, endProgress) - startProgress;
|
||||
}
|
||||
|
||||
private readonly double startProgress;
|
||||
|
@ -72,14 +72,14 @@ namespace osu.Game.Skinning
|
||||
circularProgress.Scale = new Vector2(-1, 1);
|
||||
circularProgress.Anchor = Anchor.TopRight;
|
||||
circularProgress.Colour = new Colour4(199, 255, 47, 153);
|
||||
circularProgress.Current.Value = 1 - progress;
|
||||
circularProgress.Progress = 1 - progress;
|
||||
}
|
||||
else
|
||||
{
|
||||
circularProgress.Scale = new Vector2(1);
|
||||
circularProgress.Anchor = Anchor.TopLeft;
|
||||
circularProgress.Colour = new Colour4(255, 255, 255, 153);
|
||||
circularProgress.Current.Value = progress;
|
||||
circularProgress.Progress = progress;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user