mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Reorder defaults to give non-global areas priority for global actions
This commit is contained in:
parent
afc745f999
commit
08858e6426
@ -64,12 +64,20 @@ namespace osu.Game.Input.Bindings
|
||||
|
||||
protected override void ReloadMappings()
|
||||
{
|
||||
var defaults = DefaultKeyBindings.ToList();
|
||||
|
||||
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;
|
||||
KeyBindings = defaults;
|
||||
else
|
||||
KeyBindings = store.Query(ruleset?.ID, variant).ToList();
|
||||
{
|
||||
KeyBindings = store.Query(ruleset?.ID, variant)
|
||||
// this ordering is important to ensure that we read entries from the database in the order
|
||||
// enforced by DefaultKeyBindings. allow for song select to handle actions that may otherwise
|
||||
// have been eaten by the music controller due to query order.
|
||||
.OrderBy(b => defaults.FindIndex(d => (int)d.Action == b.IntAction)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,10 +28,10 @@ namespace osu.Game.Input.Bindings
|
||||
}
|
||||
|
||||
public override IEnumerable<IKeyBinding> DefaultKeyBindings => GlobalKeyBindings
|
||||
.Concat(EditorKeyBindings)
|
||||
.Concat(InGameKeyBindings)
|
||||
.Concat(AudioControlKeyBindings)
|
||||
.Concat(SongSelectKeyBindings)
|
||||
.Concat(EditorKeyBindings);
|
||||
.Concat(AudioControlKeyBindings);
|
||||
|
||||
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user