colorfull chat system

# Conflicts:
#	Content.Server/Chat/Systems/ChatSystem.cs
This commit is contained in:
rhailrake
2023-04-26 01:21:26 +06:00
committed by Remuchi
parent 95165aacae
commit 20c1628913
2 changed files with 74 additions and 7 deletions

View File

@@ -401,13 +401,15 @@ public sealed partial class ChatSystem : SharedChatSystem
}
name = FormattedMessage.EscapeText(name);
var speech = GetSpeechVerb(source, message);
var wrappedMessage = Loc.GetString(speech.Bold ? "chat-manager-entity-say-bold-wrap-message" : "chat-manager-entity-say-wrap-message",
("entityName", name),
("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))),
("fontType", speech.FontId),
("fontSize", speech.FontSize),
("message", FormattedMessage.EscapeText(message)));
//WD-EDIT
var colorEv = new SetSpeakerColorEvent(source, name);
RaiseLocalEvent(source, colorEv);
name = colorEv.Name;
//WD-EDIT
var wrappedMessage = Loc.GetString("chat-manager-entity-say-wrap-message",
("entityName", name), ("message", FormattedMessage.EscapeText(message)));
SendInVoiceRange(ChatChannel.Local, message, wrappedMessage, source, range);
@@ -928,6 +930,20 @@ public sealed class EntitySpokeEvent : EntityEventArgs
}
}
//WD-EDIT
public class SetSpeakerColorEvent
{
public EntityUid Sender { get; set; }
public string Name { get; set; }
public SetSpeakerColorEvent(EntityUid sender, string name)
{
Sender = sender;
Name = name;
}
}
//WD-EDIT
/// <summary>
/// InGame IC chat is for chat that is specifically ingame (not lobby) but is also in character, i.e. speaking.
/// </summary>