1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 19:54:15 +08:00

Open teams page externally when clicking team flags

This commit is contained in:
Salman Alshamrani
2025-03-25 21:47:22 -04:00
Unverified
parent 7de67434a0
commit 28f3d9cec9
@@ -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;
}
}
}
}