Fix DatabasedKeyBindingContainer not using defaults for non-databased ruleset

This commit is contained in:
Dean Herbert
2020-04-20 09:35:00 +09:00
parent 6f0b921535
commit f3fee73441
2 changed files with 108 additions and 1 deletions

View File

@ -62,6 +62,14 @@ namespace osu.Game.Input.Bindings
store.KeyBindingChanged -= ReloadMappings;
}
protected override void ReloadMappings() => KeyBindings = store.Query(ruleset?.ID, variant).ToList();
protected override void ReloadMappings()
{
if (ruleset != null && !ruleset.ID.HasValue)
// if the provided ruleset is not stored to the database, we have no way to retrieve custom bindings.
// fallback to defaults instead.
KeyBindings = DefaultKeyBindings;
else
KeyBindings = store.Query(ruleset?.ID, variant).ToList();
}
}
}