mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Merge pull request #2375 from aQaTL/mapping-del
Change mapping delete key to shift+delete to allow binding delete key
This commit is contained in:
commit
15d6c1f0e6
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Input;
|
using osu.Game.Input;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
@ -43,7 +44,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text;
|
||||||
private OsuSpriteText pressAKey;
|
private OsuTextFlowContainer pressAKey;
|
||||||
|
|
||||||
private FillFlowContainer<KeyButton> buttons;
|
private FillFlowContainer<KeyButton> buttons;
|
||||||
|
|
||||||
@ -95,10 +96,11 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight
|
Origin = Anchor.TopRight
|
||||||
},
|
},
|
||||||
pressAKey = new OsuSpriteText
|
pressAKey = new OsuTextFlowContainer
|
||||||
{
|
{
|
||||||
Text = "Press a key to change binding, DEL to delete, ESC to cancel.",
|
Text = "Press a key to change binding, Shift+Delete to delete, Escape to cancel.",
|
||||||
Y = height,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
Margin = new MarginPadding(padding),
|
Margin = new MarginPadding(padding),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Colour = colours.YellowDark
|
Colour = colours.YellowDark
|
||||||
@ -204,9 +206,16 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
finalise();
|
finalise();
|
||||||
return true;
|
return true;
|
||||||
case Key.Delete:
|
case Key.Delete:
|
||||||
bindTarget.UpdateKeyCombination(InputKey.None);
|
{
|
||||||
finalise();
|
if (state.Keyboard.ShiftPressed)
|
||||||
return true;
|
{
|
||||||
|
bindTarget.UpdateKeyCombination(InputKey.None);
|
||||||
|
finalise();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state));
|
bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state));
|
||||||
@ -261,7 +270,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
GetContainingInputManager().ChangeFocus(null);
|
GetContainingInputManager().ChangeFocus(null);
|
||||||
|
|
||||||
pressAKey.FadeOut(300, Easing.OutQuint);
|
pressAKey.FadeOut(300, Easing.OutQuint);
|
||||||
pressAKey.Padding = new MarginPadding { Bottom = -pressAKey.DrawHeight };
|
pressAKey.Padding = new MarginPadding { Top = height, Bottom = -pressAKey.DrawHeight };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnFocus(InputState state)
|
protected override void OnFocus(InputState state)
|
||||||
@ -270,7 +279,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
AutoSizeEasing = Easing.OutQuint;
|
AutoSizeEasing = Easing.OutQuint;
|
||||||
|
|
||||||
pressAKey.FadeIn(300, Easing.OutQuint);
|
pressAKey.FadeIn(300, Easing.OutQuint);
|
||||||
pressAKey.Padding = new MarginPadding();
|
pressAKey.Padding = new MarginPadding { Top = height };
|
||||||
|
|
||||||
updateBindTarget();
|
updateBindTarget();
|
||||||
base.OnFocus(state);
|
base.OnFocus(state);
|
||||||
|
Loading…
Reference in New Issue
Block a user