1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 19:23:21 +08:00

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, Colour = colours.YellowLight,
} }
}; };
}
protected override void LoadComplete() Current.BindValueChanged(text => valueText.Text = Format(text.NewValue));
{
base.LoadComplete();
Current.BindValueChanged(text => valueText.Text = Format(text.NewValue), true);
} }
protected virtual LocalisableString Format(T count) protected virtual LocalisableString Format(T count)

View File

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