mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 09:42:57 +08:00
Use existing localisation for "view profile"
This commit is contained in:
parent
d674856e29
commit
40dbf098d2
@ -15,6 +15,7 @@ using osu.Framework.Localisation;
|
|||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Online;
|
using osu.Game.Online;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
@ -74,7 +75,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void AddUserLink(IUser user, Action<SpriteText> creationParameters = null)
|
public void AddUserLink(IUser user, Action<SpriteText> creationParameters = null)
|
||||||
=> createLink(CreateChunkFor(user.Username, true, CreateSpriteText, creationParameters), new LinkDetails(LinkAction.OpenUserProfile, user), "view profile");
|
=> createLink(CreateChunkFor(user.Username, true, CreateSpriteText, creationParameters), new LinkDetails(LinkAction.OpenUserProfile, user), ContextMenuStrings.ViewProfile);
|
||||||
|
|
||||||
private void createLink(ITextPart textPart, LinkDetails link, LocalisableString tooltipText, Action action = null)
|
private void createLink(ITextPart textPart, LinkDetails link, LocalisableString tooltipText, Action action = null)
|
||||||
{
|
{
|
||||||
|
@ -6,14 +6,13 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
public partial class ClickableAvatar : OsuClickableContainer
|
public partial class ClickableAvatar : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private const string default_tooltip_text = "view profile";
|
|
||||||
|
|
||||||
public override LocalisableString TooltipText
|
public override LocalisableString TooltipText
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -21,7 +20,7 @@ namespace osu.Game.Users.Drawables
|
|||||||
if (!Enabled.Value)
|
if (!Enabled.Value)
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
return ShowUsernameTooltip ? (user?.Username ?? string.Empty) : default_tooltip_text;
|
return ShowUsernameTooltip ? (user?.Username ?? string.Empty) : ContextMenuStrings.ViewProfile;
|
||||||
}
|
}
|
||||||
set => throw new NotSupportedException();
|
set => throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user