From 95165aacaecbdbd7f567f81bbf982bc416a91b7b Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:16:29 +0600 Subject: [PATCH] [feat] ru and eng keycodes # Conflicts: # Content.Shared/Chat/SharedChatSystem.cs --- Content.Shared/Chat/SharedChatSystem.cs | 15 ++++++- .../EntitySystems/EncryptionKeySystem.cs | 3 +- Content.Shared/Radio/RadioChannelPrototype.cs | 4 +- Resources/Prototypes/radio_channels.yml | 39 ++++++++++++++----- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/Content.Shared/Chat/SharedChatSystem.cs b/Content.Shared/Chat/SharedChatSystem.cs index 69918f8098..763db1bb50 100644 --- a/Content.Shared/Chat/SharedChatSystem.cs +++ b/Content.Shared/Chat/SharedChatSystem.cs @@ -55,8 +55,19 @@ public abstract class SharedChatSystem : EntitySystem private void CacheRadios() { - _keyCodes = _prototypeManager.EnumeratePrototypes() - .ToFrozenDictionary(x => x.KeyCode); + _keyCodes.Clear(); + + foreach (var proto in _prototypeManager.EnumeratePrototypes()) + { + //WD-EDIT + foreach (var keycode in proto.KeyCodes) + { + if (_keyCodes.ContainsKey(keycode)) + continue; + _keyCodes.Add(keycode, proto); + } + //WD-EDIT + } } /// diff --git a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs index 746147eb5b..06c23c9004 100644 --- a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs +++ b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs @@ -218,8 +218,7 @@ public sealed partial class EncryptionKeySystem : EntitySystem 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), ("key", key), diff --git a/Content.Shared/Radio/RadioChannelPrototype.cs b/Content.Shared/Radio/RadioChannelPrototype.cs index cc65f88537..f8c27536c6 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/radio_channels.yml b/Resources/Prototypes/radio_channels.yml index 48cc0872a1..2ba56afe97 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: + - ";" frequency: 1459 color: "#32cd32" - type: radioChannel id: CentCom name: chat-radio-centcom - keycode: 'y' + keycodes: + - 'y' + - 'ц' frequency: 1337 color: "#2681a5" longRange: true @@ -16,56 +19,72 @@ - type: radioChannel id: Command name: chat-radio-command - keycode: 'c' + keycodes: + - 'c' + - 'к' frequency: 1353 color: "#fcdf03" - type: radioChannel id: Engineering name: chat-radio-engineering - keycode: 'e' + keycodes: + - 'e' + - 'и' frequency: 1357 color: "#f37746" - type: radioChannel id: Medical name: chat-radio-medical - keycode: 'm' + keycodes: + - 'm' + - 'м' frequency: 1355 color: "#57b8f0" - type: radioChannel id: Science name: chat-radio-science - keycode: 'n' + keycodes: + - 'n' + - 'н' frequency: 1351 color: "#c68cfa" - type: radioChannel id: Security name: chat-radio-security - keycode: 's' + keycodes: + - 's' + - 'о' frequency: 1359 color: "#dd3535" - type: radioChannel id: Service name: chat-radio-service - keycode: 'v' + keycodes: + - 'v' + - 'в' frequency: 1349 color: "#6ca729" - type: radioChannel id: Supply name: chat-radio-supply - keycode: 'u' + keycodes: + - 'u' + - 'с' frequency: 1347 color: "#b88646" - type: radioChannel id: Syndicate name: chat-radio-syndicate - keycode: 't' + keycodes: + - 't' + - 'т' frequency: 1213 color: "#8f4a4b" longRange: true