Files
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

64 lines
1.9 KiB
C#

using Content.Server.Administration;
using Content.Shared.Administration;
using Content.Shared.FeedbackSystem;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Toolshed;
namespace Content.Server.FeedbackSystem;
/// <summary>
/// Adds, removes, and displays feedback for specified sessions.
/// </summary>
[ToolshedCommand]
[AdminCommand(AdminFlags.Debug)]
public sealed partial class FeedbackCommand : ToolshedCommand
{
[Dependency] private ISharedFeedbackManager _feedback = null!;
[CommandImplementation("show")]
public void ExecuteShow([CommandArgument] ICommonSession session)
{
_feedback.OpenForSession(session);
}
[CommandImplementation("show")]
public void ExecuteShow([PipedArgument] IEnumerable<ICommonSession> sessions)
{
foreach (var session in sessions)
{
_feedback.OpenForSession(session);
}
}
[CommandImplementation("add")]
public void ExecuteAdd([CommandArgument] ICommonSession session, ProtoId<FeedbackPopupPrototype> protoId)
{
_feedback.SendToSession(session, [protoId]);
}
[CommandImplementation("add")]
public void ExecuteAdd([PipedArgument] IEnumerable<ICommonSession> sessions, ProtoId<FeedbackPopupPrototype> protoId)
{
foreach (var session in sessions)
{
_feedback.SendToSession(session, [protoId]);
}
}
[CommandImplementation("remove")]
public void ExecuteRemove([CommandArgument] ICommonSession session, ProtoId<FeedbackPopupPrototype> protoId)
{
_feedback.SendToSession(session, [protoId], true);
}
[CommandImplementation("remove")]
public void ExecuteRemove([PipedArgument] IEnumerable<ICommonSession> sessions, ProtoId<FeedbackPopupPrototype> protoId)
{
foreach (var session in sessions)
{
_feedback.SendToSession(session, [protoId], true);
}
}
}