Add reset button

Also fixes a regression causing multiple rows to be displayed for a single action
This commit is contained in:
Dean Herbert
2017-08-23 19:26:49 +09:00
parent e9dde822a1
commit c99ed6fd44
2 changed files with 45 additions and 4 deletions

View File

@ -109,6 +109,17 @@ namespace osu.Game.Overlays.KeyBinding
buttons.Add(new KeyButton(b));
}
public void RestoreDefaults()
{
int i = 0;
foreach (var d in Defaults)
{
var button = buttons[i++];
button.UpdateKeyCombination(d);
store.Update(button.KeyBinding);
}
}
protected override bool OnHover(InputState state)
{
this.FadeEdgeEffectTo<Container>(1, transition_time, Easing.OutQuint);
@ -129,6 +140,8 @@ namespace osu.Game.Overlays.KeyBinding
public bool AllowMainMouseButtons;
public IEnumerable<KeyCombination> Defaults;
private bool isModifier(Key k) => k < Key.F1;
protected override bool OnClick(InputState state) => true;