mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Revert behavioural changes on options button
This commit is contained in:
parent
69d699a218
commit
fa6ccc854d
@ -188,9 +188,7 @@ namespace osu.Game.Screens.Select.FooterV2
|
||||
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
// intentionally scheduling to let the button have a chance whether the popover will hide from clicking the button or clicking outside
|
||||
// see the "hidingFromClick" field in FooterButtonOptionsV2.
|
||||
Schedule(() => footerButton.OverlayState.Value = state.NewValue);
|
||||
footerButton.OverlayState.Value = state.NewValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,9 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
@ -15,11 +13,6 @@ namespace osu.Game.Screens.Select.FooterV2
|
||||
{
|
||||
public partial class FooterButtonOptionsV2 : FooterButtonV2, IHasPopover
|
||||
{
|
||||
/// <summary>
|
||||
/// True if the next click is for hiding the popover.
|
||||
/// </summary>
|
||||
private bool hidingFromClick;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
@ -28,29 +21,7 @@ namespace osu.Game.Screens.Select.FooterV2
|
||||
AccentColour = colour.Purple1;
|
||||
Hotkey = GlobalAction.ToggleBeatmapOptions;
|
||||
|
||||
Action = () =>
|
||||
{
|
||||
if (OverlayState.Value == Visibility.Hidden && !hidingFromClick)
|
||||
this.ShowPopover();
|
||||
|
||||
hidingFromClick = false;
|
||||
};
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
if (OverlayState.Value == Visibility.Visible)
|
||||
hidingFromClick = true;
|
||||
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
protected override void Flash()
|
||||
{
|
||||
if (hidingFromClick)
|
||||
return;
|
||||
|
||||
base.Flash();
|
||||
Action = this.ShowPopover;
|
||||
}
|
||||
|
||||
public Popover GetPopover() => new BeatmapOptionsPopover(this);
|
||||
|
Loading…
Reference in New Issue
Block a user