nukes more resolves
This commit is contained in:
@@ -18,6 +18,12 @@ namespace Content.Client.AI
|
||||
#if DEBUG
|
||||
public class ClientPathfindingDebugSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
|
||||
private PathfindingDebugMode _modes = PathfindingDebugMode.None;
|
||||
private float _routeDuration = 4.0f; // How long before we remove a route from the overlay
|
||||
private DebugPathfindingOverlay? _overlay;
|
||||
@@ -91,7 +97,7 @@ namespace Content.Client.AI
|
||||
}
|
||||
|
||||
var overlayManager = IoCManager.Resolve<IOverlayManager>();
|
||||
_overlay = new DebugPathfindingOverlay {Modes = _modes};
|
||||
_overlay = new DebugPathfindingOverlay(EntityManager, _eyeManager, _playerManager, _prototypeManager) {Modes = _modes};
|
||||
overlayManager.AddOverlay(_overlay);
|
||||
|
||||
return _overlay;
|
||||
@@ -210,12 +216,12 @@ namespace Content.Client.AI
|
||||
public readonly List<SharedAiDebug.AStarRouteMessage> AStarRoutes = new();
|
||||
public readonly List<SharedAiDebug.JpsRouteMessage> JpsRoutes = new();
|
||||
|
||||
public DebugPathfindingOverlay()
|
||||
public DebugPathfindingOverlay(IEntityManager entities, IEyeManager eyeManager, IPlayerManager playerManager, IPrototypeManager prototypeManager)
|
||||
{
|
||||
_shader = IoCManager.Resolve<IPrototypeManager>().Index<ShaderPrototype>("unshaded").Instance();
|
||||
_eyeManager = IoCManager.Resolve<IEyeManager>();
|
||||
_playerManager = IoCManager.Resolve<IPlayerManager>();
|
||||
_entities = IoCManager.Resolve<IEntityManager>();
|
||||
_entities = entities;
|
||||
_eyeManager = eyeManager;
|
||||
_playerManager = playerManager;
|
||||
_shader = prototypeManager.Index<ShaderPrototype>("unshaded").Instance();
|
||||
}
|
||||
|
||||
#region Graph
|
||||
|
||||
@@ -107,13 +107,12 @@ namespace Content.Client.CharacterAppearance.Systems
|
||||
// Scaffolding until Body is moved to ECS.
|
||||
private void BodyPartAdded(HumanoidAppearanceBodyPartAddedEvent args)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entityManager.TryGetComponent(args.Uid, out SpriteComponent? sprite))
|
||||
if (!EntityManager.TryGetComponent(args.Uid, out SpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entityManager.HasComponent<SpriteComponent>(args.Args.Part.Owner))
|
||||
if (!EntityManager.HasComponent<SpriteComponent>(args.Args.Part.Owner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Content.Client.Popups
|
||||
|
||||
public void PopupMessage(string message, ScreenCoordinates coordinates, EntityUid entity = default)
|
||||
{
|
||||
var label = new PopupLabel(_eyeManager)
|
||||
var label = new PopupLabel(_eyeManager, EntityManager)
|
||||
{
|
||||
Entity = entity,
|
||||
Text = message,
|
||||
@@ -142,14 +142,16 @@ namespace Content.Client.Popups
|
||||
private class PopupLabel : Label
|
||||
{
|
||||
private readonly IEyeManager _eyeManager;
|
||||
private readonly IEntityManager _entityManager;
|
||||
|
||||
public float TimeLeft { get; private set; }
|
||||
public Vector2 InitialPos { get; set; }
|
||||
public EntityUid Entity { get; set; }
|
||||
|
||||
public PopupLabel(IEyeManager eyeManager)
|
||||
public PopupLabel(IEyeManager eyeManager, IEntityManager entityManager)
|
||||
{
|
||||
_eyeManager = eyeManager;
|
||||
_entityManager = entityManager;
|
||||
ShadowOffsetXOverride = 1;
|
||||
ShadowOffsetYOverride = 1;
|
||||
FontColorShadowOverride = Color.Black;
|
||||
@@ -161,7 +163,7 @@ namespace Content.Client.Popups
|
||||
|
||||
var position = Entity == default
|
||||
? InitialPos
|
||||
: (_eyeManager.CoordinatesToScreen(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Entity).Coordinates).Position / UIScale) - DesiredSize / 2;
|
||||
: (_eyeManager.CoordinatesToScreen(_entityManager.GetComponent<TransformComponent>(Entity).Coordinates).Position / UIScale) - DesiredSize / 2;
|
||||
|
||||
LayoutContainer.SetPosition(this, position - (0, 20 * (TimeLeft * TimeLeft + TimeLeft)));
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Content.Server.Body.Systems
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Metabolism effect {effect.GetType().Name} of reagent {args.Reagent.Name:reagent} applied on entity {entity} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
$"Metabolism effect {effect.GetType().Name} of reagent {args.Reagent.Name:reagent} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
}
|
||||
|
||||
effect.Effect(args);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.CharacterAppearance.Systems
|
||||
{
|
||||
foreach (var (part, _) in body.Parts)
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(part.Owner, out SpriteComponent? sprite))
|
||||
if (EntityManager.TryGetComponent(part.Owner, out SpriteComponent? sprite))
|
||||
{
|
||||
sprite!.Color = component.Appearance.SkinColor;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.Containers
|
||||
{
|
||||
if (!EntityManager.TryGetComponent<IContainerManager>(uid, out var mComp))
|
||||
return;
|
||||
var baseCoords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates;
|
||||
var baseCoords = EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates;
|
||||
foreach (var v in component.Containers)
|
||||
{
|
||||
if (mComp.TryGetContainer(v, out var container))
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
private void OnInteractUsing(EntityUid uid, MatchboxComponent component, InteractUsingEvent args)
|
||||
{
|
||||
if (!args.Handled
|
||||
&& IoCManager.Resolve<IEntityManager>().TryGetComponent<MatchstickComponent?>(args.Used, out var matchstick)
|
||||
&& EntityManager.TryGetComponent<MatchstickComponent?>(args.Used, out var matchstick)
|
||||
&& matchstick.CurrentState == SmokableState.Unlit)
|
||||
{
|
||||
Get<MatchstickSystem>().Ignite(matchstick, args.User);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Movement
|
||||
|
||||
foreach (var stressTest in EntityManager.EntityQuery<StressTestMovementComponent>(true))
|
||||
{
|
||||
var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(stressTest.Owner);
|
||||
var transform = EntityManager.GetComponent<TransformComponent>(stressTest.Owner);
|
||||
|
||||
stressTest.Progress += frameTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user