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:
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Shared.Radio;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server.Radio.EntitySystems
|
||||
@@ -23,7 +24,7 @@ namespace Content.Server.Radio.EntitySystems
|
||||
args.PushMarkup(Loc.GetString("handheld-radio-component-on-examine",("frequency", component.BroadcastFrequency)));
|
||||
}
|
||||
|
||||
public void SpreadMessage(IRadio source, EntityUid speaker, string message, int channel)
|
||||
public void SpreadMessage(IRadio source, EntityUid speaker, string message, RadioChannelPrototype channel)
|
||||
{
|
||||
if (_messages.Contains(message)) return;
|
||||
|
||||
@@ -31,11 +32,8 @@ namespace Content.Server.Radio.EntitySystems
|
||||
|
||||
foreach (var radio in EntityManager.EntityQuery<IRadio>(true))
|
||||
{
|
||||
if (radio.Channels.Contains(channel))
|
||||
{
|
||||
//TODO: once voice identity gets added, pass into receiver via source.GetSpeakerVoice()
|
||||
radio.Receive(message, channel, speaker);
|
||||
}
|
||||
//TODO: once voice identity gets added, pass into receiver via source.GetSpeakerVoice()
|
||||
radio.Receive(message, channel, speaker);
|
||||
}
|
||||
|
||||
_messages.Remove(message);
|
||||
|
||||
Reference in New Issue
Block a user