public bool OnPressed(GlobalAction action) { switch (action) { case GlobalAction.ToggleOptions: if (SettingsOverlay.IsShown) { SettingsOverlay.Hide(); } else { SettingsOverlay.Show(); } break; case GlobalAction.ExitOverlay: if (SettingsOverlay.IsShown) { SettingsOverlay.Hide(); } break; default: throw new ArgumentOutOfRangeException(nameof(action), action, null); } return(true); }
protected override bool OnClick(ClickEvent e) { if (SettingsOverlay.IsShown && !SettingsOverlay.IsHovered) { SettingsOverlay.Hide(); } return(base.OnClick(e)); }