mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Code tidy-ups
This commit is contained in:
parent
72eb082f91
commit
c221472d6e
@ -27,25 +27,21 @@ namespace osu.Game.Overlays.KeyConfiguration
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(KeyBindingStore store)
|
private void load(KeyBindingStore store)
|
||||||
{
|
{
|
||||||
var firstDefault = Defaults?.FirstOrDefault();
|
var enumType = Defaults?.FirstOrDefault()?.Action?.GetType();
|
||||||
|
|
||||||
if (firstDefault == null) return;
|
if (enumType == null) return;
|
||||||
|
|
||||||
var actionType = firstDefault.Action.GetType();
|
|
||||||
|
|
||||||
int? variant = null;
|
|
||||||
|
|
||||||
// for now let's just assume a variant of zero.
|
// for now let's just assume a variant of zero.
|
||||||
// this will need to be implemented in a better way in the future.
|
// this will need to be implemented in a better way in the future.
|
||||||
|
int? variant = null;
|
||||||
if (Ruleset != null)
|
if (Ruleset != null)
|
||||||
variant = 0;
|
variant = 0;
|
||||||
|
|
||||||
var bindings = store.Query(Ruleset?.ID, variant);
|
var bindings = store.Query(Ruleset?.ID, variant);
|
||||||
|
|
||||||
foreach (Enum v in Enum.GetValues(actionType))
|
foreach (Enum v in Enum.GetValues(enumType))
|
||||||
{
|
// one row per valid action.
|
||||||
Add(new KeyBindingRow(v, bindings.Where(b => b.Action.Equals((int)(object)v))));
|
Add(new KeyBindingRow(v, bindings.Where(b => b.Action.Equals((int)(object)v))));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user