mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:47:52 +08:00
Prevent updating bind target when hovering cancel and clear buttons instead
This commit is contained in:
parent
d49e54deb6
commit
7aafc018ad
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
public bool FilteringActive { get; set; }
|
public bool FilteringActive { get; set; }
|
||||||
|
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text;
|
||||||
private Drawable pressAKey;
|
private FillFlowContainer cancelAndClearButtons;
|
||||||
|
|
||||||
public FillFlowContainer<KeyButton> Buttons;
|
public FillFlowContainer<KeyButton> Buttons;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
Hollow = true,
|
Hollow = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
Children = new[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight
|
Origin = Anchor.TopRight
|
||||||
},
|
},
|
||||||
pressAKey = new FillFlowContainer
|
cancelAndClearButtons = new FillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding(padding) { Top = height + padding * 2 },
|
Padding = new MarginPadding(padding) { Top = height + padding * 2 },
|
||||||
@ -187,7 +187,8 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
|
|
||||||
if (bindTarget.IsHovered)
|
if (bindTarget.IsHovered)
|
||||||
finalise();
|
finalise();
|
||||||
else if (Buttons.Any(b => b.IsHovered))
|
// prevent updating bind target before clear button's action
|
||||||
|
else if (!cancelAndClearButtons.Any(b => b.IsHovered))
|
||||||
updateBindTarget();
|
updateBindTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +299,8 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
if (HasFocus)
|
if (HasFocus)
|
||||||
GetContainingInputManager().ChangeFocus(null);
|
GetContainingInputManager().ChangeFocus(null);
|
||||||
|
|
||||||
pressAKey.FadeOut(300, Easing.OutQuint);
|
cancelAndClearButtons.FadeOut(300, Easing.OutQuint);
|
||||||
pressAKey.BypassAutoSizeAxes |= Axes.Y;
|
cancelAndClearButtons.BypassAutoSizeAxes |= Axes.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnFocus(FocusEvent e)
|
protected override void OnFocus(FocusEvent e)
|
||||||
@ -307,8 +308,8 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
AutoSizeDuration = 500;
|
AutoSizeDuration = 500;
|
||||||
AutoSizeEasing = Easing.OutQuint;
|
AutoSizeEasing = Easing.OutQuint;
|
||||||
|
|
||||||
pressAKey.FadeIn(300, Easing.OutQuint);
|
cancelAndClearButtons.FadeIn(300, Easing.OutQuint);
|
||||||
pressAKey.BypassAutoSizeAxes &= ~Axes.Y;
|
cancelAndClearButtons.BypassAutoSizeAxes &= ~Axes.Y;
|
||||||
|
|
||||||
updateBindTarget();
|
updateBindTarget();
|
||||||
base.OnFocus(e);
|
base.OnFocus(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user