Spawn point system.
Hey we can place spawn points on the map now instead of hardcoding them! Spawn points are simply invisible bare bones entities.
This commit is contained in:
39
Content.Client/Commands/DebugCommands.cs
Normal file
39
Content.Client/Commands/DebugCommands.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Content.Shared.GameObjects.Components.Markers;
|
||||
using SS14.Client.Interfaces.Console;
|
||||
using SS14.Client.Interfaces.GameObjects.Components;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Commands\DebugCommands.cs" />
|
||||
<Compile Include="EntryPoint.cs" />
|
||||
<Compile Include="GameObjects\Components\Actor\CharacterInterface.cs" />
|
||||
<Compile Include="GameObjects\Components\DamageableComponent.cs" />
|
||||
|
||||
@@ -26,6 +26,7 @@ using SS14.Shared.IoC;
|
||||
using SS14.Shared.Prototypes;
|
||||
using System;
|
||||
using Content.Client.UserInterface;
|
||||
using Content.Shared.GameObjects.Components.Markers;
|
||||
using SS14.Client.Interfaces.UserInterface;
|
||||
using SS14.Shared.Log;
|
||||
|
||||
@@ -97,6 +98,8 @@ namespace Content.Client
|
||||
|
||||
factory.RegisterIgnore("PowerCell");
|
||||
|
||||
factory.Register<SharedSpawnPointComponent>();
|
||||
|
||||
IoCManager.Register<IClientNotifyManager, ClientNotifyManager>();
|
||||
IoCManager.Register<ISharedNotifyManager, ClientNotifyManager>();
|
||||
IoCManager.Register<IClientGameTicker, ClientGameTicker>();
|
||||
|
||||
Reference in New Issue
Block a user