1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 02:49:53 +08:00

Update message notification design to match web

This commit is contained in:
Salman Alshamrani
2025-07-08 15:51:07 +03:00
committed by Dean Herbert
Unverified
parent 2a7ec60cc8
commit fa7ecc0d28
2 changed files with 20 additions and 10 deletions
@@ -130,6 +130,11 @@ Click to see what's new!", version);
/// </summary>
public static LocalisableString MultiplayerRoomEnded => new TranslatableString(getKey(@"multiplayer_room_ended"), @"This multiplayer room has ended. Click to display room results.");
/// <summary>
/// "Mentioned in {0}"
/// </summary>
public static LocalisableString MentionedInChannel(string channel) => new TranslatableString(getKey(@"mentioned_in_channel"), @"Mentioned in {0}", channel);
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
+15 -10
View File
@@ -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
{