Debounce and schedule updates to key combinations

This commit is contained in:
Dean Herbert 2021-11-08 18:29:11 +09:00
parent b4225804ed
commit 49c26a465c

View File

@ -522,11 +522,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
}
}
private void updateKeyCombinationText()
{
Text.Text = keyCombinationProvider.GetReadableString(KeyBinding.KeyCombination);
}
public void UpdateKeyCombination(KeyCombination newCombination)
{
if (KeyBinding.RulesetID != null && !RealmKeyBindingStore.CheckValidForGameplay(newCombination))
@ -536,6 +531,13 @@ namespace osu.Game.Overlays.Settings.Sections.Input
updateKeyCombinationText();
}
private void updateKeyCombinationText()
{
Scheduler.AddOnce(updateText);
void updateText() => Text.Text = keyCombinationProvider.GetReadableString(KeyBinding.KeyCombination);
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);