Make overlay shortcuts able to be toggled instead of repeatable

This commit is contained in:
Ame 2022-04-02 19:41:15 +02:00
parent e2f1183e7d
commit 0f94616890
1 changed files with 23 additions and 1 deletions

View File

@ -95,6 +95,8 @@ public class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>, ILocalUser
private SkinEditorOverlay skinEditor;
private NowPlayingOverlay nowPlayingOverlay;
private Container overlayContent;
private Container rightFloatingOverlayContent;
@ -818,7 +820,7 @@ protected override void LoadComplete()
Origin = Anchor.TopRight,
}, rightFloatingOverlayContent.Add, true);
loadComponentSingleFile(new NowPlayingOverlay
loadComponentSingleFile(nowPlayingOverlay = new NowPlayingOverlay
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
@ -1069,6 +1071,26 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
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;