2019-03-21 18:03:05 +01:00
|
|
|
using Content.Client.Interfaces;
|
2019-03-17 15:52:27 +01:00
|
|
|
using Content.Shared.GameObjects.Components.Markers;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Client.Interfaces.Console;
|
|
|
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
|
|
|
|
using Robust.Shared.IoC;
|
2019-03-17 15:52:27 +01:00
|
|
|
|
|
|
|
|
namespace Content.Client.Commands
|
|
|
|
|
{
|
|
|
|
|
internal sealed class ShowMarkersCommand : IConsoleCommand
|
|
|
|
|
{
|
|
|
|
|
// ReSharper disable once StringLiteralTypo
|
|
|
|
|
public string Command => "togglemarkers";
|
|
|
|
|
public string Description => "Toggles visibility of markers such as spawn points.";
|
|
|
|
|
public string Help => "";
|
|
|
|
|
|
|
|
|
|
public bool Execute(IDebugConsole console, params string[] args)
|
|
|
|
|
{
|
|
|
|
|
bool? whichToSet = null;
|
|
|
|
|
foreach (var entity in IoCManager.Resolve<IEntityManager>()
|
|
|
|
|
.GetEntities(new TypeEntityQuery(typeof(SharedSpawnPointComponent))))
|
|
|
|
|
{
|
|
|
|
|
if (!entity.TryGetComponent(out ISpriteComponent sprite))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!whichToSet.HasValue)
|
|
|
|
|
{
|
|
|
|
|
whichToSet = !sprite.Visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sprite.Visible = whichToSet.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-03-21 18:03:05 +01:00
|
|
|
|
|
|
|
|
internal sealed class NotifyCommand : IConsoleCommand
|
|
|
|
|
{
|
|
|
|
|
public string Command => "notify";
|
|
|
|
|
public string Description => "Send a notify client side.";
|
|
|
|
|
public string Help => "notify <message>";
|
|
|
|
|
|
|
|
|
|
public bool Execute(IDebugConsole console, params string[] args)
|
|
|
|
|
{
|
|
|
|
|
var message = args[0];
|
|
|
|
|
|
|
|
|
|
var notifyManager = IoCManager.Resolve<IClientNotifyManager>();
|
|
|
|
|
notifyManager.PopupMessage(message);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-03-17 15:52:27 +01:00
|
|
|
}
|