]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362)
authorBrandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
Sun, 11 Aug 2024 09:46:57 +0000 (09:46 +0000)
committerGitHub <noreply@github.com>
Sun, 11 Aug 2024 09:46:57 +0000 (19:46 +1000)
* I should be studying for school but that is sofucking boring, I will pass my class no matter, however getting an A might be a challenge. My gpa is important but is the tourture for 1 point of GPA worth it? The american government says yes but they are responsible for the majority of all genocides that have ever been conducted since the dawn of man

* ugh

* ugh

21 files changed:
Content.Server/Administration/Commands/BanPanelCommand.cs
Content.Server/Administration/Commands/ControlMob.cs
Content.Server/Administration/Commands/DSay.cs
Content.Server/Administration/Commands/FaxUiCommand.cs
Content.Server/Administration/Commands/FollowCommand.cs
Content.Server/Administration/Commands/OpenAdminLogsCommand.cs
Content.Server/Administration/Commands/OpenAdminNotesCommand.cs
Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs
Content.Server/Administration/Commands/SetAdminOOC.cs
Content.Server/Chat/Commands/LOOCCommand.cs
Content.Server/Chat/Commands/SayCommand.cs
Content.Server/Chat/Commands/SuicideCommand.cs
Content.Server/Chat/Commands/WhisperCommand.cs
Content.Server/Disposal/TubeConnectionsCommand.cs
Content.Server/EntityList/SpawnEntityListCommand.cs
Content.Server/GameTicking/Commands/ObserveCommand.cs
Content.Server/Mapping/MappingCommand.cs
Content.Server/NPC/Commands/NPCCommand.cs
Content.Server/Salvage/SalvageRulerCommand.cs
Resources/Locale/en-US/administration/commands/set-outfit-command.ftl
Resources/Locale/en-US/shell.ftl

index 9f9ec9e89fa4177100d9ef1f03d4caf0848aa1ad..b4faa6afefe94296c1523d4be62b8935f19f1b39 100644 (file)
@@ -17,7 +17,7 @@ public sealed class BanPanelCommand : LocalizedCommands
     {
         if (shell.Player is not { } player)
         {
-            shell.WriteError(Loc.GetString("cmd-banpanel-server"));
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 9d39cb9ddeb2e8f41bde9a2f761ecc1f83f92e5a..8613fafeae53a292b8246b9d725a9908ad92bb54 100644 (file)
@@ -17,7 +17,7 @@ namespace Content.Server.Administration.Commands
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteLine("shell-server-cannot");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index f29e105909f4b211c24ebbf6073c9236fb0dbd3d..8e7f0f4bf05abc1d574ab08540572569bc2a3307 100644 (file)
@@ -17,10 +17,9 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player;
-            if (player == null)
+            if (shell.Player is not { } player)
             {
-                shell.WriteLine("shell-only-players-can-run-this-command");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 8323278c58bb8dd9a6ff2dfb6801279f0882a889..c1103f47d8f0498f23265b41dcf78b0a4ce32983 100644 (file)
@@ -15,10 +15,9 @@ public sealed class FaxUiCommand : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player;
-        if (player == null)
+        if (shell.Player is not { } player)
         {
-            shell.WriteLine("shell-only-players-can-run-this-command");
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 9f94f83b4d3f1f1f6076fd859def21ed885d2cdd..b59a99b8b4caaec19614786a7b78adeaeba88673 100644 (file)
@@ -16,10 +16,9 @@ public sealed class FollowCommand : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player;
-        if (player == null)
+        if (shell.Player is not { } player)
         {
-            shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 47ff3e1a1c89374f8cb681b2cce7281abeba6742..5572fa542bd552e6cd4c54b7f0fb480325a52b41 100644 (file)
@@ -16,7 +16,7 @@ public sealed class OpenAdminLogsCommand : IConsoleCommand
     {
         if (shell.Player is not { } player)
         {
-            shell.WriteLine("This does not work from the server console.");
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index e6ae4f7616754df70bc455c43f0ffbc1868832b2..ae79aa52bbaaba43dc1ec38d4df31517bea0b9df 100644 (file)
@@ -17,7 +17,7 @@ public sealed class OpenAdminNotesCommand : IConsoleCommand
     {
         if (shell.Player is not { } player)
         {
-            shell.WriteError("This does not work from the server console.");
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 507c7ab2799f59afdaa9938f8209642507028b51..53651a8a8e50fcb8ee6b502c591950b41a5b1ed0 100644 (file)
@@ -28,7 +28,7 @@ public sealed class OpenUserVisibleNotesCommand : IConsoleCommand
 
         if (shell.Player is not { } player)
         {
-            shell.WriteError("This does not work from the server console.");
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index c1f72f7666061033baaf1358e294b4ebd04e216d..b3e17c96228294f9066005c75597749ec2e681c6 100644 (file)
@@ -16,7 +16,7 @@ namespace Content.Server.Administration.Commands
         {
             if (shell.Player == null)
             {
-                shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 059d25df27c3feb9b9e1ea0e68b277c97c8d2d80..e303b9766d84edcfc720ad21ce502b37805c4303 100644 (file)
@@ -18,7 +18,7 @@ namespace Content.Server.Chat.Commands
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteError("This command cannot be run from the server.");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 273f908c9ab273b5a21580bb248b425cff024726..df6e548e5d9efcbba29485bbad3a34bb5a4c9bbc 100644 (file)
@@ -16,7 +16,7 @@ namespace Content.Server.Chat.Commands
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteError("This command cannot be run from the server.");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index ea45158e44bee5513bfd0bedcbf8a739075afbdd..ec623b4a514d24281a706cc07c2261b6a5487b1c 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Server.Chat.Commands
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteLine(Loc.GetString("shell-cannot-run-command-from-server"));
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index c88e2519ee6ede5a036d5e2fecc37a01986e57dc..13effa34464ba85804a1be69a50e0017ba20fcec 100644 (file)
@@ -16,7 +16,7 @@ namespace Content.Server.Chat.Commands
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteError("This command cannot be run from the server.");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 55e64659379ded95c6417d6fd867d0f7051a23da..564c46be7a0d25b83115a17919971e7156494f32 100644 (file)
@@ -17,8 +17,13 @@ namespace Content.Server.Disposal
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player;
-            if (player?.AttachedEntity == null)
+            if (shell.Player is not { } player)
+            {
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
+                return;
+            }
+
+            if (player.AttachedEntity is not { } attached)
             {
                 shell.WriteLine(Loc.GetString("shell-only-players-can-run-this-command"));
                 return;
index 027d25dc2c22c07dd489a16e0556dfec04918bed..127e1ec47cc70183589772c1e81bea3ce8772814 100644 (file)
@@ -23,13 +23,13 @@ namespace Content.Server.EntityList
 
             if (shell.Player is not { } player)
             {
-                shell.WriteError("You must be a player to run this command.");
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
             if (player.AttachedEntity is not {} attached)
             {
-                shell.WriteError("You must have an entity to run this command.");
+                shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
                 return;
             }
 
index 5a035033179b051f5aa990ab4a08a306771dbef6..e13d70b972d5087a497c71a11f3caf2a29a4af30 100644 (file)
@@ -19,6 +19,7 @@ namespace Content.Server.GameTicking.Commands
         {
             if (shell.Player is not { } player)
             {
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 46534f7059d62e8177354e6d60e093f4bf951e1c..70647d3281456457305fb934bc0e0ede1684812e 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Server.Mapping
         {
             if (shell.Player is not { } player)
             {
-                shell.WriteError(Loc.GetString("cmd-savemap-server"));
+                shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
             }
 
index 7f9e56b8cac29ee2f457abc9068103bdc326467a..e1e432e1a44bcbab5d42b3e460205a6f2d28ebd7 100644 (file)
@@ -16,6 +16,7 @@ public sealed class NPCCommand : IConsoleCommand
     {
         if (shell.Player is not { } playerSession)
         {
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 49785e8f4171558f5ba7abe3460da7cb657aeb78..b445358c375f1cb74ea17af9cbe36318c701007a 100644 (file)
@@ -27,7 +27,7 @@ sealed class SalvageRulerCommand : IConsoleCommand
 
         if (shell.Player is not { } player)
         {
-            shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
+            shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
             return;
         }
 
index 7d97963ba94c25b4853604a5a3f6a7a2e68254d0..793c339c280d500a66ae869a8e51f7c00c1024fd 100644 (file)
@@ -1,4 +1,4 @@
 set-outfit-command-description = Sets the outfit of the specified entity. The entity must have {INDEFINITE($requiredComponent)} {$requiredComponent}
 set-outfit-command-help-text = Usage: {$command} <entityUid> | {$command} <entityUid> <outfitId>
-set-outfit-command-is-not-player-error = This does not work from the server console. You must pass the outfit id aswell.
+set-outfit-command-is-not-player-error = This command requires both arguments to work from the server console. 
 set-outfit-command-invalid-outfit-id-error = Invalid outfit id
index 34460f001a056d97ccdd4ae7d9d615a879f15583..957d3d3c0243c6302add9b0141f760b5c8b3415e 100644 (file)
@@ -2,7 +2,6 @@
 
 ## General
 
-shell-server-cannot = Server cannot do this.
 shell-command-success = Command successful
 shell-invalid-command = Invalid command.
 shell-invalid-command-specific = Invalid {$commandName} command.