mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Add proper toggling
This commit is contained in:
parent
7ed489b56d
commit
8c7ede6111
@ -1138,6 +1138,13 @@ namespace osu.Game
|
|||||||
mouseDisableButtons.Value = !mouseDisableButtons.Value;
|
mouseDisableButtons.Value = !mouseDisableButtons.Value;
|
||||||
return true;
|
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:
|
case GlobalAction.RandomSkin:
|
||||||
// Don't allow random skin selection while in the skin editor.
|
// 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.
|
// 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;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Users.Drawables;
|
using osu.Game.Users.Drawables;
|
||||||
using osu.Game.Input.Bindings;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -35,8 +34,6 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
public ToolbarUserButton()
|
public ToolbarUserButton()
|
||||||
{
|
{
|
||||||
Hotkey = GlobalAction.ToggleProfile;
|
|
||||||
|
|
||||||
AutoSizeAxes = Axes.X;
|
AutoSizeAxes = Axes.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ using osu.Game.Overlays.Profile.Sections;
|
|||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -41,6 +42,18 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override Color4 BackgroundColour => ColourProvider.Background6;
|
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)
|
public void ShowUser(IUser user)
|
||||||
{
|
{
|
||||||
if (user.OnlineID == APIUser.SYSTEM_USER_ID)
|
if (user.OnlineID == APIUser.SYSTEM_USER_ID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user