mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Add proper toggling
This commit is contained in:
parent
7ed489b56d
commit
8c7ede6111
@ -1138,6 +1138,13 @@ namespace osu.Game
|
||||
mouseDisableButtons.Value = !mouseDisableButtons.Value;
|
||||
return true;
|
||||
|
||||
case GlobalAction.ToggleProfile:
|
||||
if (userProfile.State.Value == Visibility.Visible)
|
||||
return false;
|
||||
|
||||
ShowUser(new APIUser { Id = API.LocalUser.Value.Id });
|
||||
return true;
|
||||
|
||||
case GlobalAction.RandomSkin:
|
||||
// Don't allow random skin selection while in the skin editor.
|
||||
// This is mainly to stop many "osu! default (modified)" skins being created via the SkinManager.EnsureMutableSkin() path.
|
||||
|
@ -15,7 +15,6 @@ using osu.Game.Localisation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -35,8 +34,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public ToolbarUserButton()
|
||||
{
|
||||
Hotkey = GlobalAction.ToggleProfile;
|
||||
|
||||
AutoSizeAxes = Axes.X;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ using osu.Game.Overlays.Profile.Sections;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@ -41,6 +42,18 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override Color4 BackgroundColour => ColourProvider.Background6;
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
switch (e.Action)
|
||||
{
|
||||
case GlobalAction.ToggleProfile:
|
||||
Hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnPressed(e);
|
||||
}
|
||||
|
||||
public void ShowUser(IUser user)
|
||||
{
|
||||
if (user.OnlineID == APIUser.SYSTEM_USER_ID)
|
||||
|
Loading…
Reference in New Issue
Block a user