[feat] ru and eng keycodes

# Conflicts:
#	Content.Shared/Chat/SharedChatSystem.cs
This commit is contained in:
rhailrake
2023-04-25 21:16:29 +06:00
committed by Remuchi
parent 505caa556e
commit 95165aacae
4 changed files with 45 additions and 16 deletions

View File

@@ -55,8 +55,19 @@ public abstract class SharedChatSystem : EntitySystem
private void CacheRadios() private void CacheRadios()
{ {
_keyCodes = _prototypeManager.EnumeratePrototypes<RadioChannelPrototype>() _keyCodes.Clear();
.ToFrozenDictionary(x => x.KeyCode);
foreach (var proto in _prototypeManager.EnumeratePrototypes<RadioChannelPrototype>())
{
//WD-EDIT
foreach (var keycode in proto.KeyCodes)
{
if (_keyCodes.ContainsKey(keycode))
continue;
_keyCodes.Add(keycode, proto);
}
//WD-EDIT
}
} }
/// <summary> /// <summary>

View File

@@ -218,8 +218,7 @@ public sealed partial class EncryptionKeySystem : EntitySystem
var key = id == SharedChatSystem.CommonChannel var key = id == SharedChatSystem.CommonChannel
? SharedChatSystem.RadioCommonPrefix.ToString() ? SharedChatSystem.RadioCommonPrefix.ToString()
: $"{SharedChatSystem.RadioChannelPrefix}{proto.KeyCode}"; : $":{string.Join(", :", proto.KeyCodes.ToArray())}"; //WD-EDIT
examineEvent.PushMarkup(Loc.GetString(channelFTLPattern, examineEvent.PushMarkup(Loc.GetString(channelFTLPattern,
("color", proto.Color), ("color", proto.Color),
("key", key), ("key", key),

View File

@@ -17,8 +17,8 @@ public sealed partial class RadioChannelPrototype : IPrototype
/// <summary> /// <summary>
/// Single-character prefix to determine what channel a message should be sent to. /// Single-character prefix to determine what channel a message should be sent to.
/// </summary> /// </summary>
[DataField("keycode")] [DataField("keycodes")]
public char KeyCode { get; private set; } = '\0'; public List<char> KeyCodes { get; private set; } = new() {'\0'}; //WD-EDIT
[DataField("frequency")] [DataField("frequency")]
public int Frequency { get; private set; } = 0; public int Frequency { get; private set; } = 0;

View File

@@ -1,14 +1,17 @@
- type: radioChannel - type: radioChannel
id: Common id: Common
name: chat-radio-common name: chat-radio-common
keycode: ";" keycodes:
- ";"
frequency: 1459 frequency: 1459
color: "#32cd32" color: "#32cd32"
- type: radioChannel - type: radioChannel
id: CentCom id: CentCom
name: chat-radio-centcom name: chat-radio-centcom
keycode: 'y' keycodes:
- 'y'
- 'ц'
frequency: 1337 frequency: 1337
color: "#2681a5" color: "#2681a5"
longRange: true longRange: true
@@ -16,56 +19,72 @@
- type: radioChannel - type: radioChannel
id: Command id: Command
name: chat-radio-command name: chat-radio-command
keycode: 'c' keycodes:
- 'c'
- 'к'
frequency: 1353 frequency: 1353
color: "#fcdf03" color: "#fcdf03"
- type: radioChannel - type: radioChannel
id: Engineering id: Engineering
name: chat-radio-engineering name: chat-radio-engineering
keycode: 'e' keycodes:
- 'e'
- 'и'
frequency: 1357 frequency: 1357
color: "#f37746" color: "#f37746"
- type: radioChannel - type: radioChannel
id: Medical id: Medical
name: chat-radio-medical name: chat-radio-medical
keycode: 'm' keycodes:
- 'm'
- 'м'
frequency: 1355 frequency: 1355
color: "#57b8f0" color: "#57b8f0"
- type: radioChannel - type: radioChannel
id: Science id: Science
name: chat-radio-science name: chat-radio-science
keycode: 'n' keycodes:
- 'n'
- 'н'
frequency: 1351 frequency: 1351
color: "#c68cfa" color: "#c68cfa"
- type: radioChannel - type: radioChannel
id: Security id: Security
name: chat-radio-security name: chat-radio-security
keycode: 's' keycodes:
- 's'
- 'о'
frequency: 1359 frequency: 1359
color: "#dd3535" color: "#dd3535"
- type: radioChannel - type: radioChannel
id: Service id: Service
name: chat-radio-service name: chat-radio-service
keycode: 'v' keycodes:
- 'v'
- 'в'
frequency: 1349 frequency: 1349
color: "#6ca729" color: "#6ca729"
- type: radioChannel - type: radioChannel
id: Supply id: Supply
name: chat-radio-supply name: chat-radio-supply
keycode: 'u' keycodes:
- 'u'
- 'с'
frequency: 1347 frequency: 1347
color: "#b88646" color: "#b88646"
- type: radioChannel - type: radioChannel
id: Syndicate id: Syndicate
name: chat-radio-syndicate name: chat-radio-syndicate
keycode: 't' keycodes:
- 't'
- 'т'
frequency: 1213 frequency: 1213
color: "#8f4a4b" color: "#8f4a4b"
longRange: true longRange: true