Move click action out of user panel

This commit is contained in:
Dean Herbert
2020-11-02 21:09:47 +09:00
parent ed30756c19
commit c1d9a0c92c
3 changed files with 52 additions and 16 deletions

View File

@ -20,10 +20,12 @@ namespace osu.Game.Users
{
public readonly User User;
/// <summary>
/// Perform an action in addition to showing the user's profile.
/// This should be used to perform auxiliary tasks and not as a primary action for clicking a user panel (to maintain a consistent UX).
/// </summary>
public new Action Action;
public bool ShowProfileOnClick = true;
protected Action ViewProfile { get; private set; }
protected Drawable Background { get; private set; }
@ -70,8 +72,7 @@ namespace osu.Game.Users
base.Action = ViewProfile = () =>
{
Action?.Invoke();
if (ShowProfileOnClick)
profileOverlay?.ShowUser(User);
profileOverlay?.ShowUser(User);
};
}