Add department-specific radio channels (#9061)

* Add department-specific radio channels

This commit adds working department-specific radio channels, while
minimizing damage to the current codebase. It is expected that a future
refactor will clean this up a bit.

ChatSystem now has a RadioPrefix() method that recognizes
department-specific channels (e.g. ":e" and ":m") in addition to the
global channel (";"). It strips the prefix from the message and assigns
messages an integer representing the destination channel, if any.

IListen and IRadio now accept optional 'channel' arguments with this
channel in mind.

The ugly is that the integer channel number is hard-coded and also shows
up in chat.

Comms are not modeled at this time. You cannot break comms (yet).

All headsets have channels soldered into them. You cannot change
encryption keys to hop on new channels. Steal a headset instead.

* Remove debugging print

* Convert to prototypes

* Use prototype names in headset prototype

* Adjust list style

* Document prototype fields

* cringe

* some cleanup

* colours

* Remove alphas at least

* cc

Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
metalgearsloth
2022-06-23 20:11:03 +10:00
committed by GitHub
parent de760942e7
commit 3da454140d
41 changed files with 397 additions and 105 deletions

View File

@@ -0,0 +1,26 @@
using Robust.Shared.Prototypes;
namespace Content.Shared.Radio
{
[Prototype("radioChannel")]
public sealed class RadioChannelPrototype : IPrototype
{
/// <summary>
/// Human-readable name for the channel.
/// </summary>
[ViewVariables] [DataField("name")] public string Name { get; private set; } = string.Empty;
/// <summary>
/// Single-character prefix to determine what channel a message should be sent to.
/// </summary>
[ViewVariables] [DataField("keycode")] public char KeyCode { get; private set; } = '\0';
[ViewVariables] [DataField("frequency")] public int Frequency { get; private set; } = 0;
[ViewVariables] [DataField("color")] public Color Color { get; private set; } = Color.Lime;
[ViewVariables]
[IdDataFieldAttribute]
public string ID { get; } = default!;
}
}