1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-09 19:02:58 +08:00

Also bind to mod setting changes

This commit is contained in:
Dan Balasescu 2024-10-17 17:42:40 +09:00
parent 9ea15a3961
commit f9a9ceb41c
No known key found for this signature in database

View File

@ -50,6 +50,7 @@ namespace osu.Game.Skinning.Components
private readonly OsuSpriteText text;
private IBindable<StarDifficulty?>? difficultyBindable;
private CancellationTokenSource? difficultyCancellationSource;
private ModSettingChangeTracker? modSettingTracker;
public BeatmapAttributeText()
{
@ -84,7 +85,17 @@ namespace osu.Game.Skinning.Components
updateText();
}, true);
mods.BindValueChanged(_ => updateText());
mods.BindValueChanged(m =>
{
modSettingTracker?.Dispose();
modSettingTracker = new ModSettingChangeTracker(m.NewValue)
{
SettingChanged = _ => updateText()
};
updateText();
}, true);
ruleset.BindValueChanged(_ => updateText());
updateText();