diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index d72bb195ab..3c2729c02d 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -130,6 +130,11 @@ Click to see what's new!", version); /// public static LocalisableString MultiplayerRoomEnded => new TranslatableString(getKey(@"multiplayer_room_ended"), @"This multiplayer room has ended. Click to display room results."); + /// + /// "Mentioned in {0}" + /// + public static LocalisableString MentionedInChannel(string channel) => new TranslatableString(getKey(@"mentioned_in_channel"), @"Mentioned in {0}", channel); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Online/Chat/MessageNotifier.cs b/osu.Game/Online/Chat/MessageNotifier.cs index a8d6746b10..afec4f1d51 100644 --- a/osu.Game/Online/Chat/MessageNotifier.cs +++ b/osu.Game/Online/Chat/MessageNotifier.cs @@ -10,7 +10,9 @@ using System.Linq; using System.Text.RegularExpressions; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; using osu.Framework.Platform; using osu.Game.Configuration; using osu.Game.Graphics; @@ -18,6 +20,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; using osu.Game.Overlays.Notifications; +using osu.Game.Resources.Localisation.Web; namespace osu.Game.Online.Chat { @@ -176,8 +179,12 @@ namespace osu.Game.Online.Chat TextFlow.Height = 45; TextFlow.ParagraphSpacing = 0.25f; - TextFlow.AddParagraph(message.Sender.Username, s => s.Font = s.Font.With(weight: FontWeight.SemiBold)); - TextFlow.AddParagraph(message.Content); + + TextFlow.AddParagraph(NotificationsStrings.ItemChannelChannelDefault.ToUpper(), s => s.Font = OsuFont.Style.Caption2.With(weight: FontWeight.Bold)); + TextFlow.AddParagraph(NotificationsStrings.ItemChannelChannelPmChannelMessage(message.Sender.Username, message.Content)); + + Avatar.Colour = OsuColour.Gray(0.4f); + Icon = FontAwesome.Solid.Comments; Activated = delegate { @@ -213,14 +220,9 @@ namespace osu.Game.Online.Chat TextFlow.Height = 45; TextFlow.ParagraphSpacing = 0.25f; - TextFlow.AddText(message.Sender.Username, s => s.Font = s.Font.With(weight: FontWeight.SemiBold)); - TextFlow.AddText($" in {channel.Name}", s => - { - s.Font = s.Font.With(weight: FontWeight.SemiBold); - s.Colour = colourProvider.Content2; - }); - TextFlow.NewParagraph(); + TextFlow.AddParagraph(Localisation.NotificationsStrings.MentionedInChannel(channel.Name).ToUpper(), s => s.Font = OsuFont.Style.Caption2.With(weight: FontWeight.Bold)); + TextFlow.AddParagraph($"{message.Sender.Username} says \""); int start = match.Index; int end = match.Index + match.Length; @@ -231,7 +233,10 @@ namespace osu.Game.Online.Chat s.Font = s.Font.With(weight: FontWeight.SemiBold); s.Colour = colourProvider.Colour0; }); - TextFlow.AddText(message.Content[end..]); + TextFlow.AddText(message.Content[end..] + "\""); + + Avatar.Colour = OsuColour.Gray(0.4f); + Icon = FontAwesome.Solid.At; Activated = delegate {