]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Localize rat king commands datasets (#35780)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Wed, 12 Mar 2025 05:49:32 +0000 (08:49 +0300)
committerGitHub <noreply@github.com>
Wed, 12 Mar 2025 05:49:32 +0000 (22:49 -0700)
Content.Server/RatKing/RatKingSystem.cs
Resources/Locale/en-US/datasets/rat_king_commands.ftl [new file with mode: 0644]
Resources/Prototypes/Datasets/rat_king_commands.yml

index 01c213d5403e377cc80bfac2b6878777011c035c..eb3bef6c0233a08a698c5f24daf407cae2ebb6fc 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Dataset;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Pointing;
+using Content.Shared.Random.Helpers;
 using Content.Shared.RatKing;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
@@ -120,10 +121,10 @@ namespace Content.Server.RatKing
             base.DoCommandCallout(uid, component);
 
             if (!component.OrderCallouts.TryGetValue(component.CurrentOrder, out var datasetId) ||
-                !PrototypeManager.TryIndex<DatasetPrototype>(datasetId, out var datasetPrototype))
+                !PrototypeManager.TryIndex<LocalizedDatasetPrototype>(datasetId, out var datasetPrototype))
                 return;
 
-            var msg = Random.Pick(datasetPrototype.Values);
+            var msg = Random.Pick(datasetPrototype);
             _chat.TrySendInGameICMessage(uid, msg, InGameICChatType.Speak, true);
         }
     }
diff --git a/Resources/Locale/en-US/datasets/rat_king_commands.ftl b/Resources/Locale/en-US/datasets/rat_king_commands.ftl
new file mode 100644 (file)
index 0000000..6e41275
--- /dev/null
@@ -0,0 +1,14 @@
+rat-king-command-stay-1 = Sit!
+rat-king-command-stay-2 = Stay!
+rat-king-command-stay-3 = Stop!
+
+rat-king-command-follow-1 = Heel!
+rat-king-command-follow-2 = Follow!
+
+rat-king-command-cheese-1 = Attack!
+rat-king-command-cheese-2 = Sic!
+rat-king-command-cheese-3 = Kill!
+rat-king-command-cheese-4 = Cheese 'Em!
+
+rat-king-command-loose-1 = Free!
+rat-king-command-loose-2 = Loose!
index c53d1e135b9cc75a34abf550caec402a4d981c86..6cfb2a6dba16390734ef606c3b46dfd102521c73 100644 (file)
@@ -1,26 +1,23 @@
-- type: dataset
+- type: localizedDataset
   id: RatKingCommandStay
   values:
-    - "Sit!"
-    - "Stay!"
-    - "Stop!"
+    prefix: rat-king-command-stay-
+    count: 3
 
-- type: dataset
+- type: localizedDataset
   id: RatKingCommandFollow
   values:
-    - "Heel!"
-    - "Follow!"
+    prefix: rat-king-command-follow-
+    count: 2
 
-- type: dataset
+- type: localizedDataset
   id: RatKingCommandCheeseEm
   values:
-    - "Attack!"
-    - "Sic!"
-    - "Kill!"
-    - "Cheese 'Em!"
+    prefix: rat-king-command-cheese-
+    count: 4
 
-- type: dataset
+- type: localizedDataset
   id: RatKingCommandLoose
   values:
-    - "Free!"
-    - "Loose!"
+    prefix: rat-king-command-loose-
+    count: 2