From 2e535afb845bb1b6719d6df5611a771879c0d7de Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 28 Feb 2018 15:19:27 +0530 Subject: [PATCH] Remove redundant subsection title. - Also handle opening UserProfile in LinkFlowContainer similar to how beatmaps and channels are handled --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 6 ++---- osu.Game/OsuGame.cs | 6 ++++++ osu.Game/Overlays/Profile/Sections/RecentSection.cs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index c16ccbce86..1d231ada23 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -23,16 +23,14 @@ 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, 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 @@ namespace osu.Game.Graphics.Containers 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."); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 95eb88c5c8..cff7007fd5 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -154,6 +154,12 @@ namespace osu.Game /// The set to display. public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); + /// + /// Show a user's profile as an overlay. + /// + /// The user to display. + public void ShowUser(long userId) => userProfile.ShowUser(userId); + protected void LoadScore(Score s) { scoreLoad?.Cancel(); diff --git a/osu.Game/Overlays/Profile/Sections/RecentSection.cs b/osu.Game/Overlays/Profile/Sections/RecentSection.cs index db97dca440..84a941aa1a 100644 --- a/osu.Game/Overlays/Profile/Sections/RecentSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RecentSection.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Profile.Sections { 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!"), }; } }