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