SnapGridComponent Removal (#3884)
* Removed SnapGridOffset, there is only center now. * SnapGridComponent methods are now static. * Removed SnapGridComponent.OnPositionChanged. * Refactored static functions off SnapGridComponent to MapGrid. Refactored away usages of SnapGridComponent.Position. * Added Transform.Anchored for checking if an entity is a tile entity. More refactoring for static MapGrid functions. * Static snapgrid methods on MapGrid are no longer static. * Add setter to ITransformComponent.Anchored. Removed direct references to SnapGridComponent from content. * Grid functions now deal with EntityUids instead of SnapGridComponents. Began renaming public API functions from SnapGrid to Anchor. * Remove the SnapGridComponent 'Offset' field from all yaml files. This was removed in code previously, so the yaml linter was upset. * Update engine submodule to v0.4.46.
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Client.GameObjects.EntitySystems;
|
using Content.Client.GameObjects.EntitySystems;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
using static Robust.Client.GameObjects.SpriteComponent;
|
using static Robust.Client.GameObjects.SpriteComponent;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.Components.IconSmoothing
|
namespace Content.Client.GameObjects.Components.IconSmoothing
|
||||||
@@ -25,6 +27,8 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class IconSmoothComponent : Component
|
public class IconSmoothComponent : Component
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
[DataField("mode")]
|
[DataField("mode")]
|
||||||
private IconSmoothingMode _mode = IconSmoothingMode.Corners;
|
private IconSmoothingMode _mode = IconSmoothingMode.Corners;
|
||||||
|
|
||||||
@@ -32,8 +36,6 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
|
|
||||||
internal ISpriteComponent? Sprite { get; private set; }
|
internal ISpriteComponent? Sprite { get; private set; }
|
||||||
|
|
||||||
internal SnapGridComponent? SnapGrid { get; private set; }
|
|
||||||
|
|
||||||
private (GridId, Vector2i) _lastPosition;
|
private (GridId, Vector2i) _lastPosition;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -62,7 +64,6 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SnapGrid = Owner.GetComponent<SnapGridComponent>();
|
|
||||||
Sprite = Owner.GetComponent<ISpriteComponent>();
|
Sprite = Owner.GetComponent<ISpriteComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,15 +72,14 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
{
|
{
|
||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
if (SnapGrid != null)
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
SnapGrid.OnPositionChanged += SnapGridOnPositionChanged;
|
|
||||||
|
|
||||||
// ensures lastposition initial value is populated on spawn. Just calling
|
// ensures lastposition initial value is populated on spawn. Just calling
|
||||||
// the hook here would cause a dirty event to fire needlessly
|
// the hook here would cause a dirty event to fire needlessly
|
||||||
_lastPosition = (Owner.Transform.GridID, SnapGrid.Position);
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
_lastPosition = (Owner.Transform.GridID, grid.TileIndicesFor(Owner.Transform.Coordinates));
|
||||||
|
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner,null, SnapGrid.Offset, Mode));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, null, Mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Sprite != null && Mode == IconSmoothingMode.Corners)
|
if (Sprite != null && Mode == IconSmoothingMode.Corners)
|
||||||
@@ -115,20 +115,22 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
|
|
||||||
private void CalculateNewSpriteCardinal()
|
private void CalculateNewSpriteCardinal()
|
||||||
{
|
{
|
||||||
if (SnapGrid == null || Sprite == null)
|
if (!Owner.Transform.Anchored || Sprite == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dirs = CardinalConnectDirs.None;
|
var dirs = CardinalConnectDirs.None;
|
||||||
|
|
||||||
if (MatchingEntity(SnapGrid.GetInDir(Direction.North)))
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var position = Owner.Transform.Coordinates;
|
||||||
|
if (MatchingEntity(grid.GetInDir(position, Direction.North)))
|
||||||
dirs |= CardinalConnectDirs.North;
|
dirs |= CardinalConnectDirs.North;
|
||||||
if (MatchingEntity(SnapGrid.GetInDir(Direction.South)))
|
if (MatchingEntity(grid.GetInDir(position, Direction.South)))
|
||||||
dirs |= CardinalConnectDirs.South;
|
dirs |= CardinalConnectDirs.South;
|
||||||
if (MatchingEntity(SnapGrid.GetInDir(Direction.East)))
|
if (MatchingEntity(grid.GetInDir(position, Direction.East)))
|
||||||
dirs |= CardinalConnectDirs.East;
|
dirs |= CardinalConnectDirs.East;
|
||||||
if (MatchingEntity(SnapGrid.GetInDir(Direction.West)))
|
if (MatchingEntity(grid.GetInDir(position, Direction.West)))
|
||||||
dirs |= CardinalConnectDirs.West;
|
dirs |= CardinalConnectDirs.West;
|
||||||
|
|
||||||
Sprite.LayerSetState(0, $"{StateBase}{(int) dirs}");
|
Sprite.LayerSetState(0, $"{StateBase}{(int) dirs}");
|
||||||
@@ -151,19 +153,21 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
|
|
||||||
protected (CornerFill ne, CornerFill nw, CornerFill sw, CornerFill se) CalculateCornerFill()
|
protected (CornerFill ne, CornerFill nw, CornerFill sw, CornerFill se) CalculateCornerFill()
|
||||||
{
|
{
|
||||||
if (SnapGrid == null)
|
if (!Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
return (CornerFill.None, CornerFill.None, CornerFill.None, CornerFill.None);
|
return (CornerFill.None, CornerFill.None, CornerFill.None, CornerFill.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
var n = MatchingEntity(SnapGrid.GetInDir(Direction.North));
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
var ne = MatchingEntity(SnapGrid.GetInDir(Direction.NorthEast));
|
var position = Owner.Transform.Coordinates;
|
||||||
var e = MatchingEntity(SnapGrid.GetInDir(Direction.East));
|
var n = MatchingEntity(grid.GetInDir(position, Direction.North));
|
||||||
var se = MatchingEntity(SnapGrid.GetInDir(Direction.SouthEast));
|
var ne = MatchingEntity(grid.GetInDir(position, Direction.NorthEast));
|
||||||
var s = MatchingEntity(SnapGrid.GetInDir(Direction.South));
|
var e = MatchingEntity(grid.GetInDir(position, Direction.East));
|
||||||
var sw = MatchingEntity(SnapGrid.GetInDir(Direction.SouthWest));
|
var se = MatchingEntity(grid.GetInDir(position, Direction.SouthEast));
|
||||||
var w = MatchingEntity(SnapGrid.GetInDir(Direction.West));
|
var s = MatchingEntity(grid.GetInDir(position, Direction.South));
|
||||||
var nw = MatchingEntity(SnapGrid.GetInDir(Direction.NorthWest));
|
var sw = MatchingEntity(grid.GetInDir(position, Direction.SouthWest));
|
||||||
|
var w = MatchingEntity(grid.GetInDir(position, Direction.West));
|
||||||
|
var nw = MatchingEntity(grid.GetInDir(position, Direction.NorthWest));
|
||||||
|
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
var cornerNE = CornerFill.None;
|
var cornerNE = CornerFill.None;
|
||||||
@@ -234,28 +238,28 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
{
|
{
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|
||||||
if (SnapGrid != null)
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
SnapGrid.OnPositionChanged -= SnapGridOnPositionChanged;
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SnapGridOnPositionChanged()
|
public void SnapGridOnPositionChanged()
|
||||||
{
|
{
|
||||||
if (SnapGrid != null)
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
|
||||||
_lastPosition = (Owner.Transform.GridID, SnapGrid.Position);
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
_lastPosition = (Owner.Transform.GridID, grid.TileIndicesFor(Owner.Transform.Coordinates));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.Contracts.Pure]
|
[System.Diagnostics.Contracts.Pure]
|
||||||
protected bool MatchingEntity(IEnumerable<IEntity> candidates)
|
protected bool MatchingEntity(IEnumerable<EntityUid> candidates)
|
||||||
{
|
{
|
||||||
foreach (var entity in candidates)
|
foreach (var entity in candidates)
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent(out IconSmoothComponent? other))
|
if (!Owner.EntityManager.ComponentManager.TryGetComponent(entity, out IconSmoothComponent? other))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Diagnostics.Contracts;
|
using System.Diagnostics.Contracts;
|
||||||
using Content.Client.GameObjects.Components.IconSmoothing;
|
using Content.Client.GameObjects.Components.IconSmoothing;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using static Robust.Client.GameObjects.SpriteComponent;
|
using static Robust.Client.GameObjects.SpriteComponent;
|
||||||
|
|
||||||
@@ -23,6 +26,8 @@ namespace Content.Client.GameObjects.Components
|
|||||||
{
|
{
|
||||||
public override string Name => "LowWall";
|
public override string Name => "LowWall";
|
||||||
|
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
public CornerFill LastCornerNE { get; private set; }
|
public CornerFill LastCornerNE { get; private set; }
|
||||||
public CornerFill LastCornerSE { get; private set; }
|
public CornerFill LastCornerSE { get; private set; }
|
||||||
public CornerFill LastCornerSW { get; private set; }
|
public CornerFill LastCornerSW { get; private set; }
|
||||||
@@ -65,19 +70,22 @@ namespace Content.Client.GameObjects.Components
|
|||||||
{
|
{
|
||||||
base.CalculateNewSprite();
|
base.CalculateNewSprite();
|
||||||
|
|
||||||
if (Sprite == null || SnapGrid == null || _overlaySprite == null)
|
if (Sprite == null || !Owner.Transform.Anchored || _overlaySprite == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var (n, nl) = MatchingWall(SnapGrid.GetInDir(Direction.North));
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
var (ne, nel) = MatchingWall(SnapGrid.GetInDir(Direction.NorthEast));
|
var coords = Owner.Transform.Coordinates;
|
||||||
var (e, el) = MatchingWall(SnapGrid.GetInDir(Direction.East));
|
|
||||||
var (se, sel) = MatchingWall(SnapGrid.GetInDir(Direction.SouthEast));
|
var (n, nl) = MatchingWall(grid.GetInDir(coords, Direction.North));
|
||||||
var (s, sl) = MatchingWall(SnapGrid.GetInDir(Direction.South));
|
var (ne, nel) = MatchingWall(grid.GetInDir(coords, Direction.NorthEast));
|
||||||
var (sw, swl) = MatchingWall(SnapGrid.GetInDir(Direction.SouthWest));
|
var (e, el) = MatchingWall(grid.GetInDir(coords, Direction.East));
|
||||||
var (w, wl) = MatchingWall(SnapGrid.GetInDir(Direction.West));
|
var (se, sel) = MatchingWall(grid.GetInDir(coords, Direction.SouthEast));
|
||||||
var (nw, nwl) = MatchingWall(SnapGrid.GetInDir(Direction.NorthWest));
|
var (s, sl) = MatchingWall(grid.GetInDir(coords, Direction.South));
|
||||||
|
var (sw, swl) = MatchingWall(grid.GetInDir(coords, Direction.SouthWest));
|
||||||
|
var (w, wl) = MatchingWall(grid.GetInDir(coords, Direction.West));
|
||||||
|
var (nw, nwl) = MatchingWall(grid.GetInDir(coords, Direction.NorthWest));
|
||||||
|
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
var cornerNE = CornerFill.None;
|
var cornerNE = CornerFill.None;
|
||||||
@@ -194,9 +202,9 @@ namespace Content.Client.GameObjects.Components
|
|||||||
LastCornerSW = cornerSW;
|
LastCornerSW = cornerSW;
|
||||||
LastCornerNW = cornerNW;
|
LastCornerNW = cornerNW;
|
||||||
|
|
||||||
foreach (var entity in SnapGrid.GetLocal())
|
foreach (var entity in grid.GetLocal(coords))
|
||||||
{
|
{
|
||||||
if (entity.TryGetComponent(out WindowComponent? window))
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(entity, out WindowComponent? window))
|
||||||
{
|
{
|
||||||
window.UpdateSprite();
|
window.UpdateSprite();
|
||||||
}
|
}
|
||||||
@@ -204,11 +212,11 @@ namespace Content.Client.GameObjects.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Pure]
|
[Pure]
|
||||||
private (bool connected, bool lowWall) MatchingWall(IEnumerable<IEntity> candidates)
|
private (bool connected, bool lowWall) MatchingWall(IEnumerable<EntityUid> candidates)
|
||||||
{
|
{
|
||||||
foreach (var entity in candidates)
|
foreach (var entity in candidates)
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent(out IconSmoothComponent? other))
|
if (!Owner.EntityManager.ComponentManager.TryGetComponent(entity, out IconSmoothComponent? other))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Client.GameObjects.EntitySystems;
|
using Content.Client.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using static Content.Client.GameObjects.Components.IconSmoothing.IconSmoothComponent;
|
using static Content.Client.GameObjects.Components.IconSmoothing.IconSmoothComponent;
|
||||||
|
|
||||||
@@ -12,18 +15,18 @@ namespace Content.Client.GameObjects.Components
|
|||||||
[ComponentReference(typeof(SharedWindowComponent))]
|
[ComponentReference(typeof(SharedWindowComponent))]
|
||||||
public sealed class WindowComponent : SharedWindowComponent
|
public sealed class WindowComponent : SharedWindowComponent
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
[DataField("base")]
|
[DataField("base")]
|
||||||
private string? _stateBase;
|
private string? _stateBase;
|
||||||
|
|
||||||
private ISpriteComponent? _sprite;
|
private ISpriteComponent? _sprite;
|
||||||
private SnapGridComponent? _snapGrid;
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
_sprite = Owner.GetComponent<ISpriteComponent>();
|
_sprite = Owner.GetComponent<ISpriteComponent>();
|
||||||
_snapGrid = Owner.GetComponent<SnapGridComponent>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -31,11 +34,6 @@ namespace Content.Client.GameObjects.Components
|
|||||||
{
|
{
|
||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
if (_snapGrid != null)
|
|
||||||
{
|
|
||||||
_snapGrid.OnPositionChanged += SnapGridOnPositionChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
||||||
|
|
||||||
if (_sprite != null)
|
if (_sprite != null)
|
||||||
@@ -67,18 +65,7 @@ namespace Content.Client.GameObjects.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
public void SnapGridOnPositionChanged()
|
||||||
protected override void Shutdown()
|
|
||||||
{
|
|
||||||
if (_snapGrid != null)
|
|
||||||
{
|
|
||||||
_snapGrid.OnPositionChanged -= SnapGridOnPositionChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SnapGridOnPositionChanged()
|
|
||||||
{
|
{
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
||||||
}
|
}
|
||||||
@@ -102,14 +89,14 @@ namespace Content.Client.GameObjects.Components
|
|||||||
|
|
||||||
private LowWallComponent? FindLowWall()
|
private LowWallComponent? FindLowWall()
|
||||||
{
|
{
|
||||||
if (_snapGrid == null)
|
if (!Owner.Transform.Anchored)
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var entity in _snapGrid.GetLocal())
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
foreach (var entity in grid.GetLocal(coords))
|
||||||
{
|
{
|
||||||
if (entity.TryGetComponent(out LowWallComponent? lowWall))
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(entity, out LowWallComponent? lowWall))
|
||||||
{
|
{
|
||||||
return lowWall;
|
return lowWall;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.Components
|
namespace Content.Client.GameObjects.Components
|
||||||
{
|
{
|
||||||
@@ -15,10 +17,10 @@ namespace Content.Client.GameObjects.Components
|
|||||||
base.OnChangeData(component);
|
base.OnChangeData(component);
|
||||||
|
|
||||||
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
||||||
if (!component.Owner.TryGetComponent(out SnapGridComponent? snapGrid))
|
if (!component.Owner.Transform.Anchored)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var lowWall = FindLowWall(snapGrid);
|
var lowWall = FindLowWall(IoCManager.Resolve<IMapManager>(), component.Owner.Transform);
|
||||||
if (lowWall == null)
|
if (lowWall == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -48,11 +50,13 @@ namespace Content.Client.GameObjects.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LowWallComponent? FindLowWall(SnapGridComponent snapGrid)
|
private static LowWallComponent? FindLowWall(IMapManager mapManager, ITransformComponent transform)
|
||||||
{
|
{
|
||||||
foreach (var entity in snapGrid.GetLocal())
|
var grid = mapManager.GetGrid(transform.GridID);
|
||||||
|
var coords = transform.Coordinates;
|
||||||
|
foreach (var entity in grid.GetLocal(coords))
|
||||||
{
|
{
|
||||||
if (entity.TryGetComponent(out LowWallComponent? lowWall))
|
if (transform.Owner.EntityManager.ComponentManager.TryGetComponent(entity, out LowWallComponent? lowWall))
|
||||||
{
|
{
|
||||||
return lowWall;
|
return lowWall;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Client.GameObjects.Components.IconSmoothing;
|
using Content.Client.GameObjects.Components.IconSmoothing;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -6,6 +6,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.EntitySystems
|
namespace Content.Client.GameObjects.EntitySystems
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private readonly Queue<IEntity> _dirtyEntities = new();
|
private readonly Queue<EntityUid> _dirtyEntities = new();
|
||||||
|
|
||||||
private int _generation;
|
private int _generation;
|
||||||
|
|
||||||
@@ -27,13 +28,18 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<IconSmoothDirtyEvent>(HandleDirtyEvent);
|
SubscribeLocalEvent<IconSmoothDirtyEvent>(HandleDirtyEvent);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<IconSmoothComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|
||||||
UnsubscribeLocalEvent<IconSmoothDirtyEvent>();
|
UnsubscribeLocalEvent<IconSmoothDirtyEvent>();
|
||||||
|
|
||||||
|
UnsubscribeLocalEvent<IconSmoothComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void FrameUpdate(float frameTime)
|
public override void FrameUpdate(float frameTime)
|
||||||
@@ -63,20 +69,20 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
senderEnt.TryGetComponent(out IconSmoothComponent? iconSmooth)
|
senderEnt.TryGetComponent(out IconSmoothComponent? iconSmooth)
|
||||||
&& iconSmooth.Running)
|
&& iconSmooth.Running)
|
||||||
{
|
{
|
||||||
var snapGrid = senderEnt.GetComponent<SnapGridComponent>();
|
var grid1 = _mapManager.GetGrid(senderEnt.Transform.GridID);
|
||||||
|
var coords = senderEnt.Transform.Coordinates;
|
||||||
|
|
||||||
_dirtyEntities.Enqueue(senderEnt);
|
_dirtyEntities.Enqueue(senderEnt.Uid);
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.North));
|
AddValidEntities(grid1.GetInDir(coords, Direction.North));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.South));
|
AddValidEntities(grid1.GetInDir(coords, Direction.South));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.East));
|
AddValidEntities(grid1.GetInDir(coords, Direction.East));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.West));
|
AddValidEntities(grid1.GetInDir(coords, Direction.West));
|
||||||
if (ev.Mode == IconSmoothingMode.Corners)
|
if (ev.Mode == IconSmoothingMode.Corners)
|
||||||
{
|
{
|
||||||
|
AddValidEntities(grid1.GetInDir(coords, Direction.NorthEast));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.NorthEast));
|
AddValidEntities(grid1.GetInDir(coords, Direction.SouthEast));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.SouthEast));
|
AddValidEntities(grid1.GetInDir(coords, Direction.SouthWest));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.SouthWest));
|
AddValidEntities(grid1.GetInDir(coords, Direction.NorthWest));
|
||||||
AddValidEntities(snapGrid.GetInDir(Direction.NorthWest));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,43 +91,43 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
var pos = ev.LastPosition.Value.pos;
|
var pos = ev.LastPosition.Value.pos;
|
||||||
|
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(1, 0), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(1, 0)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(-1, 0), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(-1, 0)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(0, 1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(0, 1)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(0, -1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(0, -1)));
|
||||||
if (ev.Mode == IconSmoothingMode.Corners)
|
if (ev.Mode == IconSmoothingMode.Corners)
|
||||||
{
|
{
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(1, 1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(1, 1)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(-1, -1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(-1, -1)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(-1, 1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(-1, 1)));
|
||||||
AddValidEntities(grid.GetSnapGridCell(pos + new Vector2i(1, -1), ev.Offset));
|
AddValidEntities(grid.GetAnchoredEntities(pos + new Vector2i(1, -1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddValidEntities(IEnumerable<IEntity> candidates)
|
private static void HandleSnapGridMove(EntityUid uid, IconSmoothComponent component, SnapGridPositionChangedEvent args)
|
||||||
|
{
|
||||||
|
component.SnapGridOnPositionChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddValidEntities(IEnumerable<EntityUid> candidates)
|
||||||
{
|
{
|
||||||
foreach (var entity in candidates)
|
foreach (var entity in candidates)
|
||||||
{
|
{
|
||||||
if (entity.HasComponent<IconSmoothComponent>())
|
if (ComponentManager.HasComponent<IconSmoothComponent>(entity))
|
||||||
{
|
{
|
||||||
_dirtyEntities.Enqueue(entity);
|
_dirtyEntities.Enqueue(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddValidEntities(IEnumerable<IComponent> candidates)
|
private void CalculateNewSprite(EntityUid euid)
|
||||||
{
|
|
||||||
AddValidEntities(candidates.Select(c => c.Owner));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CalculateNewSprite(IEntity entity)
|
|
||||||
{
|
{
|
||||||
// The generation check prevents updating an entity multiple times per tick.
|
// The generation check prevents updating an entity multiple times per tick.
|
||||||
// As it stands now, it's totally possible for something to get queued twice.
|
// As it stands now, it's totally possible for something to get queued twice.
|
||||||
// Generation on the component is set after an update so we can cull updates that happened this generation.
|
// Generation on the component is set after an update so we can cull updates that happened this generation.
|
||||||
if (!entity.IsValid()
|
if (!EntityManager.EntityExists(euid)
|
||||||
|| !entity.TryGetComponent(out IconSmoothComponent? smoothing)
|
|| !ComponentManager.TryGetComponent(euid, out IconSmoothComponent? smoothing)
|
||||||
|| smoothing.UpdateGeneration == _generation)
|
|| smoothing.UpdateGeneration == _generation)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -138,16 +144,14 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class IconSmoothDirtyEvent : EntityEventArgs
|
public sealed class IconSmoothDirtyEvent : EntityEventArgs
|
||||||
{
|
{
|
||||||
public IconSmoothDirtyEvent(IEntity sender, (GridId grid, Vector2i pos)? lastPosition, SnapGridOffset offset, IconSmoothingMode mode)
|
public IconSmoothDirtyEvent(IEntity sender, (GridId grid, Vector2i pos)? lastPosition, IconSmoothingMode mode)
|
||||||
{
|
{
|
||||||
LastPosition = lastPosition;
|
LastPosition = lastPosition;
|
||||||
Offset = offset;
|
|
||||||
Mode = mode;
|
Mode = mode;
|
||||||
Sender = sender;
|
Sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public (GridId grid, Vector2i pos)? LastPosition { get; }
|
public (GridId grid, Vector2i pos)? LastPosition { get; }
|
||||||
public SnapGridOffset Offset { get; }
|
|
||||||
public IconSmoothingMode Mode { get; }
|
public IconSmoothingMode Mode { get; }
|
||||||
public IEntity Sender { get; }
|
public IEntity Sender { get; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Client.GameObjects.Components;
|
using Content.Client.GameObjects.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -15,6 +15,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<WindowSmoothDirtyEvent>(HandleDirtyEvent);
|
SubscribeLocalEvent<WindowSmoothDirtyEvent>(HandleDirtyEvent);
|
||||||
|
SubscribeLocalEvent<WindowComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
@@ -22,6 +23,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|
||||||
UnsubscribeLocalEvent<WindowSmoothDirtyEvent>();
|
UnsubscribeLocalEvent<WindowSmoothDirtyEvent>();
|
||||||
|
UnsubscribeLocalEvent<WindowComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
|
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
|
||||||
@@ -32,6 +34,11 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void HandleSnapGridMove(EntityUid uid, WindowComponent component, SnapGridPositionChangedEvent args)
|
||||||
|
{
|
||||||
|
component.SnapGridOnPositionChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public override void FrameUpdate(float frameTime)
|
public override void FrameUpdate(float frameTime)
|
||||||
{
|
{
|
||||||
base.FrameUpdate(frameTime);
|
base.FrameUpdate(frameTime);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Content.Server.Commands.GameTicking
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!childEntity.TryGetComponent(out SnapGridComponent? snapGrid))
|
if (!childEntity.Transform.Anchored)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ using Content.Server.Utility;
|
|||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using YamlDotNet.Serialization;
|
|
||||||
|
|
||||||
namespace Content.Server.Construction.Completions
|
namespace Content.Server.Construction.Completions
|
||||||
{
|
{
|
||||||
@@ -15,14 +13,13 @@ namespace Content.Server.Construction.Completions
|
|||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public class SnapToGrid : IGraphAction
|
public class SnapToGrid : IGraphAction
|
||||||
{
|
{
|
||||||
[DataField("offset")] public SnapGridOffset Offset { get; private set; } = SnapGridOffset.Center;
|
|
||||||
[DataField("southRotation")] public bool SouthRotation { get; private set; } = false;
|
[DataField("southRotation")] public bool SouthRotation { get; private set; } = false;
|
||||||
|
|
||||||
public async Task PerformAction(IEntity entity, IEntity? user)
|
public async Task PerformAction(IEntity entity, IEntity? user)
|
||||||
{
|
{
|
||||||
if (entity.Deleted) return;
|
if (entity.Deleted) return;
|
||||||
|
|
||||||
entity.SnapToGrid(Offset);
|
entity.SnapToGrid();
|
||||||
if (SouthRotation)
|
if (SouthRotation)
|
||||||
{
|
{
|
||||||
entity.Transform.LocalRotation = Angle.Zero;
|
entity.Transform.LocalRotation = Angle.Zero;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ using Content.Shared.Interfaces.GameObjects.Components;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components
|
namespace Content.Server.GameObjects.Components
|
||||||
@@ -105,7 +104,7 @@ namespace Content.Server.GameObjects.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Snap)
|
if (Snap)
|
||||||
Owner.SnapToGrid(SnapGridOffset.Center, Owner.EntityManager);
|
Owner.SnapToGrid(Owner.EntityManager);
|
||||||
|
|
||||||
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new AnchoredMessage(), false);
|
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new AnchoredMessage(), false);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using Content.Server.GameObjects.EntitySystems;
|
|||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
@@ -14,6 +16,8 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class AirtightComponent : Component, IMapInit
|
public class AirtightComponent : Component, IMapInit
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private (GridId, Vector2i) _lastPosition;
|
private (GridId, Vector2i) _lastPosition;
|
||||||
private AtmosphereSystem _atmosphereSystem = default!;
|
private AtmosphereSystem _atmosphereSystem = default!;
|
||||||
|
|
||||||
@@ -77,14 +81,13 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
_atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
_atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||||
|
|
||||||
// Using the SnapGrid is critical for performance, and thus if it is absent the component
|
|
||||||
// will not be airtight. A warning is much easier to track down than the object magically
|
|
||||||
// not being airtight, so log one if the SnapGrid component is missing.
|
|
||||||
Owner.EnsureComponentWarn(out SnapGridComponent _);
|
|
||||||
|
|
||||||
if (_fixAirBlockedDirectionInitialize)
|
if (_fixAirBlockedDirectionInitialize)
|
||||||
RotateEvent(new RotateEvent(Owner, Angle.Zero, Owner.Transform.WorldRotation));
|
RotateEvent(new RotateEvent(Owner, Angle.Zero, Owner.Transform.WorldRotation));
|
||||||
|
|
||||||
|
// Adding this component will immediately anchor the entity, because the atmos system
|
||||||
|
// requires airtight entities to be anchored for performance.
|
||||||
|
Owner.Transform.Anchored = true;
|
||||||
|
|
||||||
UpdatePosition();
|
UpdatePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,28 +119,25 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
return newAirBlockedDirs;
|
return newAirBlockedDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public void MapInit()
|
public void MapInit()
|
||||||
{
|
{
|
||||||
if (Owner.TryGetComponent(out SnapGridComponent? snapGrid))
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
snapGrid.OnPositionChanged += OnTransformMove;
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
_lastPosition = (Owner.Transform.GridID, snapGrid.Position);
|
_lastPosition = (Owner.Transform.GridID, grid.TileIndicesFor(Owner.Transform.Coordinates));
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePosition();
|
UpdatePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
protected override void Shutdown()
|
protected override void Shutdown()
|
||||||
{
|
{
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|
||||||
_airBlocked = false;
|
_airBlocked = false;
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out SnapGridComponent? snapGrid))
|
|
||||||
{
|
|
||||||
snapGrid.OnPositionChanged -= OnTransformMove;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdatePosition(_lastPosition.Item1, _lastPosition.Item2);
|
UpdatePosition(_lastPosition.Item1, _lastPosition.Item2);
|
||||||
|
|
||||||
if (_fixVacuum)
|
if (_fixVacuum)
|
||||||
@@ -146,21 +146,25 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTransformMove()
|
public void OnTransformMove()
|
||||||
{
|
{
|
||||||
UpdatePosition(_lastPosition.Item1, _lastPosition.Item2);
|
UpdatePosition(_lastPosition.Item1, _lastPosition.Item2);
|
||||||
UpdatePosition();
|
UpdatePosition();
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out SnapGridComponent? snapGrid))
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
_lastPosition = (Owner.Transform.GridID, snapGrid.Position);
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
_lastPosition = (Owner.Transform.GridID, grid.TileIndicesFor(Owner.Transform.Coordinates));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePosition()
|
private void UpdatePosition()
|
||||||
{
|
{
|
||||||
if (Owner.TryGetComponent(out SnapGridComponent? snapGrid))
|
if (Owner.Transform.Anchored)
|
||||||
UpdatePosition(Owner.Transform.GridID, snapGrid.Position);
|
{
|
||||||
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
UpdatePosition(Owner.Transform.GridID, grid.TileIndicesFor(Owner.Transform.Coordinates));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePosition(GridId gridId, Vector2i pos)
|
private void UpdatePosition(GridId gridId, Vector2i pos)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
using Content.Server.GameObjects.Components.Atmos.Piping;
|
using Content.Server.GameObjects.Components.Atmos.Piping;
|
||||||
@@ -11,6 +12,8 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
|
|||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
@@ -24,6 +27,8 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
[ComponentReference(typeof(IActivate))]
|
[ComponentReference(typeof(IActivate))]
|
||||||
public class GasCanisterComponent : Component, IGasMixtureHolder, IActivate
|
public class GasCanisterComponent : Component, IGasMixtureHolder, IActivate
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
public override string Name => "GasCanister";
|
public override string Name => "GasCanister";
|
||||||
|
|
||||||
private const int MaxLabelLength = 32;
|
private const int MaxLabelLength = 32;
|
||||||
@@ -114,9 +119,11 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
public void TryConnectToPort()
|
public void TryConnectToPort()
|
||||||
{
|
{
|
||||||
if (!Owner.TryGetComponent<SnapGridComponent>(out var snapGrid)) return;
|
if (!Owner.Transform.Anchored) return;
|
||||||
var port = snapGrid.GetLocal()
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
.Select(entity => entity.TryGetComponent<GasCanisterPortComponent>(out var port) ? port : null)
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
var port = grid.GetLocal(coords)
|
||||||
|
.Select(entity => Owner.EntityManager.ComponentManager.TryGetComponent<GasCanisterPortComponent>(entity, out var port) ? port : null)
|
||||||
.Where(port => port != null)
|
.Where(port => port != null)
|
||||||
.Where(port => !port!.ConnectedToCanister)
|
.Where(port => !port!.ConnectedToCanister)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.NodeContainer;
|
using Content.Server.GameObjects.Components.NodeContainer;
|
||||||
using Content.Server.GameObjects.Components.NodeContainer.Nodes;
|
using Content.Server.GameObjects.Components.NodeContainer.Nodes;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Atmos.Piping
|
namespace Content.Server.GameObjects.Components.Atmos.Piping
|
||||||
@@ -13,6 +16,8 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping
|
|||||||
{
|
{
|
||||||
public override string Name => "GasCanisterPort";
|
public override string Name => "GasCanisterPort";
|
||||||
|
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public GasCanisterComponent? ConnectedCanister { get; private set; }
|
public GasCanisterComponent? ConnectedCanister { get; private set; }
|
||||||
|
|
||||||
@@ -27,12 +32,14 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
Owner.EnsureComponentWarn<PipeNetDeviceComponent>();
|
Owner.EnsureComponentWarn<PipeNetDeviceComponent>();
|
||||||
SetGasPort();
|
SetGasPort();
|
||||||
if (Owner.TryGetComponent<SnapGridComponent>(out var snapGrid))
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
var entities = snapGrid.GetLocal();
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
var entities = grid.GetLocal(coords);
|
||||||
foreach (var entity in entities)
|
foreach (var entity in entities)
|
||||||
{
|
{
|
||||||
if (entity.TryGetComponent<GasCanisterComponent>(out var canister) && canister.Anchored && !canister.ConnectedToPort)
|
if (Owner.EntityManager.ComponentManager.TryGetComponent<GasCanisterComponent>(entity, out var canister) && canister.Anchored && !canister.ConnectedToPort)
|
||||||
{
|
{
|
||||||
canister.TryConnectToPort();
|
canister.TryConnectToPort();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Atmos;
|
using Content.Server.GameObjects.Components.Atmos;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
@@ -24,7 +23,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[Dependency] protected readonly IMapManager MapManager = default!;
|
[Dependency] protected readonly IMapManager MapManager = default!;
|
||||||
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
||||||
|
|
||||||
[ComponentDependency] protected readonly SnapGridComponent? SnapGridComponent = default!;
|
|
||||||
[ComponentDependency] protected readonly SolutionContainerComponent? SolutionContainerComponent = default!;
|
[ComponentDependency] protected readonly SolutionContainerComponent? SolutionContainerComponent = default!;
|
||||||
public int Amount { get; set; }
|
public int Amount { get; set; }
|
||||||
public SolutionAreaEffectInceptionComponent? Inception { get; set; }
|
public SolutionAreaEffectInceptionComponent? Inception { get; set; }
|
||||||
@@ -63,26 +61,20 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SnapGridComponent == null)
|
|
||||||
{
|
|
||||||
Logger.Error("AreaEffectComponent attached to " + Owner.Prototype.ID +
|
|
||||||
" couldn't get SnapGridComponent from owner.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpreadToDir(Direction dir)
|
void SpreadToDir(Direction dir)
|
||||||
{
|
{
|
||||||
foreach (var neighbor in SnapGridComponent.GetInDir(dir))
|
var grid = MapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
foreach (var neighbor in grid.GetInDir(coords, dir))
|
||||||
{
|
{
|
||||||
if (neighbor.TryGetComponent(out SolutionAreaEffectComponent? comp) && comp.Inception == Inception)
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(neighbor, out SolutionAreaEffectComponent? comp) && comp.Inception == Inception)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (neighbor.TryGetComponent(out AirtightComponent? airtight) && airtight.AirBlocked)
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(neighbor, out AirtightComponent? airtight) && airtight.AirBlocked)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var newEffect =
|
var newEffect = Owner.EntityManager.SpawnEntity(Owner.Prototype.ID, grid.DirectionToGrid(coords, dir));
|
||||||
Owner.EntityManager.SpawnEntity(Owner.Prototype.ID, SnapGridComponent.DirectionToGrid(dir));
|
|
||||||
|
|
||||||
if (!newEffect.TryGetComponent(out SolutionAreaEffectComponent? effectComponent))
|
if (!newEffect.TryGetComponent(out SolutionAreaEffectComponent? effectComponent))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
@@ -43,6 +44,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
public class DisposalMailingUnitComponent : SharedDisposalMailingUnitComponent, IInteractHand, IActivate, IInteractUsing, IDragDropOn
|
public class DisposalMailingUnitComponent : SharedDisposalMailingUnitComponent, IInteractHand, IActivate, IInteractUsing, IDragDropOn
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private const string HolderPrototypeId = "DisposalHolder";
|
private const string HolderPrototypeId = "DisposalHolder";
|
||||||
|
|
||||||
@@ -277,17 +279,17 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var snapGrid = Owner.GetComponent<SnapGridComponent>();
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
var entry = snapGrid
|
var coords = Owner.Transform.Coordinates;
|
||||||
.GetLocal()
|
var entry = grid.GetLocal(coords)
|
||||||
.FirstOrDefault(entity => entity.HasComponent<DisposalEntryComponent>());
|
.FirstOrDefault(entity => Owner.EntityManager.ComponentManager.HasComponent<DisposalEntryComponent>(entity));
|
||||||
|
|
||||||
if (entry == null)
|
if (entry == default)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entryComponent = entry.GetComponent<DisposalEntryComponent>();
|
var entryComponent = Owner.EntityManager.ComponentManager.GetComponent<DisposalEntryComponent>(entry);
|
||||||
var entities = _container.ContainedEntities.ToList();
|
var entities = _container.ContainedEntities.ToList();
|
||||||
foreach (var entity in _container.ContainedEntities.ToList())
|
foreach (var entity in _container.ContainedEntities.ToList())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.GameObjects.Components.Disposal;
|
using Content.Shared.GameObjects.Components.Disposal;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
@@ -12,6 +13,7 @@ using Robust.Shared.Containers;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -26,6 +28,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
public abstract class DisposalTubeComponent : Component, IDisposalTubeComponent, IBreakAct
|
public abstract class DisposalTubeComponent : Component, IDisposalTubeComponent, IBreakAct
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private static readonly TimeSpan ClangDelay = TimeSpan.FromSeconds(0.5);
|
private static readonly TimeSpan ClangDelay = TimeSpan.FromSeconds(0.5);
|
||||||
private TimeSpan _lastClang;
|
private TimeSpan _lastClang;
|
||||||
@@ -67,12 +70,13 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
public IDisposalTubeComponent? NextTube(DisposalHolderComponent holder)
|
public IDisposalTubeComponent? NextTube(DisposalHolderComponent holder)
|
||||||
{
|
{
|
||||||
var nextDirection = NextDirection(holder);
|
var nextDirection = NextDirection(holder);
|
||||||
var snapGrid = Owner.GetComponent<SnapGridComponent>();
|
|
||||||
var oppositeDirection = new Angle(nextDirection.ToAngle().Theta + Math.PI).GetDir();
|
var oppositeDirection = new Angle(nextDirection.ToAngle().Theta + Math.PI).GetDir();
|
||||||
|
|
||||||
foreach (var entity in snapGrid.GetInDir(nextDirection))
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var position = Owner.Transform.Coordinates;
|
||||||
|
foreach (var entity in grid.GetInDir(position, nextDirection))
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent(out IDisposalTubeComponent? tube))
|
if (!Owner.EntityManager.ComponentManager.TryGetComponent(entity, out IDisposalTubeComponent? tube))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
@@ -44,6 +45,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder
|
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
public override string Name => "DisposalUnit";
|
public override string Name => "DisposalUnit";
|
||||||
|
|
||||||
@@ -260,17 +262,17 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var snapGrid = Owner.GetComponent<SnapGridComponent>();
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
var entry = snapGrid
|
var coords = Owner.Transform.Coordinates;
|
||||||
.GetLocal()
|
var entry = grid.GetLocal(coords)
|
||||||
.FirstOrDefault(entity => entity.HasComponent<DisposalEntryComponent>());
|
.FirstOrDefault(entity => Owner.EntityManager.ComponentManager.HasComponent<DisposalEntryComponent>(entity));
|
||||||
|
|
||||||
if (entry == null)
|
if (entry == default)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entryComponent = entry.GetComponent<DisposalEntryComponent>();
|
var entryComponent = Owner.EntityManager.ComponentManager.GetComponent<DisposalEntryComponent>(entry);
|
||||||
|
|
||||||
if (Owner.Transform.Coordinates.TryGetTileAtmosphere(out var tileAtmos) &&
|
if (Owner.Transform.Coordinates.TryGetTileAtmosphere(out var tileAtmos) &&
|
||||||
tileAtmos.Air != null &&
|
tileAtmos.Air != null &&
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
private bool _overflown;
|
private bool _overflown;
|
||||||
|
|
||||||
private SpriteComponent _spriteComponent = default!;
|
private SpriteComponent _spriteComponent = default!;
|
||||||
private SnapGridComponent _snapGrid = default!;
|
|
||||||
|
|
||||||
public ReagentUnit MaxVolume
|
public ReagentUnit MaxVolume
|
||||||
{
|
{
|
||||||
@@ -112,7 +111,6 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
_contents = Owner.EnsureComponentWarn<SolutionContainerComponent>();
|
_contents = Owner.EnsureComponentWarn<SolutionContainerComponent>();
|
||||||
_snapGrid = Owner.EnsureComponent<SnapGridComponent>();
|
|
||||||
|
|
||||||
// Smaller than 1m^3 for now but realistically this shouldn't be hit
|
// Smaller than 1m^3 for now but realistically this shouldn't be hit
|
||||||
MaxVolume = ReagentUnit.New(1000);
|
MaxVolume = ReagentUnit.New(1000);
|
||||||
@@ -348,8 +346,9 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
puddle = default;
|
puddle = default;
|
||||||
|
|
||||||
var mapGrid = _mapManager.GetGrid(Owner.Transform.GridID);
|
var mapGrid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
|
||||||
if (!Owner.Transform.Coordinates.Offset(direction).TryGetTileRef(out var tile))
|
if (!coords.Offset(direction).TryGetTileRef(out var tile))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -360,16 +359,19 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var entity in _snapGrid.GetInDir(direction))
|
if (!Owner.Transform.Anchored)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
foreach (var entity in mapGrid.GetInDir(coords, direction))
|
||||||
{
|
{
|
||||||
if (entity.TryGetComponent(out IPhysBody? physics) &&
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(entity, out IPhysBody? physics) &&
|
||||||
(physics.CollisionLayer & (int) CollisionGroup.Impassable) != 0)
|
(physics.CollisionLayer & (int) CollisionGroup.Impassable) != 0)
|
||||||
{
|
{
|
||||||
puddle = default;
|
puddle = default;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity.TryGetComponent(out PuddleComponent? existingPuddle))
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(entity, out PuddleComponent? existingPuddle))
|
||||||
{
|
{
|
||||||
if (existingPuddle._overflown)
|
if (existingPuddle._overflown)
|
||||||
{
|
{
|
||||||
@@ -382,8 +384,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
|
|
||||||
if (puddle == default)
|
if (puddle == default)
|
||||||
{
|
{
|
||||||
var grid = _snapGrid.DirectionToGrid(direction);
|
puddle = () => Owner.EntityManager.SpawnEntity(Owner.Prototype?.ID, mapGrid.DirectionToGrid(coords, direction)).GetComponent<PuddleComponent>();
|
||||||
puddle = () => Owner.EntityManager.SpawnEntity(Owner.Prototype?.ID, grid).GetComponent<PuddleComponent>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
|
|
||||||
var mapGrid = _mapManager.GetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager));
|
var mapGrid = _mapManager.GetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager));
|
||||||
var tile = mapGrid.GetTileRef(eventArgs.ClickLocation);
|
var tile = mapGrid.GetTileRef(eventArgs.ClickLocation);
|
||||||
var snapPos = mapGrid.SnapGridCellFor(eventArgs.ClickLocation, SnapGridOffset.Center);
|
var snapPos = mapGrid.TileIndicesFor(eventArgs.ClickLocation);
|
||||||
|
|
||||||
//Using an RCD isn't instantaneous
|
//Using an RCD isn't instantaneous
|
||||||
var cancelToken = new CancellationTokenSource();
|
var cancelToken = new CancellationTokenSource();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using Content.Server.GameObjects.Components.Power.AME;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||||
@@ -68,12 +69,13 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
|||||||
//Check each shield node to see if it meets core criteria
|
//Check each shield node to see if it meets core criteria
|
||||||
foreach (Node node in Nodes)
|
foreach (Node node in Nodes)
|
||||||
{
|
{
|
||||||
if (!node.Owner.TryGetComponent<AMEShieldComponent>(out var shield)) { continue; }
|
var nodeOwner = node.Owner;
|
||||||
var nodeNeighbors = node.Owner
|
if (!nodeOwner.TryGetComponent<AMEShieldComponent>(out var shield)) { continue; }
|
||||||
.GetComponent<SnapGridComponent>()
|
|
||||||
.GetCellsInSquareArea()
|
var grid = IoCManager.Resolve<IMapManager>().GetGrid(nodeOwner.Transform.GridID);
|
||||||
.Select(sgc => sgc.Owner)
|
var nodeNeighbors = grid.GetCellsInSquareArea(nodeOwner.Transform.Coordinates, 1)
|
||||||
.Where(entity => entity != node.Owner)
|
.Select(sgc => nodeOwner.EntityManager.GetEntity(sgc))
|
||||||
|
.Where(entity => entity != nodeOwner)
|
||||||
.Select(entity => entity.TryGetComponent<AMEShieldComponent>(out var adjshield) ? adjshield : null)
|
.Select(entity => entity.TryGetComponent<AMEShieldComponent>(out var adjshield) ? adjshield : null)
|
||||||
.Where(adjshield => adjshield != null);
|
.Where(adjshield => adjshield != null);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
||||||
@@ -13,13 +14,17 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
{
|
{
|
||||||
protected override IEnumerable<Node> GetReachableNodes()
|
protected override IEnumerable<Node> GetReachableNodes()
|
||||||
{
|
{
|
||||||
if (!Owner.TryGetComponent(out SnapGridComponent? snap))
|
if (!Owner.Transform.Anchored)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
foreach (var cell in snap.GetCardinalNeighborCells())
|
var grid = IoCManager.Resolve<IMapManager>().GetGrid(Owner.Transform.GridID);
|
||||||
foreach (var entity in cell.GetLocal())
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
foreach (var cell in grid.GetCardinalNeighborCells(coords))
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent<NodeContainerComponent>(out var container)) continue;
|
foreach (var entity in grid.GetLocal(Owner.EntityManager.GetEntity(cell).Transform.Coordinates))
|
||||||
|
{
|
||||||
|
if (!Owner.EntityManager.GetEntity(entity).TryGetComponent<NodeContainerComponent>(out var container))
|
||||||
|
continue;
|
||||||
|
|
||||||
foreach (var node in container.Nodes.Values)
|
foreach (var node in container.Nodes.Values)
|
||||||
{
|
{
|
||||||
@@ -33,3 +38,4 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ using Content.Server.Interfaces;
|
|||||||
using Content.Shared.GameObjects.Components.Atmos;
|
using Content.Shared.GameObjects.Components.Atmos;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -169,14 +171,14 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private IEnumerable<PipeNode> PipesInDirection(PipeDirection pipeDir)
|
private IEnumerable<PipeNode> PipesInDirection(PipeDirection pipeDir)
|
||||||
{
|
{
|
||||||
if (!Owner.TryGetComponent(out SnapGridComponent? grid))
|
if (!Owner.Transform.Anchored)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
var entities = grid.GetInDir(pipeDir.ToDirection());
|
var grid = IoCManager.Resolve<IMapManager>().GetGrid(Owner.Transform.GridID);
|
||||||
|
var position = Owner.Transform.Coordinates;
|
||||||
foreach (var entity in entities)
|
foreach (var entity in grid.GetInDir(position, pipeDir.ToDirection()))
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent<NodeContainerComponent>(out var container))
|
if (!Owner.EntityManager.ComponentManager.TryGetComponent<NodeContainerComponent>(entity, out var container))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
foreach (var node in container.Nodes.Values)
|
foreach (var node in container.Nodes.Values)
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
|
|||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -36,6 +38,8 @@ namespace Content.Server.GameObjects.Components.PA
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class ParticleAcceleratorControlBoxComponent : ParticleAcceleratorPartComponent, IActivate, IWires
|
public class ParticleAcceleratorControlBoxComponent : ParticleAcceleratorPartComponent, IActivate, IWires
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
public override string Name => "ParticleAcceleratorControlBox";
|
public override string Name => "ParticleAcceleratorControlBox";
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
@@ -378,11 +382,13 @@ namespace Content.Server.GameObjects.Components.PA
|
|||||||
_partEmitterRight = null;
|
_partEmitterRight = null;
|
||||||
|
|
||||||
// Find fuel chamber first by scanning cardinals.
|
// Find fuel chamber first by scanning cardinals.
|
||||||
if (SnapGrid != null)
|
if (Owner.Transform.Anchored)
|
||||||
{
|
{
|
||||||
foreach (var maybeFuel in SnapGrid.GetCardinalNeighborCells())
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
foreach (var maybeFuel in grid.GetCardinalNeighborCells(coords))
|
||||||
{
|
{
|
||||||
if (maybeFuel.Owner.TryGetComponent(out _partFuelChamber))
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(maybeFuel, out _partFuelChamber))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -452,9 +458,11 @@ namespace Content.Server.GameObjects.Components.PA
|
|||||||
private bool ScanPart<T>(Vector2i offset, [NotNullWhen(true)] out T? part)
|
private bool ScanPart<T>(Vector2i offset, [NotNullWhen(true)] out T? part)
|
||||||
where T : ParticleAcceleratorPartComponent
|
where T : ParticleAcceleratorPartComponent
|
||||||
{
|
{
|
||||||
foreach (var ent in SnapGrid!.GetOffset(offset))
|
var grid = _mapManager.GetGrid(Owner.Transform.GridID);
|
||||||
|
var coords = Owner.Transform.Coordinates;
|
||||||
|
foreach (var ent in grid.GetOffset(coords, offset))
|
||||||
{
|
{
|
||||||
if (ent.TryGetComponent(out part) && !part.Deleted)
|
if (Owner.EntityManager.ComponentManager.TryGetComponent(ent, out part) && !part.Deleted)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Log;
|
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.PA
|
namespace Content.Server.GameObjects.Components.PA
|
||||||
@@ -8,14 +7,13 @@ namespace Content.Server.GameObjects.Components.PA
|
|||||||
public abstract class ParticleAcceleratorPartComponent : Component
|
public abstract class ParticleAcceleratorPartComponent : Component
|
||||||
{
|
{
|
||||||
[ViewVariables] public ParticleAcceleratorControlBoxComponent? Master;
|
[ViewVariables] public ParticleAcceleratorControlBoxComponent? Master;
|
||||||
[ViewVariables] protected SnapGridComponent? SnapGrid;
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
// FIXME: this has to be an entity system, full stop.
|
// FIXME: this has to be an entity system, full stop.
|
||||||
|
|
||||||
Owner.EnsureComponent<SnapGridComponent>(out SnapGrid);
|
Owner.Transform.Anchored = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(_serverEntityManager), out var mapGrid))
|
if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(_serverEntityManager), out var mapGrid))
|
||||||
return false; // No AME in space.
|
return false; // No AME in space.
|
||||||
|
|
||||||
var snapPos = mapGrid.SnapGridCellFor(args.ClickLocation, SnapGridOffset.Center);
|
var snapPos = mapGrid.TileIndicesFor(args.ClickLocation);
|
||||||
if (mapGrid.GetSnapGridCell(snapPos, SnapGridOffset.Center).Any(sc => sc.Owner.HasComponent<AMEShieldComponent>()))
|
if (mapGrid.GetAnchoredEntities(snapPos).Any(sc => _serverEntityManager.ComponentManager.HasComponent<AMEShieldComponent>(sc)))
|
||||||
{
|
{
|
||||||
Owner.PopupMessage(args.User, Loc.GetString("Shielding is already there!"));
|
Owner.PopupMessage(args.User, Loc.GetString("Shielding is already there!"));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
using System.Collections.Generic;
|
||||||
using Content.Server.GameObjects.Components.Stack;
|
using Content.Server.GameObjects.Components.Stack;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
@@ -38,13 +39,12 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
return true;
|
return true;
|
||||||
if(!_mapManager.TryGetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager), out var grid))
|
if(!_mapManager.TryGetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager), out var grid))
|
||||||
return true;
|
return true;
|
||||||
var snapPos = grid.SnapGridCellFor(eventArgs.ClickLocation, SnapGridOffset.Center);
|
var snapPos = grid.TileIndicesFor(eventArgs.ClickLocation);
|
||||||
var snapCell = grid.GetSnapGridCell(snapPos, SnapGridOffset.Center);
|
|
||||||
if(grid.GetTileRef(snapPos).Tile.IsEmpty)
|
if(grid.GetTileRef(snapPos).Tile.IsEmpty)
|
||||||
return true;
|
return true;
|
||||||
foreach (var snapComp in snapCell)
|
foreach (var anchored in grid.GetAnchoredEntities(snapPos))
|
||||||
{
|
{
|
||||||
if (snapComp.Owner.TryGetComponent<WireComponent>(out var wire) && wire.WireType == _blockingWireType)
|
if (Owner.EntityManager.ComponentManager.TryGetComponent<WireComponent>(anchored, out var wire) && wire.WireType == _blockingWireType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Required for airtight components.
|
// Required for airtight components.
|
||||||
EntityManager.EventBus.SubscribeEvent<RotateEvent>(EventSource.Local, this, RotateEvent);
|
SubscribeLocalEvent<RotateEvent>(RotateEvent);
|
||||||
|
SubscribeLocalEvent<AirtightComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
|
|
||||||
_cfg.OnValueChanged(CCVars.SpaceWind, OnSpaceWindChanged, true);
|
_cfg.OnValueChanged(CCVars.SpaceWind, OnSpaceWindChanged, true);
|
||||||
_cfg.OnValueChanged(CCVars.MonstermosEqualization, OnMonstermosEqualizationChanged, true);
|
_cfg.OnValueChanged(CCVars.MonstermosEqualization, OnMonstermosEqualizationChanged, true);
|
||||||
@@ -72,6 +73,11 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, OnExcitedGroupsSpaceIsAllConsumingChanged, true);
|
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, OnExcitedGroupsSpaceIsAllConsumingChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void HandleSnapGridMove(EntityUid uid, AirtightComponent component, SnapGridPositionChangedEvent args)
|
||||||
|
{
|
||||||
|
component.OnTransformMove();
|
||||||
|
}
|
||||||
|
|
||||||
public bool SpaceWind { get; private set; }
|
public bool SpaceWind { get; private set; }
|
||||||
public bool MonstermosEqualization { get; private set; }
|
public bool MonstermosEqualization { get; private set; }
|
||||||
public bool Superconduction { get; private set; }
|
public bool Superconduction { get; private set; }
|
||||||
@@ -115,7 +121,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
_mapManager.MapCreated -= OnMapCreated;
|
_mapManager.MapCreated -= OnMapCreated;
|
||||||
|
|
||||||
EntityManager.EventBus.UnsubscribeEvent<RotateEvent>(EventSource.Local, this);
|
UnsubscribeLocalEvent<RotateEvent>();
|
||||||
|
UnsubscribeLocalEvent<AirtightComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RotateEvent(RotateEvent ev)
|
private void RotateEvent(RotateEvent ev)
|
||||||
|
|||||||
@@ -3,34 +3,41 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.EntitySystems
|
namespace Content.Server.GameObjects.EntitySystems
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
internal sealed class PuddleSystem : EntitySystem
|
internal sealed class PuddleSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
_mapManager.TileChanged += HandleTileChanged;
|
||||||
mapManager.TileChanged += HandleTileChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
_mapManager.TileChanged -= HandleTileChanged;
|
||||||
mapManager.TileChanged -= HandleTileChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: Replace all this with an Unanchored event that deletes the puddle
|
||||||
private void HandleTileChanged(object? sender, TileChangedEventArgs eventArgs)
|
private void HandleTileChanged(object? sender, TileChangedEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
// If this gets hammered you could probably queue up all the tile changes every tick but I doubt that would ever happen.
|
// If this gets hammered you could probably queue up all the tile changes every tick but I doubt that would ever happen.
|
||||||
foreach (var (puddle, snapGrid) in ComponentManager.EntityQuery<PuddleComponent, SnapGridComponent>(true))
|
foreach (var puddle in ComponentManager.EntityQuery<PuddleComponent>(true))
|
||||||
{
|
{
|
||||||
// If the tile becomes space then delete it (potentially change by design)
|
// If the tile becomes space then delete it (potentially change by design)
|
||||||
|
var puddleTransform = puddle.Owner.Transform;
|
||||||
|
if(!puddleTransform.Anchored)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var grid = _mapManager.GetGrid(puddleTransform.GridID);
|
||||||
if (eventArgs.NewTile.GridIndex == puddle.Owner.Transform.GridID &&
|
if (eventArgs.NewTile.GridIndex == puddle.Owner.Transform.GridID &&
|
||||||
snapGrid.Position == eventArgs.NewTile.GridIndices &&
|
grid.TileIndicesFor(puddleTransform.Coordinates) == eventArgs.NewTile.GridIndices &&
|
||||||
eventArgs.NewTile.Tile.IsEmpty)
|
eventArgs.NewTile.Tile.IsEmpty)
|
||||||
{
|
{
|
||||||
puddle.Owner.Delete();
|
puddle.Owner.Delete();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Content.Server.GameObjects.Components.Stack;
|
|||||||
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Maps;
|
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -70,12 +69,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
if (component.RemoveOnInteract && component.Owner.TryGetComponent(out stack) && !stack.Use(1))
|
if (component.RemoveOnInteract && component.Owner.TryGetComponent(out stack) && !stack.Use(1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid, SnapGridOffset.Center));
|
EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid));
|
||||||
|
|
||||||
if (component.RemoveOnInteract && stack == null && !component.Owner.Deleted)
|
if (component.RemoveOnInteract && stack == null && !component.Owner.Deleted)
|
||||||
component.Owner.Delete();
|
component.Owner.Delete();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,9 +156,9 @@ namespace Content.Server.Physics.Controllers
|
|||||||
// If the coordinates have a FootstepModifier component
|
// If the coordinates have a FootstepModifier component
|
||||||
// i.e. component that emit sound on footsteps emit that sound
|
// i.e. component that emit sound on footsteps emit that sound
|
||||||
string? soundCollectionName = null;
|
string? soundCollectionName = null;
|
||||||
foreach (var maybeFootstep in grid.GetSnapGridCell(tile.GridIndices, SnapGridOffset.Center))
|
foreach (var maybeFootstep in grid.GetAnchoredEntities(tile.GridIndices))
|
||||||
{
|
{
|
||||||
if (maybeFootstep.Owner.TryGetComponent(out FootstepModifierComponent? footstep))
|
if (EntityManager.ComponentManager.TryGetComponent(maybeFootstep, out FootstepModifierComponent? footstep))
|
||||||
{
|
{
|
||||||
soundCollectionName = footstep._soundCollectionName;
|
soundCollectionName = footstep._soundCollectionName;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -7,13 +7,12 @@ namespace Content.Server.Utility
|
|||||||
{
|
{
|
||||||
public static class SnapgridHelper
|
public static class SnapgridHelper
|
||||||
{
|
{
|
||||||
public static void SnapToGrid(this IEntity entity, SnapGridOffset offset = SnapGridOffset.Center, IEntityManager? entityManager = null, IMapManager? mapManager = null)
|
public static void SnapToGrid(this IEntity entity, IEntityManager? entityManager = null, IMapManager? mapManager = null)
|
||||||
{
|
{
|
||||||
entity.Transform.Coordinates = entity.Transform.Coordinates.SnapToGrid(offset, entityManager, mapManager);
|
entity.Transform.Coordinates = entity.Transform.Coordinates.SnapToGrid(entityManager, mapManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates,
|
public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, IEntityManager? entityManager = null, IMapManager? mapManager = null)
|
||||||
SnapGridOffset offset = SnapGridOffset.Center, IEntityManager? entityManager = null, IMapManager? mapManager = null)
|
|
||||||
{
|
{
|
||||||
entityManager ??= IoCManager.Resolve<IEntityManager>();
|
entityManager ??= IoCManager.Resolve<IEntityManager>();
|
||||||
mapManager ??= IoCManager.Resolve<IMapManager>();
|
mapManager ??= IoCManager.Resolve<IMapManager>();
|
||||||
@@ -30,21 +29,20 @@ namespace Content.Server.Utility
|
|||||||
|
|
||||||
var localPos = coordinates.Position;
|
var localPos = coordinates.Position;
|
||||||
|
|
||||||
var x = (int)Math.Floor(localPos.X / tileSize) + tileSize / (offset == SnapGridOffset.Center ? 2f : 0f);
|
var x = (int)Math.Floor(localPos.X / tileSize) + tileSize / 2f;
|
||||||
var y = (int)Math.Floor(localPos.Y / tileSize) + tileSize / (offset == SnapGridOffset.Center ? 2f : 0f);
|
var y = (int)Math.Floor(localPos.Y / tileSize) + tileSize / 2f;
|
||||||
|
|
||||||
return new EntityCoordinates(coordinates.EntityId, x, y);
|
return new EntityCoordinates(coordinates.EntityId, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, IMapGrid grid,
|
public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, IMapGrid grid)
|
||||||
SnapGridOffset offset = SnapGridOffset.Center)
|
|
||||||
{
|
{
|
||||||
var tileSize = grid.TileSize;
|
var tileSize = grid.TileSize;
|
||||||
|
|
||||||
var localPos = coordinates.Position;
|
var localPos = coordinates.Position;
|
||||||
|
|
||||||
var x = (int)Math.Floor(localPos.X / tileSize) + tileSize / (offset == SnapGridOffset.Center ? 2f : 0f);
|
var x = (int)Math.Floor(localPos.X / tileSize) + tileSize / 2f;
|
||||||
var y = (int)Math.Floor(localPos.Y / tileSize) + tileSize / (offset == SnapGridOffset.Center ? 2f : 0f);
|
var y = (int)Math.Floor(localPos.Y / tileSize) + tileSize / 2f;
|
||||||
|
|
||||||
return new EntityCoordinates(coordinates.EntityId, x, y);
|
return new EntityCoordinates(coordinates.EntityId, x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,11 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
|
|
||||||
private void UpdateAll()
|
private void UpdateAll()
|
||||||
{
|
{
|
||||||
foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>(true))
|
foreach (var comp in ComponentManager.EntityQuery<SubFloorHideComponent>(true))
|
||||||
{
|
{
|
||||||
if (!_mapManager.TryGetGrid(comp.Owner.Transform.GridID, out var grid)) return;
|
var transform = comp.Owner.Transform;
|
||||||
|
if (!_mapManager.TryGetGrid(transform.GridID, out var grid)) return;
|
||||||
var snapPos = comp.Owner.GetComponent<SnapGridComponent>();
|
UpdateTile(grid, grid.TileIndicesFor(transform.Coordinates));
|
||||||
UpdateTile(grid, snapPos.Position);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,22 +118,21 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
var tile = grid.GetTileRef(position);
|
var tile = grid.GetTileRef(position);
|
||||||
var tileDef = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
|
var tileDef = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
|
||||||
foreach (var snapGridComponent in grid.GetSnapGridCell(position, SnapGridOffset.Center))
|
foreach (var anchored in grid.GetAnchoredEntities(position))
|
||||||
{
|
{
|
||||||
var entity = snapGridComponent.Owner;
|
if (!ComponentManager.TryGetComponent(anchored, out SubFloorHideComponent? subFloorComponent))
|
||||||
if (!entity.TryGetComponent(out SubFloorHideComponent? subFloorComponent))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show sprite
|
// Show sprite
|
||||||
if (entity.TryGetComponent(out SharedSpriteComponent? spriteComponent))
|
if (ComponentManager.TryGetComponent(anchored, out SharedSpriteComponent ? spriteComponent))
|
||||||
{
|
{
|
||||||
spriteComponent.Visible = ShowAll || !subFloorComponent.Running || tileDef.IsSubFloor;
|
spriteComponent.Visible = ShowAll || !subFloorComponent.Running || tileDef.IsSubFloor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// So for collision all we care about is that the component is running.
|
// So for collision all we care about is that the component is running.
|
||||||
if (entity.TryGetComponent(out PhysicsComponent? physicsComponent))
|
if (ComponentManager.TryGetComponent(anchored, out PhysicsComponent ? physicsComponent))
|
||||||
{
|
{
|
||||||
physicsComponent.CanCollide = !subFloorComponent.Running;
|
physicsComponent.CanCollide = !subFloorComponent.Running;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,6 @@
|
|||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
sprite: Constructible/Tiles/catwalk.rsi
|
sprite: Constructible/Tiles/catwalk.rsi
|
||||||
state: catwalk_preview
|
state: catwalk_preview
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: IconSmooth
|
- type: IconSmooth
|
||||||
key: catwalk
|
key: catwalk
|
||||||
base: catwalk_
|
base: catwalk_
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Constructible/Atmos/gascanisterport.rsi
|
sprite: Constructible/Atmos/gascanisterport.rsi
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
components:
|
components:
|
||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: GasGenerator
|
- type: GasGenerator
|
||||||
- type: PipeNetDevice
|
- type: PipeNetDevice
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
- !type:DoActsBehavior
|
- !type:DoActsBehavior
|
||||||
acts: ["Destruction"]
|
acts: ["Destruction"]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
- type: AMEController
|
- type: AMEController
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
- !type:DoActsBehavior
|
- !type:DoActsBehavior
|
||||||
acts: ["Destruction"]
|
acts: ["Destruction"]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: IconSmooth
|
- type: IconSmooth
|
||||||
mode: CardinalFlags
|
mode: CardinalFlags
|
||||||
base: shield_
|
base: shield_
|
||||||
|
|||||||
@@ -19,6 +19,5 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
- type: Clickable
|
- type: Clickable
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/Singularity/collector.rsi
|
sprite: Constructible/Power/Singularity/collector.rsi
|
||||||
layers:
|
layers:
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/Singularity/containment.rsi
|
sprite: Constructible/Power/Singularity/containment.rsi
|
||||||
state: icon
|
state: icon
|
||||||
@@ -66,7 +65,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/Singularity/containment_field.rsi
|
sprite: Constructible/Power/Singularity/containment_field.rsi
|
||||||
state: field
|
state: field
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/Singularity/emitter.rsi
|
sprite: Constructible/Power/Singularity/emitter.rsi
|
||||||
layers:
|
layers:
|
||||||
|
|||||||
@@ -23,6 +23,5 @@
|
|||||||
mask:
|
mask:
|
||||||
- MobImpassable
|
- MobImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/power.rsi
|
sprite: Constructible/Power/power.rsi
|
||||||
state: generator
|
state: generator
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
- type: SolarPanel
|
- type: SolarPanel
|
||||||
supply: 1500
|
supply: 1500
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
@@ -78,7 +77,6 @@
|
|||||||
sprite: Constructible/Power/solar_panel.rsi
|
sprite: Constructible/Power/solar_panel.rsi
|
||||||
state: solar_assembly
|
state: solar_assembly
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
@@ -123,7 +121,6 @@
|
|||||||
sprite: Constructible/Power/solar_panel.rsi
|
sprite: Constructible/Power/solar_panel.rsi
|
||||||
state: solar_tracker
|
state: solar_tracker
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
bounds: "-0.5, -0.5, 0.5, 0.5"
|
bounds: "-0.5, -0.5, 0.5, 0.5"
|
||||||
layer: [MobMask, Opaque]
|
layer: [MobMask, Opaque]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/power.rsi
|
sprite: Constructible/Power/power.rsi
|
||||||
state: wiredmachine
|
state: wiredmachine
|
||||||
@@ -58,7 +57,6 @@
|
|||||||
bounds: "-0.5, -0.5, 0.5, 0.5"
|
bounds: "-0.5, -0.5, 0.5, 0.5"
|
||||||
layer: [MobMask, Opaque]
|
layer: [MobMask, Opaque]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/power.rsi
|
sprite: Constructible/Power/power.rsi
|
||||||
state: provider
|
state: provider
|
||||||
@@ -88,7 +86,6 @@
|
|||||||
bounds: "-0.5, -0.5, 0.5, 0.5"
|
bounds: "-0.5, -0.5, 0.5, 0.5"
|
||||||
layer: [MobMask, Opaque]
|
layer: [MobMask, Opaque]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/power.rsi
|
sprite: Constructible/Power/power.rsi
|
||||||
state: provider
|
state: provider
|
||||||
@@ -133,7 +130,6 @@
|
|||||||
bounds: "-0.5, -0.5, 0.5, 0.5"
|
bounds: "-0.5, -0.5, 0.5, 0.5"
|
||||||
layer: [MobMask, Opaque]
|
layer: [MobMask, Opaque]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/power.rsi
|
sprite: Constructible/Power/power.rsi
|
||||||
state: wirelessmachine
|
state: wirelessmachine
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
- Opaque
|
- Opaque
|
||||||
- MobImpassable
|
- MobImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Lathe
|
- type: Lathe
|
||||||
- type: MaterialStorage
|
- type: MaterialStorage
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Constructible/Power/smes.rsi
|
sprite: Constructible/Power/smes.rsi
|
||||||
@@ -85,7 +84,6 @@
|
|||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Constructible/Power/substation.rsi
|
sprite: Constructible/Power/substation.rsi
|
||||||
layers:
|
layers:
|
||||||
@@ -139,7 +137,6 @@
|
|||||||
bounds: "-0.25, -0.25, 0.25, 0.3"
|
bounds: "-0.25, -0.25, 0.25, 0.3"
|
||||||
layer: [ Passable ]
|
layer: [ Passable ]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
drawdepth: WallMountedItems
|
drawdepth: WallMountedItems
|
||||||
netsync: false
|
netsync: false
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: SeedExtractor
|
- type: SeedExtractor
|
||||||
- type: PowerReceiver
|
- type: PowerReceiver
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
- Underplating
|
- Underplating
|
||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
drawdepth: BelowFloor
|
drawdepth: BelowFloor
|
||||||
- type: IconSmooth
|
- type: IconSmooth
|
||||||
@@ -166,7 +165,6 @@
|
|||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
drawdepth: BelowFloor
|
drawdepth: BelowFloor
|
||||||
- type: IconSmooth
|
- type: IconSmooth
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Constructible/Power/conveyor.rsi
|
sprite: Constructible/Power/conveyor.rsi
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Microwave
|
- type: Microwave
|
||||||
- type: Clickable
|
- type: Clickable
|
||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: ReagentGrinder
|
- type: ReagentGrinder
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: ReagentDispenser
|
- type: ReagentDispenser
|
||||||
- type: PowerReceiver
|
- type: PowerReceiver
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: CloningPod
|
- type: CloningPod
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
- Impassable
|
- Impassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
- type: MedicalScanner
|
- type: MedicalScanner
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
light_mob: morgue_nosoul_light
|
light_mob: morgue_nosoul_light
|
||||||
light_soul: morgue_soul_light
|
light_soul: morgue_soul_light
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: MorgueTray
|
id: MorgueTray
|
||||||
@@ -115,7 +114,6 @@
|
|||||||
light_contents: crema_contents_light
|
light_contents: crema_contents_light
|
||||||
light_burning: crema_active_light
|
light_burning: crema_active_light
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: CrematoriumTray
|
id: CrematoriumTray
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
- type: Physics
|
- type: Physics
|
||||||
bodyType: Static
|
bodyType: Static
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
@@ -399,7 +398,6 @@
|
|||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
shader: unshaded
|
shader: unshaded
|
||||||
map: ["enum.GravityGeneratorVisualLayers.Core"]
|
map: ["enum.GravityGeneratorVisualLayers.Core"]
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: PowerReceiver
|
- type: PowerReceiver
|
||||||
powerLoad: 500
|
powerLoad: 500
|
||||||
- type: Physics
|
- type: Physics
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
maxVol: 200
|
maxVol: 200
|
||||||
caps: Refillable
|
caps: Refillable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Reactive
|
- type: Reactive
|
||||||
reactions:
|
reactions:
|
||||||
- !type:AddToSolutionReaction
|
- !type:AddToSolutionReaction
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Constructible/Power/recycling.rsi
|
sprite: Constructible/Power/recycling.rsi
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Clickable
|
- type: Clickable
|
||||||
- type: Physics
|
- type: Physics
|
||||||
bodyType: Static
|
bodyType: Static
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
- type: SmokeVisualizer
|
- type: SmokeVisualizer
|
||||||
- type: Occluder
|
- type: Occluder
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: SmokeSolutionAreaEffect
|
- type: SmokeSolutionAreaEffect
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
maxVol: 600
|
maxVol: 600
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
animationTime: 0.6
|
animationTime: 0.6
|
||||||
animationState: foam-dissolve
|
animationState: foam-dissolve
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Physics
|
- type: Physics
|
||||||
fixtures:
|
fixtures:
|
||||||
- shape:
|
- shape:
|
||||||
@@ -118,7 +116,6 @@
|
|||||||
sizeX: 32
|
sizeX: 32
|
||||||
sizeY: 32
|
sizeY: 32
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Airtight
|
- type: Airtight
|
||||||
- type: Damageable
|
- type: Damageable
|
||||||
resistances: metallicResistances
|
resistances: metallicResistances
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
drawdepth: FloorObjects
|
drawdepth: FloorObjects
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
Slots:
|
Slots:
|
||||||
- neck
|
- neck
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: BedsheetBlack
|
id: BedsheetBlack
|
||||||
|
|||||||
@@ -35,6 +35,5 @@
|
|||||||
doAfter: 3
|
doAfter: 3
|
||||||
- type: Airtight
|
- type: Airtight
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
placement:
|
placement:
|
||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
|
|||||||
@@ -58,7 +58,6 @@
|
|||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
- type: SnapGrid
|
- type: SnapGrid
|
||||||
offset: Center
|
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
maxVol: 50
|
maxVol: 50
|
||||||
- type: Vapor
|
- type: Vapor
|
||||||
|
|||||||
Submodule RobustToolbox updated: 197227dcf6...122acc5fd5
Reference in New Issue
Block a user