1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 20:33:35 +08:00

Merge pull request #32585 from frenzibyte/teams-external-page

Open teams page externally when clicking team flags
This commit is contained in:
Dan Balasescu
2025-03-26 14:12:02 +09:00
committed by GitHub
Unverified
@@ -8,8 +8,10 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Users.Drawables namespace osu.Game.Users.Drawables
@@ -64,6 +66,12 @@ namespace osu.Game.Users.Drawables
public LocalisableString TooltipText { get; } public LocalisableString TooltipText { get; }
[Resolved]
private OsuGame? game { get; set; }
[Resolved]
private IAPIProvider api { get; set; } = null!;
public TeamFlag(APITeam team) public TeamFlag(APITeam team)
{ {
this.team = 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;
}
} }
} }
} }