mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Store KeyBinding action to its own field in realm
Also improve the Query method for action types by using generic field
This commit is contained in:
@ -93,8 +93,13 @@ namespace osu.Game.Input
|
||||
public List<KeyBinding> Query(int? rulesetId = null, int? variant = null)
|
||||
=> query(rulesetId, variant).Select(k => k.KeyBinding).ToList();
|
||||
|
||||
public List<KeyBinding> Query(GlobalAction action)
|
||||
=> query(null, null).Where(rkb => rkb.KeyBindingString.StartsWith($"{(int)action}:", StringComparison.Ordinal)).Select(k => k.KeyBinding).ToList();
|
||||
public List<KeyBinding> Query<T>(T action)
|
||||
where T : Enum
|
||||
{
|
||||
int lookup = (int)(object)action;
|
||||
|
||||
return query(null, null).Where(rkb => rkb.Action == lookup).Select(k => k.KeyBinding).ToList();
|
||||
}
|
||||
|
||||
public void Update(KeyBinding keyBinding)
|
||||
{
|
||||
|
Reference in New Issue
Block a user