From 28f3d9cec9c37dd01f7dd929013e186320bb6b97 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Tue, 25 Mar 2025 21:47:22 -0400 Subject: [PATCH] Open teams page externally when clicking team flags --- osu.Game/Users/Drawables/UpdateableTeamFlag.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/osu.Game/Users/Drawables/UpdateableTeamFlag.cs b/osu.Game/Users/Drawables/UpdateableTeamFlag.cs index 2fcec66aa7..517eb589b9 100644 --- a/osu.Game/Users/Drawables/UpdateableTeamFlag.cs +++ b/osu.Game/Users/Drawables/UpdateableTeamFlag.cs @@ -8,8 +8,10 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Framework.Input.Events; using osu.Framework.Localisation; using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Users.Drawables @@ -64,6 +66,12 @@ namespace osu.Game.Users.Drawables public LocalisableString TooltipText { get; } + [Resolved] + private OsuGame? game { get; set; } + + [Resolved] + private IAPIProvider api { get; set; } = null!; + public TeamFlag(APITeam team) { this.team = team; @@ -91,6 +99,12 @@ namespace osu.Game.Users.Drawables } }; } + + protected override bool OnClick(ClickEvent e) + { + game?.OpenUrlExternally($"{api.Endpoints.WebsiteUrl}/teams/{team.Id}"); + return true; + } } } }