mirror of
https://github.com/osukey/osukey.git
synced 2025-07-07 19:29:55 +09:00
Add global action for toggling now playing overlay
This commit is contained in:
@ -24,6 +24,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
||||||
{
|
{
|
||||||
|
new KeyBinding(InputKey.F6, GlobalAction.ToggleNowPlaying),
|
||||||
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
||||||
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
||||||
new KeyBinding(InputKey.F10, GlobalAction.ToggleGameplayMouseButtons),
|
new KeyBinding(InputKey.F10, GlobalAction.ToggleGameplayMouseButtons),
|
||||||
@ -137,5 +138,8 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[Description("Play / pause")]
|
[Description("Play / pause")]
|
||||||
MusicPlay,
|
MusicPlay,
|
||||||
|
|
||||||
|
[Description("Toggle now playing overlay")]
|
||||||
|
ToggleNowPlaying,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ namespace osu.Game
|
|||||||
|
|
||||||
private NotificationOverlay notifications;
|
private NotificationOverlay notifications;
|
||||||
|
|
||||||
|
private NowPlayingOverlay nowPlaying;
|
||||||
|
|
||||||
private DirectOverlay direct;
|
private DirectOverlay direct;
|
||||||
|
|
||||||
private SocialOverlay social;
|
private SocialOverlay social;
|
||||||
@ -624,7 +626,7 @@ namespace osu.Game
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
}, rightFloatingOverlayContent.Add, true);
|
}, rightFloatingOverlayContent.Add, true);
|
||||||
|
|
||||||
loadComponentSingleFile(new NowPlayingOverlay
|
loadComponentSingleFile(nowPlaying = new NowPlayingOverlay
|
||||||
{
|
{
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
GetToolbarHeight = () => ToolbarOffset,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -822,6 +824,10 @@ namespace osu.Game
|
|||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
case GlobalAction.ToggleNowPlaying:
|
||||||
|
nowPlaying.ToggleVisibility();
|
||||||
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ToggleChat:
|
case GlobalAction.ToggleChat:
|
||||||
chatOverlay.ToggleVisibility();
|
chatOverlay.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user