diff --git a/Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs b/Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs index 4135490416..ba7477530a 100644 --- a/Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs +++ b/Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Client.Chat.Managers; using Content.Client.Message; using Content.Shared.Chat; @@ -75,7 +76,7 @@ public LawDisplay(EntityUid uid, SiliconLaw law, HashSet? radioChannels) case SharedChatSystem.CommonChannel: _chatManager.SendMessage($"{SharedChatSystem.RadioCommonPrefix} {lawIdentifier}: {lawDescription}", ChatSelectChannel.Radio); break; default: - _chatManager.SendMessage($"{SharedChatSystem.RadioChannelPrefix}{radioChannelProto.KeyCode} {lawIdentifier}: {lawDescription}", ChatSelectChannel.Radio); break; + _chatManager.SendMessage($"{SharedChatSystem.RadioChannelPrefix}{radioChannelProto.KeyCodes.First()} {lawIdentifier}: {lawDescription}", ChatSelectChannel.Radio); break; } }; diff --git a/Content.Shared/Chat/SharedChatSystem.cs b/Content.Shared/Chat/SharedChatSystem.cs index c48d70405f..fe48200110 100644 --- a/Content.Shared/Chat/SharedChatSystem.cs +++ b/Content.Shared/Chat/SharedChatSystem.cs @@ -1,4 +1,4 @@ -using System.Collections.Frozen; +using System.Linq; using Content.Shared.Popups; using Content.Shared.Radio; using Content.Shared.Speech; @@ -39,7 +39,7 @@ public abstract class SharedChatSystem : EntitySystem /// /// Cache of the keycodes for faster lookup. /// - private FrozenDictionary _keyCodes = default!; + private readonly Dictionary _keyCodes = new(); // WD EDIT public override void Initialize() { @@ -57,8 +57,17 @@ protected virtual void OnPrototypeReload(PrototypesReloadedEventArgs obj) private void CacheRadios() { - _keyCodes = _prototypeManager.EnumeratePrototypes() - .ToFrozenDictionary(x => x.KeyCode); + // WD EDIT START + _keyCodes.Clear(); + + foreach (var proto in _prototypeManager.EnumeratePrototypes()) + { + foreach (var keycode in proto.KeyCodes.Where(keycode => !_keyCodes.ContainsKey(keycode))) + { + _keyCodes.Add(keycode, proto); + } + } + // WD EDIT END } /// diff --git a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs index 712debbafa..cb475a8300 100644 --- a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs +++ b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs @@ -224,7 +224,7 @@ public void AddChannelsExamine(HashSet channels, string? defaultChannel, var key = id == SharedChatSystem.CommonChannel ? SharedChatSystem.RadioCommonPrefix.ToString() - : $"{SharedChatSystem.RadioChannelPrefix}{proto.KeyCode}"; + : $":{string.Join(", :", proto.KeyCodes.ToArray())}"; // WD EDIT examineEvent.PushMarkup(Loc.GetString(channelFTLPattern, ("color", proto.Color), diff --git a/Content.Shared/Radio/RadioChannelPrototype.cs b/Content.Shared/Radio/RadioChannelPrototype.cs index cc65f88537..dc8c678b23 100644 --- a/Content.Shared/Radio/RadioChannelPrototype.cs +++ b/Content.Shared/Radio/RadioChannelPrototype.cs @@ -17,8 +17,8 @@ public sealed partial class RadioChannelPrototype : IPrototype /// /// Single-character prefix to determine what channel a message should be sent to. /// - [DataField("keycode")] - public char KeyCode { get; private set; } = '\0'; + [DataField("keycodes")] + public List KeyCodes { get; private set; } = new() {'\0'}; // WD EDIT [DataField("frequency")] public int Frequency { get; private set; } = 0; diff --git a/Resources/Prototypes/DeltaV/radio_channels.yml b/Resources/Prototypes/DeltaV/radio_channels.yml index 53490d90fa..1df8fd2fc1 100644 --- a/Resources/Prototypes/DeltaV/radio_channels.yml +++ b/Resources/Prototypes/DeltaV/radio_channels.yml @@ -1,14 +1,18 @@ - type: radioChannel id: Justice name: chat-radio-justice - keycode: "j" + keycodes: # WD EDIT + - 'j' + - 'ю' frequency: 1420 color: "#701442" - type: radioChannel id: Prison name: chat-radio-prison - keycode: 'p' + keycodes: # WD EDIT + - 'p' + - 'з' frequency: 1601 color: "#FFA500" diff --git a/Resources/Prototypes/radio_channels.yml b/Resources/Prototypes/radio_channels.yml index 48cc0872a1..6265c6fbfa 100644 --- a/Resources/Prototypes/radio_channels.yml +++ b/Resources/Prototypes/radio_channels.yml @@ -1,14 +1,17 @@ - type: radioChannel id: Common name: chat-radio-common - keycode: ";" + keycodes: # WD EDIT + - ";" frequency: 1459 color: "#32cd32" - type: radioChannel id: CentCom name: chat-radio-centcom - keycode: 'y' + keycodes: # WD EDIT + - 'y' + - 'ц' frequency: 1337 color: "#2681a5" longRange: true @@ -16,56 +19,72 @@ - type: radioChannel id: Command name: chat-radio-command - keycode: 'c' + keycodes: # WD EDIT + - 'c' + - 'к' frequency: 1353 color: "#fcdf03" - type: radioChannel id: Engineering name: chat-radio-engineering - keycode: 'e' + keycodes: # WD EDIT + - 'e' + - 'и' frequency: 1357 color: "#f37746" - type: radioChannel id: Medical name: chat-radio-medical - keycode: 'm' + keycodes: # WD EDIT + - 'm' + - 'м' frequency: 1355 color: "#57b8f0" - type: radioChannel id: Science name: chat-radio-science - keycode: 'n' + keycodes: # WD EDIT + - 'n' + - 'н' frequency: 1351 color: "#c68cfa" - type: radioChannel id: Security name: chat-radio-security - keycode: 's' + keycodes: # WD EDIT + - 's' + - 'о' frequency: 1359 color: "#dd3535" - type: radioChannel id: Service name: chat-radio-service - keycode: 'v' + keycodes: # WD EDIT + - 'v' + - 'в' frequency: 1349 color: "#6ca729" - type: radioChannel id: Supply name: chat-radio-supply - keycode: 'u' + keycodes: + - 'u' # WD EDIT + - 'с' frequency: 1347 color: "#b88646" - type: radioChannel id: Syndicate name: chat-radio-syndicate - keycode: 't' + keycodes: # WD EDIT + - 't' + - 'т' frequency: 1213 color: "#8f4a4b" longRange: true @@ -81,7 +100,9 @@ - type: radioChannel id: Binary name: chat-radio-binary - keycode: 'b' + keycodes: # WD EDIT + - 'b' + - 'б' frequency: 1001 color: "#2ed2fd" # long range since otherwise it'd defeat the point of a handheld radio independent of telecomms @@ -90,7 +111,9 @@ - type: radioChannel id: Freelance name: chat-radio-freelance - keycode: 'f' + keycodes: # WD EDIT + - 'f' + - 'ф' frequency: 1984 color: "#f6ce64" # long range since otherwise it'd defeat the point of a handheld radio independent of telecomms