General fix for ToolbarButton toggle repetition

This commit is contained in:
Ame 2022-04-02 20:45:00 +02:00
parent 0f94616890
commit 35629e9be8
2 changed files with 2 additions and 24 deletions

View File

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

View File

@ -190,7 +190,7 @@ protected override void OnHoverLost(HoverLostEvent e)
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
if (e.Action == Hotkey)
if (!e.Repeat && e.Action == Hotkey)
{
TriggerClick();
return true;