]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Split ``ReplacementAccentPrototype`` and ``ReplacementAccentComponent`` in different...
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Wed, 12 Feb 2025 11:21:12 +0000 (14:21 +0300)
committerGitHub <noreply@github.com>
Wed, 12 Feb 2025 11:21:12 +0000 (12:21 +0100)
* Split ReplacementAccentPrototype  and ReplacementAccentComponent

* Fixes

* Fixes

* inheritdoc

Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Speech/Components/AddAccentClothingComponent.cs
Content.Server/Speech/Components/ReplacementAccentComponent.cs
Content.Server/Speech/EntitySystems/ReplacementAccentSystem.cs
Content.Server/Speech/Prototypes/ReplacementAccentPrototype.cs [new file with mode: 0644]

index d834d8304a8bfc141fd9fd48a88594d403e41adc..674a82053ada2c00eee0a358b98c4c8f4ff26e33 100644 (file)
@@ -6,7 +6,7 @@ using Content.Server.Administration.Managers;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
 using Content.Server.Players.RateLimiting;
-using Content.Server.Speech.Components;
+using Content.Server.Speech.Prototypes;
 using Content.Server.Speech.EntitySystems;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
index 9d93b55368cfbbecd40876bbe5583f44582c9539..335b436f7c330a9578d8d2177c1a2bb9f643239f 100644 (file)
@@ -1,4 +1,5 @@
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+using Content.Server.Speech.Prototypes;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 
 namespace Content.Server.Speech.Components;
 
index 037da720290e9598e03cac1d9d6a8ab731afdfcd..2a5a700a5e1b8fec551aa60737dd047d8bfbc074 100644 (file)
@@ -1,43 +1,15 @@
-using Robust.Shared.Prototypes;
+using Content.Server.Speech.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 
-namespace Content.Server.Speech.Components
-{
-    [Prototype("accent")]
-    public sealed partial class ReplacementAccentPrototype : IPrototype
-    {
-        [ViewVariables]
-        [IdDataField]
-        public string ID { get; private set; } = default!;
-
-        /// <summary>
-        ///     If this array is non-null, the full text of anything said will be randomly replaced with one of these words.
-        /// </summary>
-        [DataField("fullReplacements")]
-        public string[]? FullReplacements;
-
-        /// <summary>
-        ///     If this dictionary is non-null and <see cref="FullReplacements"/> is null, any keys surrounded by spaces
-        ///     (words) will be replaced by the value, attempting to intelligently keep capitalization.
-        /// </summary>
-        [DataField("wordReplacements")]
-        public Dictionary<string, string>? WordReplacements;
+namespace Content.Server.Speech.Components;
 
-        /// <summary>
-        /// Allows you to substitute words, not always, but with some chance
-        /// </summary>
-        [DataField]
-        public float ReplacementChance = 1f;
-    }
-
-    /// <summary>
-    /// Replaces full sentences or words within sentences with new strings.
-    /// </summary>
-    [RegisterComponent]
-    public sealed partial class ReplacementAccentComponent : Component
-    {
-        [DataField("accent", customTypeSerializer: typeof(PrototypeIdSerializer<ReplacementAccentPrototype>), required: true)]
-        public string Accent = default!;
+/// <summary>
+/// Replaces full sentences or words within sentences with new strings.
+/// </summary>
+[RegisterComponent]
+public sealed partial class ReplacementAccentComponent : Component
+{
+    [DataField(customTypeSerializer: typeof(PrototypeIdSerializer<ReplacementAccentPrototype>), required: true)]
+    public string Accent = default!;
 
-    }
 }
index d81d913a365c5aa8d5a85c0b71a50115d7747db1..656a72b3f97d1165980fd91c86cc46cbbf6b165b 100644 (file)
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Server.Speech.Prototypes;
 using JetBrains.Annotations;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
diff --git a/Content.Server/Speech/Prototypes/ReplacementAccentPrototype.cs b/Content.Server/Speech/Prototypes/ReplacementAccentPrototype.cs
new file mode 100644 (file)
index 0000000..cde4bae
--- /dev/null
@@ -0,0 +1,31 @@
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.Speech.Prototypes;
+
+[Prototype("accent")]
+public sealed partial class ReplacementAccentPrototype : IPrototype
+{
+    /// <inheritdoc/>
+    [ViewVariables]
+    [IdDataField]
+    public string ID { get; private set; } = default!;
+
+    /// <summary>
+    ///     If this array is non-null, the full text of anything said will be randomly replaced with one of these words.
+    /// </summary>
+    [DataField]
+    public string[]? FullReplacements;
+
+    /// <summary>
+    ///     If this dictionary is non-null and <see cref="FullReplacements"/> is null, any keys surrounded by spaces
+    ///     (words) will be replaced by the value, attempting to intelligently keep capitalization.
+    /// </summary>
+    [DataField]
+    public Dictionary<string, string>? WordReplacements;
+
+    /// <summary>
+    /// Allows you to substitute words, not always, but with some chance
+    /// </summary>
+    [DataField]
+    public float ReplacementChance = 1f;
+}