Remove redundant subsection title.

- Also handle opening UserProfile in LinkFlowContainer similar to how
beatmaps and channels are handled
This commit is contained in:
naoey 2018-02-28 15:19:27 +05:30
parent 62913163e0
commit 2e535afb84
No known key found for this signature in database
GPG Key ID: 2CCE71F6713C9069
3 changed files with 9 additions and 5 deletions

View File

@ -23,16 +23,14 @@ public LinkFlowContainer(Action<SpriteText> defaultCreationParameters = null)
public override bool HandleMouseInput => true;
private OsuGame game;
private UserProfileOverlay userProfile;
private Action showNotImplementedError;
[BackgroundDependencyLoader(true)]
private void load(OsuGame game, NotificationOverlay notifications, UserProfileOverlay userProfile)
private void load(OsuGame game, NotificationOverlay notifications)
{
// will be null in tests
this.game = game;
this.userProfile = userProfile;
showNotImplementedError = () => notifications?.Post(new SimpleNotification
{
@ -94,7 +92,7 @@ public void AddLink(string text, string url, LinkAction linkType = LinkAction.Ex
break;
case LinkAction.OpenUserProfile:
if (long.TryParse(linkArgument, out long userId))
userProfile?.ShowUser(userId);
game?.ShowUser(userId);
break;
default:
throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action.");

View File

@ -154,6 +154,12 @@ private void load(FrameworkConfigManager frameworkConfig)
/// <param name="setId">The set to display.</param>
public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId);
/// <summary>
/// Show a user's profile as an overlay.
/// </summary>
/// <param name="userId">The user to display.</param>
public void ShowUser(long userId) => userProfile.ShowUser(userId);
protected void LoadScore(Score s)
{
scoreLoad?.Cancel();

View File

@ -15,7 +15,7 @@ public RecentSection()
{
Children = new[]
{
new PaginatedRecentActivityContainer(User, @"Recent", @"This user hasn't done anything notable recently!"),
new PaginatedRecentActivityContainer(User, null, @"This user hasn't done anything notable recently!"),
};
}
}