* i'm just gonna put this here.
* I'm just gonna do it.
* Update ShowHTNCommand.cs
* I feel dumb.
* may as well with this too.
* this does in fact not work
* :/
namespace Content.Client.Audio;
-public sealed class AmbientOverlayCommand : IConsoleCommand
+public sealed class AmbientOverlayCommand : LocalizedEntityCommands
{
- public string Command => "showambient";
- public string Description => "Shows all AmbientSoundComponents in the viewport";
- public string Help => $"{Command}";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ [Dependency] private readonly AmbientSoundSystem _ambient = default!;
+
+ public override string Command => "showambient";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AmbientSoundSystem>();
- system.OverlayEnabled ^= true;
+ _ambient.OverlayEnabled ^= true;
- shell.WriteLine($"Ambient sound overlay set to {system.OverlayEnabled}");
+ shell.WriteLine(Loc.GetString($"cmd-showambient-status", ("status", _ambient.OverlayEnabled)));
}
}
[GenerateTypedNameReferences]
public sealed partial class ChangelogWindow : FancyWindow
{
- [Dependency] private readonly ChangelogManager _changelog = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
+ [Dependency] private readonly ChangelogManager _changelog = default!;
public ChangelogWindow()
{
}
[UsedImplicitly, AnyCommand]
- public sealed class ChangelogCommand : IConsoleCommand
+ public sealed class ChangelogCommand : LocalizedCommands
{
- public string Command => "changelog";
- public string Description => "Opens the changelog";
- public string Help => "Usage: changelog";
+ [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
+
+ public override string Command => "changelog";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- IoCManager.Resolve<IUserInterfaceManager>().GetUIController<ChangelogUIController>().OpenWindow();
+ _uiManager.GetUIController<ChangelogUIController>().OpenWindow();
}
}
}
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
namespace Content.Client.Decals;
-public sealed class ToggleDecalCommand : IConsoleCommand
+public sealed class ToggleDecalCommand : LocalizedEntityCommands
{
- [Dependency] private readonly IEntityManager _e = default!;
+ [Dependency] private readonly DecalSystem _decal = default!;
- public string Command => "toggledecals";
- public string Description => "Toggles decaloverlay";
- public string Help => $"{Command}";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override string Command => "toggledecals";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- _e.System<DecalSystem>().ToggleOverlay();
+ _decal.ToggleOverlay();
}
}
namespace Content.Client.Ghost.Commands;
-public sealed class ToggleGhostVisibilityCommand : IConsoleCommand
+public sealed class ToggleGhostVisibilityCommand : LocalizedEntityCommands
{
- [Dependency] private readonly IEntitySystemManager _entSysMan = default!;
+ [Dependency] private readonly GhostSystem _ghost = default!;
- public string Command => "toggleghostvisibility";
- public string Description => "Toggles ghost visibility on the client.";
- public string Help => "toggleghostvisibility [bool]";
+ public override string Command => "toggleghostvisibility";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var ghostSystem = _entSysMan.GetEntitySystem<GhostSystem>();
-
if (args.Length != 0 && bool.TryParse(args[0], out var visibility))
- {
- ghostSystem.ToggleGhostVisibility(visibility);
- }
+ _ghost.ToggleGhostVisibility(visibility);
else
- {
- ghostSystem.ToggleGhostVisibility();
- }
+ _ghost.ToggleGhostVisibility();
}
}
namespace Content.Client.Ghost;
-public sealed class GhostToggleSelfVisibility : IConsoleCommand
+public sealed class GhostToggleSelfVisibility : LocalizedEntityCommands
{
- public string Command => "toggleselfghost";
- public string Description => "Toggles seeing your own ghost.";
- public string Help => "toggleselfghost";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ [Dependency] private readonly SpriteSystem _sprite = default!;
+
+ public override string Command => "toggleselfghost";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var attachedEntity = shell.Player?.AttachedEntity;
if (!attachedEntity.HasValue)
return;
- var entityManager = IoCManager.Resolve<IEntityManager>();
- if (!entityManager.HasComponent<GhostComponent>(attachedEntity))
+ if (!EntityManager.HasComponent<GhostComponent>(attachedEntity))
{
- shell.WriteError("Entity must be a ghost.");
+ shell.WriteError(Loc.GetString($"cmd-toggleselfghost-must-be-ghost"));
return;
}
- if (!entityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
+ if (!EntityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
return;
- var spriteSys = entityManager.System<SpriteSystem>();
- spriteSys.SetVisible((attachedEntity.Value, spriteComponent), !spriteComponent.Visible);
+ _sprite.SetVisible((attachedEntity.Value, spriteComponent), !spriteComponent.Visible);
}
}
namespace Content.Client.NPC;
-public sealed class ShowHTNCommand : IConsoleCommand
+public sealed class ShowHtnCommand : LocalizedEntityCommands
{
- public string Command => "showhtn";
- public string Description => "Shows the current status for HTN NPCs";
- public string Help => $"{Command}";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ [Dependency] private readonly HTNSystem _htnSystem = default!;
+
+ public override string Command => "showhtn";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var npcs = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<HTNSystem>();
- npcs.EnableOverlay ^= true;
+ _htnSystem.EnableOverlay ^= true;
}
}
}
}
-public sealed class ClearAllNetworkLinkOverlays : IConsoleCommand
+public sealed class ClearAllNetworkLinkOverlays : LocalizedEntityCommands
{
- [Dependency] private readonly IEntityManager _e = default!;
+ [Dependency] private readonly NetworkConfiguratorSystem _network = default!;
- public string Command => "clearnetworklinkoverlays";
- public string Description => "Clear all network link overlays.";
- public string Help => Command;
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override string Command => "clearnetworklinkoverlays";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- _e.System<NetworkConfiguratorSystem>().ClearAllOverlays();
+ _network.ClearAllOverlays();
}
}
using Content.Client.Administration.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
namespace Content.Client.NodeContainer
{
- public sealed class NodeVisCommand : IConsoleCommand
+ public sealed class NodeVisCommand : LocalizedEntityCommands
{
- [Dependency] private readonly IEntityManager _e = default!;
+ [Dependency] private readonly IClientAdminManager _adminManager = default!;
+ [Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
- public string Command => "nodevis";
- public string Description => "Toggles node group visualization";
- public string Help => "";
+ public override string Command => "nodevis";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var adminMan = IoCManager.Resolve<IClientAdminManager>();
- if (!adminMan.HasFlag(AdminFlags.Debug))
+ if (!_adminManager.HasFlag(AdminFlags.Debug))
{
- shell.WriteError("You need +DEBUG for this command");
+ shell.WriteError(Loc.GetString($"shell-missing-required-permission", ("perm", "+DEBUG")));
return;
}
- var sys = _e.System<NodeGroupSystem>();
- sys.SetVisEnabled(!sys.VisEnabled);
+ _nodeSystem.SetVisEnabled(!_nodeSystem.VisEnabled);
}
}
- public sealed class NodeVisFilterCommand : IConsoleCommand
+ public sealed class NodeVisFilterCommand : LocalizedEntityCommands
{
- [Dependency] private readonly IEntityManager _e = default!;
+ [Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
- public string Command => "nodevisfilter";
- public string Description => "Toggles showing a specific group on nodevis";
- public string Help => "Usage: nodevis [filter]\nOmit filter to list currently masked-off";
+ public override string Command => "nodevisfilter";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var sys = _e.System<NodeGroupSystem>();
-
if (args.Length == 0)
{
- foreach (var filtered in sys.Filtered)
+ foreach (var filtered in _nodeSystem.Filtered)
{
shell.WriteLine(filtered);
}
else
{
var filter = args[0];
- if (!sys.Filtered.Add(filter))
- {
- sys.Filtered.Remove(filter);
- }
+ if (!_nodeSystem.Filtered.Add(filter))
+ _nodeSystem.Filtered.Remove(filter);
}
}
}
}
[UsedImplicitly, AnyCommand]
- public sealed class VoteMenuCommand : IConsoleCommand
+ public sealed class VoteMenuCommand : LocalizedCommands
{
- public string Command => "votemenu";
- public string Description => Loc.GetString("ui-vote-menu-command-description");
- public string Help => Loc.GetString("ui-vote-menu-command-help-text");
+ public override string Command => "votemenu";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
new VoteCallMenu().OpenCentered();
}
using Content.Client.Weapons.Ranged.Systems;
using Robust.Shared.Console;
-namespace Content.Client.Weapons.Ranged;
+namespace Content.Client.Weapons.Ranged.Commands;
-public sealed class ShowSpreadCommand : IConsoleCommand
+public sealed class ShowSpreadCommand : LocalizedEntityCommands
{
- public string Command => "showgunspread";
- public string Description => $"Shows gun spread overlay for debugging";
- public string Help => $"{Command}";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ [Dependency] private readonly GunSystem _gunSystem = default!;
+
+ public override string Command => "showgunspread";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
- var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GunSystem>();
- system.SpreadOverlay ^= true;
+ _gunSystem.SpreadOverlay ^= true;
- shell.WriteLine($"Set spread overlay to {system.SpreadOverlay}");
+ shell.WriteLine(Loc.GetString($"cmd-showgunspread-status", ("status", _gunSystem.SpreadOverlay)));
}
}
changelog-tab-title-Changelog = Changelog
changelog-tab-title-Admin = Admin
changelog-tab-title-Maps = Maps
+
+cmd-changelog-desc = Opens the changelog.
+cmd-changelog-help = Usage: changelog
--- /dev/null
+cmd-toggleghostvisibility-desc = Toggles ghost visibility on the client.
+cmd-toggleghostvisibility-help = Usage: toggleghostvisibility [bool]
+
+cmd-toggleselfghost-desc = Toggles seeing your own ghost.
+cmd-toggleselfghost-help = Usage: toggleselfghost
+cmd-toggleselfghost-must-be-ghost = Entity must be a ghost.
--- /dev/null
+cmd-nodevis-desc = Toggles node group visualization.
+cmd-nodevis-help = Usage: nodevis
+
+cmd-nodevisfilter-desc = Toggles showing a specific group on nodevis.
+cmd-nodevisfilter-help = Usage: nodevisfilter [filter]
+ Omit filter to list currently masked-off
--- /dev/null
+cmd-showambient-desc = Shows all AmbientSoundComponents in the viewport.
+cmd-showambient-help = Usage: showambient
+cmd-showambient-status = Ambient sound overlay set to {$status}.
--- /dev/null
+cmd-showgunspread-desc = Shows gun spread overlay for debugging.
+cmd-showgunspreade-help = Usage: showgunspread
+cmd-showgunspread-status = Set spread overlay to {$status}.
--- /dev/null
+cmd-showhtn-desc = Shows the current status for HTN NPCs.
+cmd-showhtn-help = Usage: showhtn
--- /dev/null
+cmd-toggledecals-desc = Toggles decal overlay.
+cmd-toggledecals-help = Usage: toggledecals
# item status
network-configurator-item-status-label = Mode: {$mode}
Switch: {$keybinding}
+
+# command
+cmd-clearnetworklinkoverlays-desc = Clear all network link overlays.
+cmd-clearnetworklinkoverlays-help = Usage: clearnetworklinkoverlays
## Guards
+shell-missing-required-permission = You need {$perm} for this command!
shell-entity-is-not-mob = Target entity is not a mob!
shell-invalid-entity-id = Invalid entity ID.
shell-invalid-grid-id = Invalid grid ID.
## Vote menu command
-ui-vote-menu-command-description = Opens the voting menu
-ui-vote-menu-command-help-text = Usage: votemenu
+cmd-votemenu-desc = Opens the voting menu.
+cmd-votemenu-help = Usage: votemenu