-using Content.Client.Actions;
+using Content.Client.Actions;
using Content.Client.Mapping;
using Content.Shared.Administration;
using Robust.Shared.Console;
public sealed class SaveActionsCommand : IConsoleCommand
{
public string Command => "saveacts";
-
public string Description => "Saves the current action toolbar assignments to a file";
-
public string Help => $"Usage: {Command} <user resource path>";
-
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
*/
[AnyCommand]
-public sealed class LoadActionsCommand : IConsoleCommand
+public sealed class LoadActionsCommand : LocalizedCommands
{
- public string Command => "loadacts";
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
- public string Description => "Loads action toolbar assignments from a user-file.";
+ public override string Command => "loadacts";
- public string Help => $"Usage: {Command} <user resource path>";
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
try
{
- EntitySystem.Get<ActionsSystem>().LoadActionAssignments(args[0], true);
+ _entitySystemManager.GetEntitySystem<ActionsSystem>().LoadActionAssignments(args[0], true);
}
catch
{
- shell.WriteLine("Failed to load action assignments");
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}
[AnyCommand]
-public sealed class LoadMappingActionsCommand : IConsoleCommand
+public sealed class LoadMappingActionsCommand : LocalizedCommands
{
- public string Command => "loadmapacts";
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
- public string Description => "Loads the mapping preset action toolbar assignments.";
+ public const string CommandName = "loadmapacts";
- public string Help => $"Usage: {Command}";
+ public override string Command => CommandName;
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
try
{
- EntitySystem.Get<MappingSystem>().LoadMappingActions();
+ _entitySystemManager.GetEntitySystem<MappingSystem>().LoadMappingActions();
}
catch
{
- shell.WriteLine("Failed to load action assignments");
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}
-using JetBrains.Annotations;
-using Content.Shared.Atmos;
-using System;
using Content.Client.Atmos.EntitySystems;
+using Content.Shared.Atmos;
+using JetBrains.Annotations;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+[UsedImplicitly]
+internal sealed class AtvRangeCommand : LocalizedCommands
{
- [UsedImplicitly]
- internal sealed class AtvRangeCommand : IConsoleCommand
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "atvrange";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "atvrange";
- public string Description => "Sets the atmos debug range (as two floats, start [red] and end [blue])";
- public string Help => "atvrange <start> <end>";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ if (args.Length != 2)
{
- if (args.Length != 2)
- {
- shell.WriteLine(Help);
- return;
- }
- if (!float.TryParse(args[0], out var xStart))
- {
- shell.WriteLine("Bad float START");
- return;
- }
- if (!float.TryParse(args[1], out var xEnd))
- {
- shell.WriteLine("Bad float END");
- return;
- }
- if (xStart == xEnd)
- {
- shell.WriteLine("Scale cannot be zero, as this would cause a division by zero in AtmosDebugOverlay.");
- return;
- }
- var sys = EntitySystem.Get<AtmosDebugOverlaySystem>();
- sys.CfgBase = xStart;
- sys.CfgScale = xEnd - xStart;
+ shell.WriteLine(Help);
+ return;
}
+ if (!float.TryParse(args[0], out var xStart))
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-start"));
+ return;
+ }
+ if (!float.TryParse(args[1], out var xEnd))
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-end"));
+ return;
+ }
+ if (xStart == xEnd)
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-zero"));
+ return;
+ }
+ var sys = _entitySystemManager.GetEntitySystem<AtmosDebugOverlaySystem>();
+ sys.CfgBase = xStart;
+ sys.CfgScale = xEnd - xStart;
}
+}
- [UsedImplicitly]
- internal sealed class AtvModeCommand : IConsoleCommand
+[UsedImplicitly]
+internal sealed class AtvModeCommand : LocalizedCommands
+{
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "atvmode";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "atvmode";
- public string Description => "Sets the atmos debug mode. This will automatically reset the scale.";
- public string Help => "atvmode <TotalMoles/GasMoles/Temperature> [<gas ID (for GasMoles)>]";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ if (args.Length < 1)
+ {
+ shell.WriteLine(Help);
+ return;
+ }
+ if (!Enum.TryParse<AtmosDebugOverlayMode>(args[0], out var xMode))
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-invalid"));
+ return;
+ }
+ int xSpecificGas = 0;
+ float xBase = 0;
+ float xScale = Atmospherics.MolesCellStandard * 2;
+ if (xMode == AtmosDebugOverlayMode.GasMoles)
{
- if (args.Length < 1)
+ if (args.Length != 2)
{
- shell.WriteLine(Help);
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-target-gas"));
return;
}
- if (!Enum.TryParse<AtmosDebugOverlayMode>(args[0], out var xMode))
+ if (!AtmosCommandUtils.TryParseGasID(args[1], out xSpecificGas))
{
- shell.WriteLine("Invalid mode");
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error-out-of-range"));
return;
}
- int xSpecificGas = 0;
- float xBase = 0;
- float xScale = Atmospherics.MolesCellStandard * 2;
- if (xMode == AtmosDebugOverlayMode.GasMoles)
+ }
+ else
+ {
+ if (args.Length != 1)
{
- if (args.Length != 2)
- {
- shell.WriteLine("A target gas must be provided for this mode.");
- return;
- }
- if (!AtmosCommandUtils.TryParseGasID(args[1], out xSpecificGas))
- {
- shell.WriteLine("Gas ID not parsable or out of range.");
- return;
- }
+ shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-error-info"));
+ return;
}
- else
+ if (xMode == AtmosDebugOverlayMode.Temperature)
{
- if (args.Length != 1)
- {
- shell.WriteLine("No further information is required for this mode.");
- return;
- }
- if (xMode == AtmosDebugOverlayMode.Temperature)
- {
- // Red is 100C, Green is 20C, Blue is -60C
- xBase = Atmospherics.T20C + 80;
- xScale = -160;
- }
+ // Red is 100C, Green is 20C, Blue is -60C
+ xBase = Atmospherics.T20C + 80;
+ xScale = -160;
}
- var sys = EntitySystem.Get<AtmosDebugOverlaySystem>();
- sys.CfgMode = xMode;
- sys.CfgSpecificGas = xSpecificGas;
- sys.CfgBase = xBase;
- sys.CfgScale = xScale;
}
+ var sys = _entitySystemManager.GetEntitySystem<AtmosDebugOverlaySystem>();
+ sys.CfgMode = xMode;
+ sys.CfgSpecificGas = xSpecificGas;
+ sys.CfgBase = xBase;
+ sys.CfgScale = xScale;
}
+}
- [UsedImplicitly]
- internal sealed class AtvCBMCommand : IConsoleCommand
+[UsedImplicitly]
+internal sealed class AtvCBMCommand : LocalizedCommands
+{
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "atvcbm";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "atvcbm";
- public string Description => "Changes from red/green/blue to greyscale";
- public string Help => "atvcbm <true/false>";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ if (args.Length != 1)
{
- if (args.Length != 1)
- {
- shell.WriteLine(Help);
- return;
- }
- if (!bool.TryParse(args[0], out var xFlag))
- {
- shell.WriteLine("Invalid flag");
- return;
- }
- var sys = EntitySystem.Get<AtmosDebugOverlaySystem>();
- sys.CfgCBM = xFlag;
+ shell.WriteLine(Help);
+ return;
+ }
+ if (!bool.TryParse(args[0], out var xFlag))
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
+ return;
}
+ var sys = _entitySystemManager.GetEntitySystem<AtmosDebugOverlaySystem>();
+ sys.CfgCBM = xFlag;
}
}
using Content.Client.Credits;
-using Content.Client.UserInterface;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Shared.Console;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+[UsedImplicitly, AnyCommand]
+public sealed class CreditsCommand : LocalizedCommands
{
- [UsedImplicitly, AnyCommand]
- public sealed class CreditsCommand : IConsoleCommand
- {
- public string Command => "credits";
- public string Description => "Opens the credits window";
- public string Help => "credits";
+ public override string Command => "credits";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- new CreditsWindow().Open();
- }
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ new CreditsWindow().Open();
}
}
using Robust.Shared.Console;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+internal sealed class ShowMarkersCommand : LocalizedCommands
{
- internal sealed class ShowMarkersCommand : IConsoleCommand
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "showmarkers";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- // ReSharper disable once StringLiteralTypo
- public string Command => "showmarkers";
- public string Description => "Toggles visibility of markers such as spawn points.";
- public string Help => "";
+ _entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible ^= true;
+ }
+}
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<MarkerSystem>().MarkersVisible ^= true;
- }
+internal sealed class ShowSubFloor : LocalizedCommands
+{
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "showsubfloor";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ _entitySystemManager.GetEntitySystem<SubFloorHideSystem>().ShowAll ^= true;
}
+}
- internal sealed class ShowSubFloor : IConsoleCommand
+internal sealed class ShowSubFloorForever : LocalizedCommands
+{
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public const string CommandName = "showsubfloorforever";
+ public override string Command => CommandName;
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- // ReSharper disable once StringLiteralTypo
- public string Command => "showsubfloor";
- public string Description => "Makes entities below the floor always visible.";
- public string Help => $"Usage: {Command}";
+ _entitySystemManager.GetEntitySystem<SubFloorHideSystem>().ShowAll = true;
+
+ var entMan = IoCManager.Resolve<IEntityManager>();
+ var components = entMan.EntityQuery<SubFloorHideComponent, SpriteComponent>(true);
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ foreach (var (_, sprite) in components)
{
- IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<SubFloorHideSystem>().ShowAll ^= true;
+ sprite.DrawDepth = (int) DrawDepth.Overlays;
}
}
+}
- internal sealed class ShowSubFloorForever : IConsoleCommand
- {
- // ReSharper disable once StringLiteralTypo
- public string Command => "showsubfloorforever";
- public string Description => "Makes entities below the floor always visible until the client is restarted.";
- public string Help => $"Usage: {Command}";
-
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- EntitySystem.Get<SubFloorHideSystem>().ShowAll = true;
+internal sealed class NotifyCommand : LocalizedCommands
+{
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
- var entMan = IoCManager.Resolve<IEntityManager>();
- var components = entMan.EntityQuery<SubFloorHideComponent, SpriteComponent>(true);
+ public override string Command => "notify";
- foreach (var (_, sprite) in components)
- {
- sprite.DrawDepth = (int) DrawDepth.Overlays;
- }
- }
- }
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- internal sealed class NotifyCommand : IConsoleCommand
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "notify";
- public string Description => "Send a notify client side.";
- public string Help => "notify <message>";
+ var message = args[0];
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- var message = args[0];
-
- IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<PopupSystem>().PopupCursor(message);
- }
+ _entitySystemManager.GetEntitySystem<PopupSystem>().PopupCursor(message);
}
}
-using System.Linq;
using Content.Client.NPC;
using Content.Shared.NPC;
using JetBrains.Annotations;
using Robust.Shared.Console;
+using System.Linq;
+
+namespace Content.Client.Commands;
-namespace Content.Client.Commands
+[UsedImplicitly]
+public sealed class DebugPathfindingCommand : LocalizedCommands
{
- [UsedImplicitly]
- public sealed class DebugPathfindingCommand : IConsoleCommand
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "pathfinder";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- // ReSharper disable once StringLiteralTypo
- public string Command => "pathfinder";
- public string Description => "Toggles visibility of pathfinding debuggers.";
- public string Help => "pathfinder [options]";
+ var system = _entitySystemManager.GetEntitySystem<PathfindingSystem>();
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ if (args.Length == 0)
{
- var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<PathfindingSystem>();
+ system.Modes = PathfindingDebugMode.None;
+ return;
+ }
- if (args.Length == 0)
+ foreach (var arg in args)
+ {
+ if (!Enum.TryParse<PathfindingDebugMode>(arg, out var mode))
{
- system.Modes = PathfindingDebugMode.None;
- return;
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error", ("arg", arg)));
+ continue;
}
- foreach (var arg in args)
- {
- if (!Enum.TryParse<PathfindingDebugMode>(arg, out var mode))
- {
- shell.WriteError($"Unrecognised pathfinder args {arg}");
- continue;
- }
-
- system.Modes ^= mode;
- shell.WriteLine($"Toggled {arg} to {(system.Modes & mode) != 0x0}");
- }
+ system.Modes ^= mode;
+ shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("arg", arg), ("newMode", (system.Modes & mode) != 0x0)));
}
+ }
- public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+ public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+ {
+ if (args.Length > 1)
{
- if (args.Length > 1)
- {
- return CompletionResult.Empty;
- }
-
- var values = Enum.GetValues<PathfindingDebugMode>().ToList();
- var options = new List<CompletionOption>();
+ return CompletionResult.Empty;
+ }
- foreach (var val in values)
- {
- if (val == PathfindingDebugMode.None)
- continue;
+ var values = Enum.GetValues<PathfindingDebugMode>().ToList();
+ var options = new List<CompletionOption>();
- options.Add(new CompletionOption(val.ToString()));
- }
+ foreach (var val in values)
+ {
+ if (val == PathfindingDebugMode.None)
+ continue;
- return CompletionResult.FromOptions(options);
+ options.Add(new CompletionOption(val.ToString()));
}
+
+ return CompletionResult.FromOptions(options);
}
}
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
-using Robust.Shared.IoC;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+public sealed class GroupingEntityMenuCommand : LocalizedCommands
{
- public sealed class GroupingEntityMenuCommand : IConsoleCommand
+ [Dependency] private readonly IConfigurationManager _configurationManager = default!;
+
+ public override string Command => "entitymenug";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command), ("groupingTypesCount", EntityMenuUIController.GroupingTypesCount));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "entitymenug";
+ if (args.Length != 1)
+ {
+ shell.WriteLine(Help);
+ return;
+ }
- public string Description => "Sets the entity menu grouping type.";
+ if (!int.TryParse(args[0], out var id))
+ {
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error", ("arg", args[0])));
+ return;
+ }
- public string Help => $"Usage: entitymenug <0:{EntityMenuUIController.GroupingTypesCount}>";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ if (id < 0 || id > EntityMenuUIController.GroupingTypesCount - 1)
{
- if (args.Length != 1)
- {
- shell.WriteLine(Help);
- return;
- }
-
- if (!int.TryParse(args[0], out var id))
- {
- shell.WriteLine($"{args[0]} is not a valid integer.");
- return;
- }
-
- if (id < 0 ||id > EntityMenuUIController.GroupingTypesCount - 1)
- {
- shell.WriteLine($"{args[0]} is not a valid integer.");
- return;
- }
-
- var configurationManager = IoCManager.Resolve<IConfigurationManager>();
- var cvar = CCVars.EntityMenuGroupingType;
-
- configurationManager.SetCVar(cvar, id);
- shell.WriteLine($"Context Menu Grouping set to type: {configurationManager.GetCVar(cvar)}");
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error", ("arg", args[0])));
+ return;
}
+
+ var cvar = CCVars.EntityMenuGroupingType;
+
+ _configurationManager.SetCVar(cvar, id);
+ shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("cvar", _configurationManager.GetCVar(cvar))));
}
}
-using Content.Shared.Body.Organ;
-using Robust.Client.Console;
+using Content.Shared.Body.Organ;
using Robust.Client.GameObjects;
using Robust.Shared.Console;
using Robust.Shared.Containers;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+public sealed class HideMechanismsCommand : LocalizedCommands
{
- public sealed class HideMechanismsCommand : IConsoleCommand
+ [Dependency] private readonly IEntityManager _entityManager = default!;
+
+ public override string Command => "hidemechanisms";
+
+ public override string Description => LocalizationManager.GetString($"cmd-{Command}-desc", ("showMechanismsCommand", ShowMechanismsCommand.CommandName));
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- public string Command => "hidemechanisms";
- public string Description => $"Reverts the effects of {ShowMechanismsCommand.CommandName}";
- public string Help => $"{Command}";
+ var containerSys = _entityManager.System<SharedContainerSystem>();
+ var query = _entityManager.AllEntityQueryEnumerator<OrganComponent>();
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ while (query.MoveNext(out var uid, out _))
{
- var entityManager = IoCManager.Resolve<IEntityManager>();
- var containerSys = entityManager.System<SharedContainerSystem>();
- var query = entityManager.AllEntityQueryEnumerator<OrganComponent>();
-
- while (query.MoveNext(out var uid, out _))
+ if (!_entityManager.TryGetComponent(uid, out SpriteComponent? sprite))
{
- if (!entityManager.TryGetComponent(uid, out SpriteComponent? sprite))
- {
- continue;
- }
+ continue;
+ }
- sprite.ContainerOccluded = false;
+ sprite.ContainerOccluded = false;
- var tempParent = uid;
- while (containerSys.TryGetContainingContainer(tempParent, out var container))
+ var tempParent = uid;
+ while (containerSys.TryGetContainingContainer(tempParent, out var container))
+ {
+ if (!container.ShowContents)
{
- if (!container.ShowContents)
- {
- sprite.ContainerOccluded = true;
- break;
- }
-
- tempParent = container.Owner;
+ sprite.ContainerOccluded = true;
+ break;
}
- }
- IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand("hidecontainedcontext");
+ tempParent = container.Owner;
+ }
}
}
}
-using JetBrains.Annotations;
-using System;
using Content.Client.Markers;
+using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
namespace Content.Client.Commands;
-/// <summary>
-/// Sent by mapping command to client.
-/// This is because the debug commands for some of these options are on toggles.
-/// </summary>
[UsedImplicitly]
-internal sealed class MappingClientSideSetupCommand : IConsoleCommand
+internal sealed class MappingClientSideSetupCommand : LocalizedCommands
{
- // ReSharper disable once StringLiteralTypo
- public string Command => "mappingclientsidesetup";
- public string Description => "Sets up the lighting control and such settings client-side. Sent by 'mapping' to client.";
- public string Help => "";
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+ [Dependency] private readonly ILightManager _lightManager = default!;
+
+ public override string Command => "mappingclientsidesetup";
+
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var mgr = IoCManager.Resolve<ILightManager>();
- if (!mgr.LockConsoleAccess)
+ if (!_lightManager.LockConsoleAccess)
{
- EntitySystem.Get<MarkerSystem>().MarkersVisible = true;
- mgr.Enabled = false;
- shell.ExecuteCommand("showsubfloorforever");
- shell.ExecuteCommand("loadmapacts");
+ _entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible = true;
+ _lightManager.Enabled = false;
+ shell.ExecuteCommand(ShowSubFloorForever.CommandName);
+ shell.ExecuteCommand(LoadMappingActionsCommand.CommandName);
}
}
}
-using System;
-using Content.Client.Administration;
-using Content.Client.Administration.Systems;
using Content.Client.UserInterface.Systems.Bwoink;
-using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Shared.Administration;
using Robust.Client.UserInterface;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
using Robust.Shared.Network;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+[AnyCommand]
+public sealed class OpenAHelpCommand : LocalizedCommands
{
- [AnyCommand]
- public sealed class OpenAHelpCommand : IConsoleCommand
- {
- public string Command => "openahelp";
- public string Description => $"Opens AHelp channel for a given NetUserID, or your personal channel if none given.";
- public string Help => $"{Command} [<netuserid>]";
+ [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
+
+ public override string Command => "openahelp";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ if (args.Length >= 2)
{
- if (args.Length >= 2)
- {
- shell.WriteLine(Help);
- return;
- }
- if (args.Length == 0)
+ shell.WriteLine(Help);
+ return;
+ }
+ if (args.Length == 0)
+ {
+ _userInterfaceManager.GetUIController<AHelpUIController>().Open();
+ }
+ else
+ {
+ if (Guid.TryParse(args[0], out var guid))
{
- IoCManager.Resolve<IUserInterfaceManager>().GetUIController<AHelpUIController>().Open();
+ var targetUser = new NetUserId(guid);
+ _userInterfaceManager.GetUIController<AHelpUIController>().Open(targetUser);
}
else
{
- if (Guid.TryParse(args[0], out var guid))
- {
- var targetUser = new NetUserId(guid);
- IoCManager.Resolve<IUserInterfaceManager>().GetUIController<AHelpUIController>().Open(targetUser);
- }
- else
- {
- shell.WriteLine("Bad GUID!");
- }
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}
using Content.Client.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+[UsedImplicitly]
+internal sealed class SetMenuVisibilityCommand : LocalizedCommands
{
- [UsedImplicitly]
- internal sealed class SetMenuVisibilityCommand : IConsoleCommand
- {
- public const string CommandName = "menuvis";
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
- public string Command => CommandName;
- public string Description => "Set restrictions about what entities to show on the entity context menu.";
- public string Help => $"Usage: {Command} [NoFoV] [InContainer] [Invisible] [All]";
+ public override string Command => "menuvis";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- if (!TryParseArguments(shell, args, out var visibility))
- return;
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- EntitySystem.Get<VerbSystem>().Visibility = visibility;
- }
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ if (!TryParseArguments(shell, args, out var visibility))
+ return;
- private bool TryParseArguments(IConsoleShell shell, string[] args, out MenuVisibility visibility)
- {
- visibility = MenuVisibility.Default;
+ _entitySystemManager.GetEntitySystem<VerbSystem>().Visibility = visibility;
+ }
+
+ private bool TryParseArguments(IConsoleShell shell, string[] args, out MenuVisibility visibility)
+ {
+ visibility = MenuVisibility.Default;
- foreach (var arg in args)
+ foreach (var arg in args)
+ {
+ switch (arg.ToLower())
{
- switch (arg.ToLower())
- {
- case "nofov":
- visibility |= MenuVisibility.NoFov;
- break;
- case "incontainer":
- visibility |= MenuVisibility.InContainer;
- break;
- case "invisible":
- visibility |= MenuVisibility.Invisible;
- break;
- case "all":
- visibility |= MenuVisibility.All;
- break;
- default:
- shell.WriteLine($"Unknown visibility argument '{arg}'. Only 'NoFov', 'InContainer', 'Invisible' or 'All' are valid. Provide no arguments to set to default.");
- return false;
- }
+ // ReSharper disable once StringLiteralTypo
+ case "nofov":
+ visibility |= MenuVisibility.NoFov;
+ break;
+ // ReSharper disable once StringLiteralTypo
+ case "incontainer":
+ visibility |= MenuVisibility.InContainer;
+ break;
+ case "invisible":
+ visibility |= MenuVisibility.Invisible;
+ break;
+ case "all":
+ visibility |= MenuVisibility.All;
+ break;
+ default:
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error", ("arg", arg)));
+ return false;
}
-
- return true;
}
+
+ return true;
}
}
-using Content.Shared.Body.Organ;
-using Robust.Client.Console;
+using Content.Shared.Body.Organ;
using Robust.Client.GameObjects;
using Robust.Shared.Console;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+public sealed class ShowMechanismsCommand : LocalizedCommands
{
- public sealed class ShowMechanismsCommand : IConsoleCommand
- {
- public const string CommandName = "showmechanisms";
+ [Dependency] private readonly IEntityManager _entManager = default!;
- // ReSharper disable once StringLiteralTypo
- public string Command => CommandName;
- public string Description => "Makes mechanisms visible, even when they shouldn't be.";
- public string Help => $"{Command}";
+ public const string CommandName = "showmechanisms";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- var entityManager = IoCManager.Resolve<IEntityManager>();
- var query = entityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
+ public override string Command => CommandName;
- while (query.MoveNext(out _, out var sprite))
- {
- sprite.ContainerOccluded = false;
- }
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand("showcontainedcontext");
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var query = _entManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
+
+ while (query.MoveNext(out _, out var sprite))
+ {
+ sprite.ContainerOccluded = false;
}
}
}
-using Content.Client.HealthOverlay;
+using Content.Client.HealthOverlay;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+public sealed class ToggleHealthOverlayCommand : LocalizedCommands
{
- public sealed class ToggleHealthOverlayCommand : IConsoleCommand
- {
- public string Command => "togglehealthoverlay";
- public string Description => "Toggles a health bar above mobs.";
- public string Help => $"Usage: {Command}";
+ [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
+
+ public override string Command => "togglehealthoverlay";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- var system = EntitySystem.Get<HealthOverlaySystem>();
- system.Enabled = !system.Enabled;
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var system = _entitySystemManager.GetEntitySystem<HealthOverlaySystem>();
+ system.Enabled = !system.Enabled;
- shell.WriteLine($"Health overlay system {(system.Enabled ? "enabled" : "disabled")}.");
- }
+ shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("state", system.Enabled ? "enabled" : "disabled")));
}
}
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
-using Robust.Shared.IoC;
-namespace Content.Client.Commands
+namespace Content.Client.Commands;
+
+[AnyCommand]
+public sealed class ToggleOutlineCommand : LocalizedCommands
{
- [AnyCommand]
- public sealed class ToggleOutlineCommand : IConsoleCommand
- {
- public string Command => "toggleoutline";
+ [Dependency] private readonly IConfigurationManager _configurationManager = default!;
- public string Description => "Toggles outline drawing on entities.";
+ public override string Command => "toggleoutline";
- public string Help => "";
+ public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
- public void Execute(IConsoleShell shell, string argStr, string[] args)
- {
- var configurationManager = IoCManager.Resolve<IConfigurationManager>();
- var cvar = CCVars.OutlineEnabled;
- var old = configurationManager.GetCVar(cvar);
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var cvar = CCVars.OutlineEnabled;
+ var old = _configurationManager.GetCVar(cvar);
- configurationManager.SetCVar(cvar, !old);
- shell.WriteLine($"Draw outlines set to: {configurationManager.GetCVar(cvar)}");
- }
+ _configurationManager.SetCVar(cvar, !old);
+ shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("state", _configurationManager.GetCVar(cvar))));
}
}
-using System.Numerics;
using Content.Client.Movement.Systems;
using Content.Shared.Movement.Components;
-using Content.Shared.Movement.Systems;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Console;
+using System.Numerics;
namespace Content.Client.Commands;
[UsedImplicitly]
-public sealed class ZoomCommand : IConsoleCommand
+public sealed class ZoomCommand : LocalizedCommands
{
- [Dependency] private readonly IEntityManager _entManager = default!;
- [Dependency] private readonly IEyeManager _eyeMan = default!;
+ [Dependency] private readonly IEntityManager _entityManager = default!;
+ [Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
- public string Command => "zoom";
- public string Description => Loc.GetString("zoom-command-description");
- public string Help => Loc.GetString("zoom-command-help");
+ public override string Command => "zoom";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
Vector2 zoom;
if (args.Length is not (1 or 2))
if (!float.TryParse(args[0], out var arg0))
{
- shell.WriteError(Loc.GetString("cmd-parse-failure-float", ("arg", args[0])));
+ shell.WriteError(LocalizationManager.GetString("cmd-parse-failure-float", ("arg", args[0])));
return;
}
zoom = new(arg0, arg0);
else
{
- shell.WriteError(Loc.GetString("zoom-command-error"));
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
return;
}
{
if (!float.TryParse(args[1], out var arg1))
{
- shell.WriteError(Loc.GetString("cmd-parse-failure-float", ("arg", args[1])));
+ shell.WriteError(LocalizationManager.GetString("cmd-parse-failure-float", ("arg", args[1])));
return;
}
zoom.Y = arg1;
else
{
- shell.WriteError(Loc.GetString("zoom-command-error"));
+ shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
return;
}
}
- var player = _playerManager.LocalPlayer?.ControlledEntity;
+ var player = _playerManager.LocalSession?.AttachedEntity;
- if (_entManager.TryGetComponent<ContentEyeComponent>(player, out var content))
+ if (_entityManager.TryGetComponent<ContentEyeComponent>(player, out var content))
{
- _entManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, true, content);
+ _entityManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, true, content);
return;
}
- _eyeMan.CurrentEye.Zoom = zoom;
+ _eyeManager.CurrentEye.Zoom = zoom;
}
}
--- /dev/null
+cmd-loadacts-desc = Loads action toolbar assignments from a user-file.
+cmd-loadacts-help = Usage: {$command} <user resource path>
+cmd-loadacts-error = Failed to load action assignments
+
+cmd-loadmapacts-desc = Loads the mapping preset action toolbar assignments.
+cmd-loadmapacts-help = Usage: {$command} <user resource path>
+cmd-loadmapacts-error = Failed to load action assignments
\ No newline at end of file
--- /dev/null
+cmd-atvrange-desc = Sets the atmos debug range (as two floats, start [red] and end [blue])
+cmd-atvrange-help = Usage: {$command} <start> <end>
+cmd-atvrange-error-start = Bad float START
+cmd-atvrange-error-end = Bad float END
+cmd-atvrange-error-zero = Scale cannot be zero, as this would cause a division by zero in AtmosDebugOverlay.
+
+cmd-atvmode-desc = Sets the atmos debug mode. This will automatically reset the scale.
+cmd-atvmode-help = Usage: {$command} <TotalMoles/GasMoles/Temperature> [<gas ID (for GasMoles)>]
+cmd-atvmode-error-invalid = Invalid mode
+cmd-atvmode-error-target-gas = A target gas must be provided for this mode.
+cmd-atvmode-error-out-of-range = Gas ID not parsable or out of range.
+cmd-atvmode-error-info = No further information is required for this mode.
+
+cmd-atvcbm-desc = Changes from red/green/blue to greyscale
+cmd-atvcbm-help = Usage: {$command} <true/false>
+cmd-atvcbm-error = Invalid flag
--- /dev/null
+cmd-credits-desc = Opens the credits window
+cmd-credits-help = Usage: {$command}
\ No newline at end of file
--- /dev/null
+cmd-showmarkers-desc = Toggles visibility of markers such as spawn points.
+cmd-showmarkers-help = Usage: {$command}
+
+cmd-showsubfloor-desc = Makes entities below the floor always visible.
+cmd-showsubfloor-help = Usage: {$command}
+
+cmd-showsubfloorforever-desc = Makes entities below the floor always visible until the client is restarted.
+cmd-showsubfloorforever-help = Usage: {$command}
+
+cmd-notify-desc = Send a notify client side.
+cmd-notify-help = Usage: {$command} <message>
--- /dev/null
+cmd-pathfinder-desc = Toggles visibility of pathfinding debuggers.
+cmd-pathfinder-help = Usage: {$command} [options]
+cmd-pathfinder-error = Unrecognised pathfinder args {$arg}
+cmd-pathfinder-notify = Toggled {$arg} to {$newMode}
\ No newline at end of file
--- /dev/null
+cmd-entitymenug-desc = Sets the entity menu grouping type.
+cmd-entitymenug-help = Usage: {$command} <0:{$groupingTypesCount}>
+cmd-entitymenug-error = {$arg} is not a valid integer.
+cmd-entitymenug-notify = Context Menu Grouping set to type: {$cvar}
\ No newline at end of file
--- /dev/null
+cmd-hidemechanisms-desc = Reverts the effects of {$showMechanismsCommand}
+cmd-hidemechanisms-help = Usage: {$command}
\ No newline at end of file
--- /dev/null
+cmd-mappingclientsidesetup-desc = Sets up the lighting control and such settings client-side. Sent by 'mapping' to client.
+cmd-mappingclientsidesetup-help = Usage: {$command}
\ No newline at end of file
--- /dev/null
+cmd-openahelp-desc = Opens AHelp channel for a given NetUserID, or your personal channel if none given.
+cmd-openahelp-help = Usage: {$command} [<netuserid>]
+cmd-openahelp-error = Bad GUID!
\ No newline at end of file
--- /dev/null
+cmd-menuvis-desc = Set restrictions about what entities to show on the entity context menu.
+cmd-menuvis-help = Usage: {Command} [NoFoV] [InContainer] [Invisible] [All]
+cmd-menuvis-error = Unknown visibility argument '{$arg}'. Only 'NoFov', 'InContainer', 'Invisible' or 'All' are valid. Provide no arguments to set to default.
\ No newline at end of file
--- /dev/null
+cmd-showmechanisms-desc = Makes mechanisms visible, even when they shouldn't be.
+cmd-showmechanisms-help = Usage: {$command}
\ No newline at end of file
--- /dev/null
+cmd-togglehealthoverlay-desc = Toggles a health bar above mobs.
+cmd-togglehealthoverlay-help = Usage: {$command}
+cmd-togglehealthoverlay-notify = Health overlay system {$state}.
\ No newline at end of file
--- /dev/null
+cmd-toggleoutline-desc = Toggles outline drawing on entities.
+cmd-toggleoutline-help = Usage: {$command}
+cmd-toggleoutline-notify = Draw outlines set to: {$cvar}
\ No newline at end of file
-zoom-command-description = Sets the zoom of the main eye.
-zoom-command-help = zoom ( <scale> | <X-scale> <Y-scale> )
-zoom-command-error = scale has to be greater than 0
+cmd-zoom-desc = Sets the zoom of the main eye.
+cmd-zoom-help = zoom ( <scale> | <X-scale> <Y-scale> )
+cmd-zoom-error = scale has to be greater than 0