Files
ss14-wl/Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs
Pieter-Jan BriersandGitHub 5168b5f3d4 IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

38 lines
1.1 KiB
C#

using Content.Server.Administration.Notes;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands;
[AnyCommand]
public sealed partial class OpenUserVisibleNotesCommand : IConsoleCommand
{
[Dependency] private IConfigurationManager _configuration = default!;
[Dependency] private IAdminNotesManager _notes = default!;
public const string CommandName = "adminremarks";
public string Command => CommandName;
public string Description => Loc.GetString("admin-remarks-command-description");
public string Help => $"Usage: {Command}";
public async void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (!_configuration.GetCVar(CCVars.SeeOwnNotes))
{
shell.WriteError(Loc.GetString("admin-remarks-command-error"));
return;
}
if (shell.Player is not { } player)
{
shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
return;
}
await _notes.OpenUserNotesEui(player);
}
}