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:
@@ -420,6 +420,7 @@ public sealed class ChatUIController : UIController
|
||||
if (_admin.HasFlag(AdminFlags.Admin))
|
||||
{
|
||||
FilterableChannels |= ChatChannel.Admin;
|
||||
FilterableChannels |= ChatChannel.AdminChat;
|
||||
CanSendChannels |= ChatSelectChannel.Admin;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ public sealed partial class ChannelFilterPopup : Popup
|
||||
ChatChannel.OOC,
|
||||
ChatChannel.Dead,
|
||||
ChatChannel.Admin,
|
||||
ChatChannel.AdminChat,
|
||||
ChatChannel.Server
|
||||
};
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public sealed class ChannelSelectorButton : Button
|
||||
ChatSelectChannel.LOOC => Color.MediumTurquoise,
|
||||
ChatSelectChannel.OOC => Color.LightSkyBlue,
|
||||
ChatSelectChannel.Dead => Color.MediumPurple,
|
||||
ChatSelectChannel.Admin => Color.Red,
|
||||
ChatSelectChannel.Admin => Color.HotPink,
|
||||
_ => Color.DarkGray
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
using static Robust.Client.UserInterface.Controls.LineEdit;
|
||||
|
||||
@@ -52,6 +54,9 @@ public partial class ChatBox : UIWidget
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg is { Read: false, AudioPath: { } })
|
||||
SoundSystem.Play(msg.AudioPath, Filter.Local(), new AudioParams().WithVolume(msg.AudioVolume));
|
||||
|
||||
msg.Read = true;
|
||||
|
||||
var color = msg.MessageColorOverride != null
|
||||
|
||||
Reference in New Issue
Block a user