Modify admin chat (#13050)
* split admin chat into new channel * add ability to play audio when a chat message is received and add audio to admin chat * give client control of AdminChat sound and volume + suppress sound for senders
This commit is contained in:
@@ -60,14 +60,19 @@ namespace Content.Shared.Chat
|
||||
Dead = 1 << 9,
|
||||
|
||||
/// <summary>
|
||||
/// Admin chat
|
||||
/// Misc admin messages
|
||||
/// </summary>
|
||||
Admin = 1 << 10,
|
||||
|
||||
/// <summary>
|
||||
/// Admin chat
|
||||
/// </summary>
|
||||
AdminChat = 1 << 11,
|
||||
|
||||
/// <summary>
|
||||
/// Unspecified.
|
||||
/// </summary>
|
||||
Unspecified = 1 << 11,
|
||||
Unspecified = 1 << 12,
|
||||
|
||||
/// <summary>
|
||||
/// Channels considered to be IC.
|
||||
|
||||
@@ -12,6 +12,7 @@ public static class ChatChannelExtensions
|
||||
ChatChannel.OOC => Color.LightSkyBlue,
|
||||
ChatChannel.Dead => Color.MediumPurple,
|
||||
ChatChannel.Admin => Color.Red,
|
||||
ChatChannel.AdminChat => Color.HotPink,
|
||||
ChatChannel.Whisper => Color.DarkGray,
|
||||
_ => Color.LightGray
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
/// <summary>
|
||||
/// Admin chat
|
||||
/// </summary>
|
||||
Admin = ChatChannel.Admin,
|
||||
Admin = ChatChannel.AdminChat,
|
||||
|
||||
Console = ChatChannel.Unspecified
|
||||
}
|
||||
|
||||
@@ -16,11 +16,13 @@ namespace Content.Shared.Chat
|
||||
public EntityUid SenderEntity;
|
||||
public bool HideChat;
|
||||
public Color? MessageColorOverride;
|
||||
public string? AudioPath;
|
||||
public float AudioVolume;
|
||||
|
||||
[NonSerialized]
|
||||
public bool Read;
|
||||
|
||||
public ChatMessage(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat = false, Color? colorOverride = null)
|
||||
public ChatMessage(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat = false, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0)
|
||||
{
|
||||
Channel = channel;
|
||||
Message = message;
|
||||
@@ -28,6 +30,8 @@ namespace Content.Shared.Chat
|
||||
SenderEntity = source;
|
||||
HideChat = hideChat;
|
||||
MessageColorOverride = colorOverride;
|
||||
AudioPath = audioPath;
|
||||
AudioVolume = audioVolume;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user