From 0f9461689085cb790de5a3850d051a344d3f0fc2 Mon Sep 17 00:00:00 2001 From: Ame Date: Sat, 2 Apr 2022 19:41:15 +0200 Subject: [PATCH] Make overlay shortcuts able to be toggled instead of repeatable --- osu.Game/OsuGame.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 73121f6e7d..3703318e81 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -95,6 +95,8 @@ namespace osu.Game private SkinEditorOverlay skinEditor; + private NowPlayingOverlay nowPlayingOverlay; + private Container overlayContent; private Container rightFloatingOverlayContent; @@ -818,7 +820,7 @@ namespace osu.Game Origin = Anchor.TopRight, }, rightFloatingOverlayContent.Add, true); - loadComponentSingleFile(new NowPlayingOverlay + loadComponentSingleFile(nowPlayingOverlay = new NowPlayingOverlay { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -1069,6 +1071,26 @@ namespace osu.Game SkinManager.SelectRandomSkin(); return true; + + case GlobalAction.ToggleChat: + chatOverlay.ToggleVisibility(); + return true; + + case GlobalAction.ToggleSocial: + dashboard.ToggleVisibility(); + return true; + + case GlobalAction.ToggleNowPlaying: + nowPlayingOverlay.ToggleVisibility(); + return true; + + case GlobalAction.ToggleBeatmapListing: + beatmapListing.ToggleVisibility(); + return true; + + case GlobalAction.ToggleSettings: + Settings.ToggleVisibility(); + return true; } return false;