mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 10:27:35 +08:00
Ensure GameplayScoreCounter
's display score is updated on ScoringMode
change
This isn't strictly required, but only because of a kind of hacky
behaviour where `HUDOverlay` will recreate all components on a scoring
mode change currently (see
8f6df5ea0f/osu.Game/Screens/Play/HUDOverlay.cs (L410-L418)
).
Best we do this just in case that happens to go away in the future.
This commit is contained in:
parent
22be045de3
commit
9a886125ad
@ -25,6 +25,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, ScoreProcessor scoreProcessor)
|
||||
{
|
||||
totalScoreBindable = scoreProcessor.TotalScore.GetBoundCopy();
|
||||
totalScoreBindable.BindValueChanged(_ => updateDisplayScore());
|
||||
|
||||
scoreDisplayMode = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode);
|
||||
scoreDisplayMode.BindValueChanged(scoreMode =>
|
||||
{
|
||||
@ -41,10 +44,11 @@ namespace osu.Game.Screens.Play.HUD
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(scoreMode));
|
||||
}
|
||||
|
||||
updateDisplayScore();
|
||||
}, true);
|
||||
|
||||
totalScoreBindable = scoreProcessor.TotalScore.GetBoundCopy();
|
||||
totalScoreBindable.BindValueChanged(_ => Current.Value = scoreProcessor.GetDisplayScore(scoreDisplayMode.Value), true);
|
||||
void updateDisplayScore() => Current.Value = scoreProcessor.GetDisplayScore(scoreDisplayMode.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user