Fix valueText being replaced even if current is not binding to anything

This commit is contained in:
Joseph Madamba 2023-08-02 09:40:22 -07:00
parent 4ddf05602f
commit aab462fd95
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
2 changed files with 10 additions and 14 deletions

View File

@ -56,13 +56,8 @@ namespace osu.Game.Screens.Play.Break
Colour = colours.YellowLight,
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(text => valueText.Text = Format(text.NewValue), true);
Current.BindValueChanged(text => valueText.Text = Format(text.NewValue));
}
protected virtual LocalisableString Format(T count)

View File

@ -46,13 +46,14 @@ namespace osu.Game.Screens.Play
private readonly Container remainingTimeBox;
private readonly RemainingTimeCounter remainingTimeCounter;
private readonly BreakArrows breakArrows;
private readonly ScoreProcessor scoreProcessor;
private readonly BreakInfo info;
public BreakOverlay(bool letterboxing, ScoreProcessor scoreProcessor)
{
this.scoreProcessor = scoreProcessor;
RelativeSizeAxes = Axes.Both;
BreakInfo info;
Child = fadeContainer = new Container
{
Alpha = 0,
@ -102,18 +103,18 @@ namespace osu.Game.Screens.Play
}
}
};
if (scoreProcessor != null)
{
info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy);
info.GradeDisplay.Current.BindTo(scoreProcessor.Rank);
}
}
protected override void LoadComplete()
{
base.LoadComplete();
initializeBreaks();
if (scoreProcessor != null)
{
info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy);
info.GradeDisplay.Current.BindTo(scoreProcessor.Rank);
}
}
private void initializeBreaks()