Improve marker visualization for mapping.
Command renamed to showmarkers. Actually permanent (so if you place markers with it active, you immediately see them).
This commit is contained in:
@@ -13,28 +13,14 @@ namespace Content.Client.Commands
|
||||
internal sealed class ShowMarkersCommand : IConsoleCommand
|
||||
{
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
public string Command => "togglemarkers";
|
||||
public string Command => "showmarkers";
|
||||
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;
|
||||
}
|
||||
EntitySystem.Get<MarkerSystem>()
|
||||
.MarkersVisible ^= true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user