Add link handling to recent activities.

- Add a show user action to link handling
This commit is contained in:
naoey
2018-02-26 00:36:55 +05:30
parent 7e4bd36391
commit bb40919f9c
4 changed files with 64 additions and 17 deletions

View File

@ -23,14 +23,16 @@ namespace osu.Game.Graphics.Containers
public override bool HandleMouseInput => true;
private OsuGame game;
private UserProfileOverlay userProfile;
private Action showNotImplementedError;
[BackgroundDependencyLoader(true)]
private void load(OsuGame game, NotificationOverlay notifications)
private void load(OsuGame game, NotificationOverlay notifications, UserProfileOverlay userProfile)
{
// will be null in tests
this.game = game;
this.userProfile = userProfile;
showNotImplementedError = () => notifications?.Post(new SimpleNotification
{
@ -90,6 +92,9 @@ namespace osu.Game.Graphics.Containers
case LinkAction.External:
Process.Start(url);
break;
case LinkAction.OpenUserProfile:
userProfile?.ShowUser(Convert.ToInt64(linkArgument));
break;
default:
throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action.");
}