mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-15 14:52:26 +02:00
* 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
64 lines
1.9 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|