using Content.Client.Actions; using Content.Client.Mapping; using Content.Shared.Administration; using Robust.Shared.Console; namespace Content.Client.Commands; // Disabled until sandoxing issues are resolved. In the meantime, if you want to create an acttions preset, just disable // sandboxing and uncomment this code (and the SaveActionAssignments() function). /* [AnyCommand] 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} "; public void Execute(IConsoleShell shell, string argStr, string[] args) { if (args.Length != 1) { shell.WriteLine(Help); return; } try { EntitySystem.Get().SaveActionAssignments(args[0]); } catch { shell.WriteLine("Failed to save action assignments"); } } } */ [AnyCommand] public sealed class LoadActionsCommand : LocalizedCommands { [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; public override string Command => "loadacts"; public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command)); public override void Execute(IConsoleShell shell, string argStr, string[] args) { if (args.Length != 1) { shell.WriteLine(Help); return; } try { _entitySystemManager.GetEntitySystem().LoadActionAssignments(args[0], true); } catch { shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error")); } } } [AnyCommand] public sealed class LoadMappingActionsCommand : LocalizedCommands { [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; public const string CommandName = "loadmapacts"; 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) { try { _entitySystemManager.GetEntitySystem().LoadMappingActions(); } catch { shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error")); } } }