mirror of https://github.com/ppy/osu
General fix for ToolbarButton toggle repetition
This commit is contained in:
parent
0f94616890
commit
35629e9be8
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue