Speech bubbles!
This commit is contained in:
@@ -288,7 +288,7 @@ namespace Content.Client.Chat
|
||||
WriteChatMessage(storedMessage);
|
||||
|
||||
// Local messages that have an entity attached get a speech bubble.
|
||||
if (msg.Channel == ChatChannel.Local && msg.SenderEntity != default)
|
||||
if ((msg.Channel == ChatChannel.Local || msg.Channel == ChatChannel.Dead) && msg.SenderEntity != default)
|
||||
{
|
||||
AddSpeechBubble(msg);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,14 @@ using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Content.Server.Observer;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.Chat;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Content.Server.Chat
|
||||
{
|
||||
@@ -105,6 +107,7 @@ namespace Content.Server.Chat
|
||||
msg.Channel = ChatChannel.Dead;
|
||||
msg.Message = message;
|
||||
msg.MessageWrap = $"{_localizationManager.GetString("DEAD")}: {player.AttachedEntity.Name}: {{0}}";
|
||||
msg.SenderEntity = player.AttachedEntityUid.GetValueOrDefault();
|
||||
_netManager.ServerSendToMany(msg, clients.ToList());
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Shared.Chat
|
||||
|
||||
/// <summary>
|
||||
/// The sending entity.
|
||||
/// Only applies to <see cref="ChatChannel.Local"/> and <see cref="ChatChannel.Emotes"/>.
|
||||
/// Only applies to <see cref="ChatChannel.Local"/>, <see cref="ChatChannel.Dead"/> and <see cref="ChatChannel.Emotes"/>.
|
||||
/// </summary>
|
||||
public EntityUid SenderEntity { get; set; }
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace Content.Shared.Chat
|
||||
switch (Channel)
|
||||
{
|
||||
case ChatChannel.Local:
|
||||
case ChatChannel.Dead:
|
||||
case ChatChannel.Emotes:
|
||||
SenderEntity = buffer.ReadEntityUid();
|
||||
break;
|
||||
@@ -63,6 +64,7 @@ namespace Content.Shared.Chat
|
||||
switch (Channel)
|
||||
{
|
||||
case ChatChannel.Local:
|
||||
case ChatChannel.Dead:
|
||||
case ChatChannel.Emotes:
|
||||
buffer.Write(SenderEntity);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user