Removed old Loc.GetString() use instances (#4155)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -14,21 +14,21 @@ namespace Content.Server.Administration.Commands
|
||||
class ControlMob : IConsoleCommand
|
||||
{
|
||||
public string Command => "controlmob";
|
||||
public string Description => Loc.GetString("Transfers user mind to the specified entity.");
|
||||
public string Help => Loc.GetString("Usage: controlmob <mobUid>.");
|
||||
public string Description => Loc.GetString("control-mob-command-description");
|
||||
public string Help => Loc.GetString("control-mob-command-help-text");
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var player = shell.Player as IPlayerSession;
|
||||
if (player == null)
|
||||
{
|
||||
shell.WriteLine("Server cannot do this.");
|
||||
shell.WriteLine("shell-server-cannot");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Wrong number of arguments."));
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
if (!int.TryParse(args[0], out var targetId))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Argument must be a number."));
|
||||
shell.WriteLine(Loc.GetString("shell-argument-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
if (!eUid.IsValid() || !entityManager.EntityExists(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Invalid entity ID."));
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
var target = entityManager.GetEntity(eUid);
|
||||
if (!target.TryGetComponent(out MindComponent? mindComponent))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Target entity is not a mob!"));
|
||||
shell.WriteLine(Loc.GetString("shell-entity-is-not-mob"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
public string Command => "dsay";
|
||||
|
||||
public string Description => Loc.GetString("Sends a message to deadchat as an admin");
|
||||
public string Description => Loc.GetString("dsay-command-description");
|
||||
|
||||
public string Help => Loc.GetString($"Usage: {Command} <message>");
|
||||
public string Help => Loc.GetString("dsay-command-help-text", ("command", Command));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var player = shell.Player as IPlayerSession;
|
||||
if (player == null)
|
||||
{
|
||||
shell.WriteLine("Only players can use this command");
|
||||
shell.WriteLine("shell-only-players-can-run-this-command");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Shared.Console;
|
||||
@@ -12,20 +12,10 @@ namespace Content.Server.Administration.Commands
|
||||
class DeleteEntitiesWithComponent : IConsoleCommand
|
||||
{
|
||||
public string Command => "deleteewc";
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return Loc.GetString("Deletes entities with the specified components.");
|
||||
}
|
||||
}
|
||||
public string Help
|
||||
{
|
||||
get
|
||||
{
|
||||
return Loc.GetString("Usage: deleteewc <componentName_1> <componentName_2> ... <componentName_n>\nDeletes any entities with the components specified.");
|
||||
}
|
||||
}
|
||||
|
||||
public string Description => Loc.GetString("delete-entities-with-component-command-description");
|
||||
|
||||
public string Help => Loc.GetString("delete-entities-with-component-command-help-text");
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
@@ -52,7 +42,7 @@ namespace Content.Server.Administration.Commands
|
||||
count += 1;
|
||||
}
|
||||
|
||||
shell.WriteLine(Loc.GetString("Deleted {0} entities", count));
|
||||
shell.WriteLine(Loc.GetString("delete-entities-with-component-command-deleted-components",("count", count)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,30 +12,20 @@ namespace Content.Server.Administration.Commands
|
||||
class Rejuvenate : IConsoleCommand
|
||||
{
|
||||
public string Command => "rejuvenate";
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return Loc.GetString("Fully heals a mob.");
|
||||
}
|
||||
}
|
||||
public string Help
|
||||
{
|
||||
get
|
||||
{
|
||||
return Loc.GetString("Usage: rejuvenate <mobUid_1> <mobUid_2> ... <mobUid_n>\nAttempts to heal the user's mob if no arguments are provided.");
|
||||
}
|
||||
}
|
||||
|
||||
public string Description => Loc.GetString("rejuvenate-command-description");
|
||||
|
||||
public string Help => Loc.GetString("rejuvenate-command-help-text");
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var player = shell.Player as IPlayerSession;
|
||||
if (args.Length < 1 && player != null) //Try to heal the users mob if applicable
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Healing the user's mob since no arguments were provided."));
|
||||
shell.WriteLine(Loc.GetString("rejuvenate-command-self-heal-message"));
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("There's no entity attached to the user."));
|
||||
shell.WriteLine(Loc.GetString("rejuvenate-command-no-entity-attached-message"));
|
||||
return;
|
||||
}
|
||||
RejuvenateVerb.PerformRejuvenate(player.AttachedEntity);
|
||||
@@ -46,7 +36,7 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
if(!EntityUid.TryParse(arg, out var uid) || !entityManager.TryGetEntity(uid, out var entity))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Could not find entity {0}", arg));
|
||||
shell.WriteLine(Loc.GetString("shell-could-not-find-entity",("entity", arg)));
|
||||
continue;
|
||||
}
|
||||
RejuvenateVerb.PerformRejuvenate(entity);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
|
||||
using Content.Server.Database;
|
||||
using Content.Server.Interfaces;
|
||||
@@ -16,14 +16,14 @@ namespace Content.Server.Administration.Commands
|
||||
internal class SetAdminOOC : IConsoleCommand
|
||||
{
|
||||
public string Command => "setadminooc";
|
||||
public string Description => Loc.GetString($"Sets the color of your OOC messages. Color must be in hex format, example: {Command} #c43b23");
|
||||
public string Help => Loc.GetString($"Usage: {Command} <color>");
|
||||
public string Description => Loc.GetString("set-admin-ooc-command-description", ("command", Command));
|
||||
public string Help => Loc.GetString("set-admin-ooc-command-help-text", ("command", Command));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (!(shell.Player is IPlayerSession))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("Only players can use this command"));
|
||||
shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.Administration.Commands
|
||||
var color = Color.TryFromHex(colorArg);
|
||||
if (!color.HasValue)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("Invalid color hex!"));
|
||||
shell.WriteError(Loc.GetString("shell-invalid-color-hex"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,21 +15,21 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
public string Command => "setmind";
|
||||
|
||||
public string Description => Loc.GetString("Transfers a mind to the specified entity. The entity must have a MindComponent.");
|
||||
public string Description => Loc.GetString("set-mind-command-description", ("requiredComponent", nameof(MindComponent)));
|
||||
|
||||
public string Help => Loc.GetString("Usage: {0} <entityUid> <username>", Command);
|
||||
public string Help => Loc.GetString("set-mind-command-help-text", ("command", Command));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Wrong number of arguments."));
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(args[0], out var entityUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("EntityUid must be a number."));
|
||||
shell.WriteLine(Loc.GetString("shell-entity-uid-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,21 +39,21 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
if (!eUid.IsValid() || !entityManager.EntityExists(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Invalid entity ID."));
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
var target = entityManager.GetEntity(eUid);
|
||||
|
||||
if (!target.TryGetComponent<MindComponent>(out var mindComponent))
|
||||
if (!target.HasComponent<MindComponent>())
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Target entity does not have a mind (did you forget to make sentient?)"));
|
||||
shell.WriteLine(Loc.GetString("set-mind-command-target-has-no-mind-message"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IPlayerManager>().TryGetSessionByUsername(args[1], out var session))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Target player does not exist"));
|
||||
shell.WriteLine(Loc.GetString("shell-target-player-does-not-exist"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Content.Server.Administration.Commands
|
||||
var playerCData = session.ContentData();
|
||||
if (playerCData == null)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Target player does not have content data (wtf?)"));
|
||||
shell.WriteLine(Loc.GetString("set-mind-command-target-has-no-content-data-message"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using Content.Shared.Administration;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Roles;
|
||||
using NFluidsynth;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
@@ -26,22 +25,21 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
public string Command => "setoutfit";
|
||||
|
||||
public string Description =>
|
||||
Loc.GetString("Sets the outfit of the specified entity. The entity must have an InventoryComponent");
|
||||
public string Description => Loc.GetString("set-outfit-command-description", ("requiredComponent", nameof(InventoryComponent)));
|
||||
|
||||
public string Help => Loc.GetString("Usage: {0} <entityUid> | {0} <entityUid> <outfitId>", Command);
|
||||
public string Help => Loc.GetString("set-outfit-command-help-text", ("command",Command));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Wrong number of arguments."));
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(args[0], out var entityUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("EntityUid must be a number."));
|
||||
shell.WriteLine(Loc.GetString("shell-entity-uid-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +49,7 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
if (!eUid.IsValid() || !entityManager.EntityExists(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Invalid entity ID."));
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,17 +57,15 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
if (!target.TryGetComponent<InventoryComponent>(out var inventoryComponent))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Target entity does not have an inventory!"));
|
||||
shell.WriteLine(Loc.GetString("shell-target-entity-does-not-have-message",("missing", "inventory")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 1)
|
||||
{
|
||||
if (!(shell.Player is IPlayerSession player))
|
||||
if (shell.Player is not IPlayerSession player)
|
||||
{
|
||||
shell.WriteError(
|
||||
Loc.GetString(
|
||||
"This does not work from the server console. You must pass the outfit id aswell."));
|
||||
shell.WriteError(Loc.GetString("set-outfit-command-is-not-player-error"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +78,7 @@ namespace Content.Server.Administration.Commands
|
||||
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
||||
if (!prototypeManager.TryIndex<StartingGearPrototype>(args[1], out var startingGear))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Invalid outfit id"));
|
||||
shell.WriteLine(Loc.GetString("set-outfit-command-invalid-outfit-id-error"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,7 +96,10 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
inventoryComponent.ForceUnequip(slot);
|
||||
var gearStr = startingGear.GetGear(slot, profile);
|
||||
if (gearStr == "") continue;
|
||||
if (gearStr == string.Empty)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var equipmentEntity = entityManager.SpawnEntity(gearStr, target.Transform.Coordinates);
|
||||
if (slot == EquipmentSlotDefines.Slots.IDCARD &&
|
||||
equipmentEntity.TryGetComponent<PDAComponent>(out var pdaComponent) &&
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace Content.Server.Administration.Managers
|
||||
return;
|
||||
}
|
||||
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("{0} de-adminned themselves.", session.Name));
|
||||
_chat.DispatchServerMessage(session, Loc.GetString("You are now a normal player."));
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("admin-manager-self-de-admin-message", ("exAdminName", session.Name)));
|
||||
_chat.DispatchServerMessage(session, Loc.GetString("admin-manager-became-normal-player-message"));
|
||||
|
||||
var plyData = session.ContentData()!;
|
||||
plyData.ExplicitlyDeadminned = true;
|
||||
@@ -97,13 +97,13 @@ namespace Content.Server.Administration.Managers
|
||||
throw new ArgumentException($"Player {session} is not an admin");
|
||||
}
|
||||
|
||||
_chat.DispatchServerMessage(session, Loc.GetString("You are now an admin."));
|
||||
_chat.DispatchServerMessage(session, Loc.GetString("admin-manager-became-admin-message"));
|
||||
|
||||
var plyData = session.ContentData()!;
|
||||
plyData.ExplicitlyDeadminned = false;
|
||||
reg.Data.Active = true;
|
||||
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("{0} re-adminned themselves.", session.Name));
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("admin-manager-self-re-admin-message", ("newAdminName", session.Name)));
|
||||
|
||||
SendPermsChangedEvent(session);
|
||||
UpdateAdminStatus(session);
|
||||
@@ -124,7 +124,7 @@ namespace Content.Server.Administration.Managers
|
||||
{
|
||||
// No longer admin.
|
||||
_admins.Remove(player);
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("You are no longer an admin."));
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("admin-manager-no-longer-admin-message"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace Content.Server.Administration.Managers
|
||||
RankId = rankId
|
||||
};
|
||||
_admins.Add(player, reg);
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("You are now an admin."));
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("admin-manager-became-admin-message"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -153,7 +153,7 @@ namespace Content.Server.Administration.Managers
|
||||
{
|
||||
aData.Active = true;
|
||||
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("Your admin permissions have been updated."));
|
||||
_chat.DispatchServerMessage(player, Loc.GetString("admin-manager-admin-permissions-updated-message"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace Content.Server.Administration.Managers
|
||||
foreach (var session in _playerManager.GetAllPlayers())
|
||||
{
|
||||
var name = session.Name;
|
||||
var username = session.AttachedEntity?.Name ?? "";
|
||||
var username = session.AttachedEntity?.Name ?? string.Empty;
|
||||
var antag = session.ContentData()?.Mind?.AllRoles.Any(r => r.Antagonist) ?? false;
|
||||
|
||||
netMsg.PlayersInfo.Add(new AdminMenuPlayerListMessage.PlayerInfo(name, username, antag));
|
||||
@@ -308,7 +308,7 @@ namespace Content.Server.Administration.Managers
|
||||
{
|
||||
if (_admins.Remove(e.Session) && _cfg.GetCVar(CCVars.AdminAnnounceLogout))
|
||||
{
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("Admin logout: {0}", e.Session.Name));
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("admin-manager-admin-logout-message", ("name", e.Session.Name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,7 @@ namespace Content.Server.Administration.Managers
|
||||
|
||||
if (_cfg.GetCVar(CCVars.AdminAnnounceLogin))
|
||||
{
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("Admin login: {0}", session.Name));
|
||||
_chat.SendAdminAnnouncement(Loc.GetString("admin-manager-admin-login-message", ("name", session.Name)));
|
||||
}
|
||||
|
||||
SendPermsChangedEvent(session);
|
||||
@@ -352,7 +352,7 @@ namespace Content.Server.Administration.Managers
|
||||
{
|
||||
var data = new AdminData
|
||||
{
|
||||
Title = Loc.GetString("Host"),
|
||||
Title = Loc.GetString("admin-manager-admin-data-host-title"),
|
||||
Flags = AdminFlagsHelper.Everything,
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Administration.Verbs
|
||||
return;
|
||||
}
|
||||
|
||||
data.Text = Loc.GetString("Add Reagent...");
|
||||
data.Text = Loc.GetString("admin-add-reagent-verb-get-data-text");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.Administration.Verbs
|
||||
return;
|
||||
}
|
||||
|
||||
data.Text = Loc.GetString("Delete");
|
||||
data.Text = Loc.GetString("delete-verb-get-data-text");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.IconTexture = "/Textures/Interface/VerbIcons/delete.svg.192dpi.png";
|
||||
|
||||
Reference in New Issue
Block a user