Re-fix clicking inside display also dismissing

This commit is contained in:
Dean Herbert
2022-04-18 19:06:13 +09:00
parent 11395c40b7
commit 6716621444

View File

@ -18,7 +18,6 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using osu.Game.Overlays.Dialog; using osu.Game.Overlays.Dialog;
using osu.Game.Overlays.FirstRunSetup; using osu.Game.Overlays.FirstRunSetup;
using osu.Game.Screens; using osu.Game.Screens;
@ -68,11 +67,11 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IAPIProvider api, OsuColour colours) private void load()
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
mainContent = new Container mainContent = new BlockingContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -210,6 +209,11 @@ namespace osu.Game.Overlays
}; };
} }
private class BlockingContainer : Container
{
protected override bool OnMouseDown(MouseDownEvent e) => true;
}
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
@ -219,11 +223,8 @@ namespace osu.Game.Overlays
} }
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{
if (!mainContent.IsHovered && dialogOverlay.CurrentDialog == null)
{ {
dialogOverlay.Push(new ConfirmDialog("Are you sure you want to exit the setup process?", Hide, () => { })); dialogOverlay.Push(new ConfirmDialog("Are you sure you want to exit the setup process?", Hide, () => { }));
}
return base.OnClick(e); return base.OnClick(e);
} }