Move pipe visualizers to systems. (#6565)
This commit is contained in:
@@ -0,0 +1,83 @@
|
|||||||
|
using Content.Client.SubFloor;
|
||||||
|
using Content.Shared.Atmos;
|
||||||
|
using Content.Shared.Atmos.Components;
|
||||||
|
using Content.Shared.Atmos.Piping;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Client.GameObjects;
|
||||||
|
using Robust.Client.ResourceManagement;
|
||||||
|
|
||||||
|
namespace Content.Client.Atmos.EntitySystems;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<PipeAppearanceComponent, ComponentInit>(OnInit);
|
||||||
|
SubscribeLocalEvent<PipeAppearanceComponent, AppearanceChangeEvent>(OnAppearanceChanged, after: new[] { typeof(SubFloorHideSystem) });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnInit(EntityUid uid, PipeAppearanceComponent component, ComponentInit args)
|
||||||
|
{
|
||||||
|
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_resCache.TryGetResource(SharedSpriteComponent.TextureRoot / component.RsiPath, out RSIResource? rsi))
|
||||||
|
{
|
||||||
|
Logger.Error($"{nameof(AtmosPipeAppearanceSystem)} could not load to load RSI {component.RsiPath}.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (PipeConnectionLayer layerKey in Enum.GetValues(typeof(PipeConnectionLayer)))
|
||||||
|
{
|
||||||
|
sprite.LayerMapReserveBlank(layerKey);
|
||||||
|
var layer = sprite.LayerMapGet(layerKey);
|
||||||
|
sprite.LayerSetRSI(layer, rsi.RSI);
|
||||||
|
var layerState = component.BaseState + (PipeDirection) layerKey;
|
||||||
|
sprite.LayerSetState(layer, layerState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAppearanceChanged(EntityUid uid, PipeAppearanceComponent component, ref AppearanceChangeEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!args.Component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||||
|
color = Color.White;
|
||||||
|
|
||||||
|
if (!args.Component.TryGetData(PipeVisuals.VisualState, out PipeDirection connectedDirections))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var rotation = Transform(uid).LocalRotation;
|
||||||
|
|
||||||
|
foreach (PipeConnectionLayer layerKey in Enum.GetValues(typeof(PipeConnectionLayer)))
|
||||||
|
{
|
||||||
|
if (!sprite.LayerMapTryGet(layerKey, out var key))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var layer = sprite[key];
|
||||||
|
var dir = (PipeDirection) layerKey;
|
||||||
|
var visible = connectedDirections.HasDirection(dir);
|
||||||
|
|
||||||
|
layer.Visible &= visible;
|
||||||
|
|
||||||
|
if (!visible) continue;
|
||||||
|
|
||||||
|
layer.Rotation = -rotation;
|
||||||
|
layer.Color = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum PipeConnectionLayer : byte
|
||||||
|
{
|
||||||
|
NorthConnection = PipeDirection.North,
|
||||||
|
SouthConnection = PipeDirection.South,
|
||||||
|
EastConnection = PipeDirection.East,
|
||||||
|
WestConnection = PipeDirection.West,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
using Content.Shared.Atmos.Piping;
|
using Content.Shared.Atmos.Piping;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Maths;
|
|
||||||
|
|
||||||
namespace Content.Client.Atmos.Visualizers
|
namespace Content.Client.Atmos.Visualizers
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class PipeColorVisualizer : AppearanceVisualizer
|
public sealed class PipeColorVisualizer : AppearanceVisualizer
|
||||||
{
|
{
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
public override void OnChangeData(AppearanceComponent component)
|
||||||
{
|
{
|
||||||
@@ -19,7 +16,9 @@ namespace Content.Client.Atmos.Visualizers
|
|||||||
|
|
||||||
if (component.TryGetData(PipeColorVisuals.Color, out Color color))
|
if (component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||||
{
|
{
|
||||||
sprite.LayerSetColor(Layers.Pipe, color);
|
// T-ray scanner / sub floor runs after this visualizer. Lets not bulldoze transparency.
|
||||||
|
var layer = sprite[Layers.Pipe];
|
||||||
|
layer.Color = color.WithAlpha(layer.Color.A);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Content.Shared.Atmos;
|
|
||||||
using Content.Shared.Atmos.Piping;
|
|
||||||
using Content.Shared.SubFloor;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Client.Graphics;
|
|
||||||
using Robust.Client.ResourceManagement;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Log;
|
|
||||||
using Robust.Shared.Maths;
|
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
|
||||||
|
|
||||||
namespace Content.Client.Atmos.Visualizers
|
|
||||||
{
|
|
||||||
[UsedImplicitly]
|
|
||||||
public class PipeConnectorVisualizer : AppearanceVisualizer, ISerializationHooks
|
|
||||||
{
|
|
||||||
[DataField("rsi")]
|
|
||||||
private string _rsi = "Structures/Piping/Atmospherics/pipe.rsi";
|
|
||||||
|
|
||||||
[DataField("baseState")]
|
|
||||||
private string _baseState = "pipeConnector";
|
|
||||||
|
|
||||||
private RSI? _connectorRsi;
|
|
||||||
|
|
||||||
void ISerializationHooks.AfterDeserialization()
|
|
||||||
{
|
|
||||||
var rsiString = SharedSpriteComponent.TextureRoot / _rsi;
|
|
||||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
|
||||||
|
|
||||||
if (resourceCache.TryGetResource(rsiString, out RSIResource? rsi))
|
|
||||||
_connectorRsi = rsi.RSI;
|
|
||||||
else
|
|
||||||
Logger.Error($"{nameof(PipeConnectorVisualizer)} could not load to load RSI {rsiString}.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void InitializeEntity(EntityUid entity)
|
|
||||||
{
|
|
||||||
base.InitializeEntity(entity);
|
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
|
||||||
if (!entities.TryGetComponent<ISpriteComponent?>(entity, out var sprite))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_connectorRsi == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (Layer layerKey in Enum.GetValues(typeof(Layer)))
|
|
||||||
{
|
|
||||||
sprite.LayerMapReserveBlank(layerKey);
|
|
||||||
var layer = sprite.LayerMapGet(layerKey);
|
|
||||||
sprite.LayerSetRSI(layer, _connectorRsi);
|
|
||||||
var layerState = _baseState + ((PipeDirection) layerKey);
|
|
||||||
sprite.LayerSetState(layer, layerState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
|
||||||
{
|
|
||||||
base.OnChangeData(component);
|
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
|
||||||
if (!entities.TryGetComponent<TransformComponent>(component.Owner, out var xform))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!entities.TryGetComponent<ISpriteComponent>(component.Owner, out var sprite))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!component.TryGetData(PipeColorVisuals.Color, out Color color))
|
|
||||||
color = Color.White;
|
|
||||||
|
|
||||||
if (!component.TryGetData(PipeVisuals.VisualState, out PipeDirection connectedDirections))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(!component.TryGetData(SubFloorVisuals.SubFloor, out bool subfloor))
|
|
||||||
subfloor = true;
|
|
||||||
|
|
||||||
var rotation = xform.LocalRotation;
|
|
||||||
|
|
||||||
foreach (Layer layerKey in Enum.GetValues(typeof(Layer)))
|
|
||||||
{
|
|
||||||
var layer = sprite.LayerMapGet(layerKey);
|
|
||||||
var dir = (PipeDirection) layerKey;
|
|
||||||
var visible = subfloor && connectedDirections.HasDirection(dir);
|
|
||||||
sprite.LayerSetVisible(layer, visible);
|
|
||||||
|
|
||||||
if (!visible) continue;
|
|
||||||
|
|
||||||
sprite.LayerSetRotation(layer, -rotation);
|
|
||||||
sprite.LayerSetColor(layer, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum Layer : byte
|
|
||||||
{
|
|
||||||
NorthConnection = PipeDirection.North,
|
|
||||||
SouthConnection = PipeDirection.South,
|
|
||||||
EastConnection = PipeDirection.East,
|
|
||||||
WestConnection = PipeDirection.West,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
using System;
|
|
||||||
using Content.Client.Markers;
|
using Content.Client.Markers;
|
||||||
using Content.Client.Popups;
|
using Content.Client.Popups;
|
||||||
|
using Content.Client.SubFloor;
|
||||||
using Content.Shared.SubFloor;
|
using Content.Shared.SubFloor;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
|
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
|
||||||
|
|
||||||
namespace Content.Client.Commands
|
namespace Content.Client.Commands
|
||||||
@@ -33,8 +31,7 @@ namespace Content.Client.Commands
|
|||||||
|
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
EntitySystem.Get<SubFloorHideSystem>()
|
EntitySystem.Get<SubFloorHideSystem>().ShowAll ^= true;
|
||||||
.ShowAll ^= true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,8 +44,7 @@ namespace Content.Client.Commands
|
|||||||
|
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
EntitySystem.Get<SubFloorHideSystem>()
|
EntitySystem.Get<SubFloorHideSystem>().ShowAll = true;
|
||||||
.ShowAll = true;
|
|
||||||
|
|
||||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||||
var components = entMan.EntityQuery<SubFloorHideComponent>(true);
|
var components = entMan.EntityQuery<SubFloorHideComponent>(true);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using Content.Client.Decals.UI;
|
using Content.Client.Decals.UI;
|
||||||
using Content.Client.HUD;
|
using Content.Client.HUD;
|
||||||
using Content.Client.Markers;
|
using Content.Client.Markers;
|
||||||
|
using Content.Client.SubFloor;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Content.Shared.Sandbox;
|
using Content.Shared.Sandbox;
|
||||||
using Content.Shared.SubFloor;
|
using Content.Shared.SubFloor;
|
||||||
|
|||||||
80
Content.Client/SubFloor/SubFloorHideSystem.cs
Normal file
80
Content.Client/SubFloor/SubFloorHideSystem.cs
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
using Content.Shared.SubFloor;
|
||||||
|
using Robust.Client.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Client.SubFloor;
|
||||||
|
|
||||||
|
public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
|
||||||
|
|
||||||
|
private bool _showAll;
|
||||||
|
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public bool ShowAll
|
||||||
|
{
|
||||||
|
get => _showAll;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_showAll == value) return;
|
||||||
|
_showAll = value;
|
||||||
|
|
||||||
|
UpdateAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<SubFloorHideComponent, AppearanceChangeEvent>(OnAppearanceChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAppearanceChanged(EntityUid uid, SubFloorHideComponent component, ref AppearanceChangeEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||||
|
return;
|
||||||
|
|
||||||
|
args.Component.TryGetData(SubFloorVisuals.Covered, out bool covered);
|
||||||
|
args.Component.TryGetData(SubFloorVisuals.ScannerRevealed, out bool scannerRevealed);
|
||||||
|
|
||||||
|
scannerRevealed &= !ShowAll; // no transparency for show-subfloor mode.
|
||||||
|
|
||||||
|
var revealed = !covered || ShowAll || scannerRevealed;
|
||||||
|
var transparency = scannerRevealed ? component.ScannerTransparency : 1f;
|
||||||
|
|
||||||
|
// set visibility & color of each layer
|
||||||
|
foreach (var layer in sprite.AllLayers)
|
||||||
|
{
|
||||||
|
// pipe connection visuals are updated AFTER this, and may re-hide some layers
|
||||||
|
layer.Visible = revealed;
|
||||||
|
|
||||||
|
if (layer.Visible)
|
||||||
|
layer.Color = layer.Color.WithAlpha(transparency);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is there some layer that is always visible?
|
||||||
|
if (sprite.LayerMapTryGet(SubfloorLayers.FirstLayer, out var firstLayer))
|
||||||
|
{
|
||||||
|
var layer = sprite[firstLayer];
|
||||||
|
layer.Visible = true;
|
||||||
|
layer.Color = layer.Color.WithAlpha(1f);
|
||||||
|
sprite.Visible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprite.Visible = revealed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateAll()
|
||||||
|
{
|
||||||
|
foreach (var (_, appearance) in EntityManager.EntityQuery<SubFloorHideComponent, AppearanceComponent>(true))
|
||||||
|
{
|
||||||
|
_appearanceSystem.MarkDirty(appearance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SubfloorLayers : byte
|
||||||
|
{
|
||||||
|
FirstLayer, // always visible. E.g. vent part of a vent..
|
||||||
|
}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using Content.Shared.SubFloor;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
|
|
||||||
namespace Content.Client.SubFloor
|
|
||||||
{
|
|
||||||
[UsedImplicitly]
|
|
||||||
public class SubFloorShowLayerVisualizer : AppearanceVisualizer
|
|
||||||
{
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
|
||||||
{
|
|
||||||
base.OnChangeData(component);
|
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
|
||||||
if (!entities.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!component.TryGetData(SubFloorVisuals.SubFloor, out bool subfloor))
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (var layer in sprite.AllLayers)
|
|
||||||
{
|
|
||||||
layer.Visible = subfloor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sprite.LayerMapTryGet(Layers.FirstLayer, out var firstLayer))
|
|
||||||
{
|
|
||||||
sprite.Visible = subfloor;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// show the top part of the sprite. E.g. the grille-part of a vent, but not the connecting pipes.
|
|
||||||
sprite.LayerSetVisible(firstLayer, true);
|
|
||||||
sprite.Visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Layers : byte
|
|
||||||
{
|
|
||||||
FirstLayer,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Maths;
|
|
||||||
|
|
||||||
namespace Content.Client.SubFloor;
|
|
||||||
|
|
||||||
public class TrayScannerSubFloorVisualizer : AppearanceVisualizer
|
|
||||||
{
|
|
||||||
[Dependency] IEntityManager _entityManager = default!;
|
|
||||||
|
|
||||||
public override void InitializeEntity(EntityUid uid)
|
|
||||||
{
|
|
||||||
base.InitializeEntity(uid);
|
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
|
||||||
{
|
|
||||||
base.OnChangeData(component);
|
|
||||||
|
|
||||||
if (!_entityManager.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!component.TryGetData(TrayScannerTransparency.Key, out bool transparent))
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (var layer in sprite.AllLayers)
|
|
||||||
{
|
|
||||||
var transparency = transparent == true ? 0.8f : 1f;
|
|
||||||
layer.Color = layer.Color.WithAlpha(transparency);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sprite.LayerMapTryGet(SubFloorShowLayerVisualizer.Layers.FirstLayer, out var firstLayer))
|
|
||||||
{
|
|
||||||
sprite.LayerSetColor(firstLayer, Color.White);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum TrayScannerTransparency
|
|
||||||
{
|
|
||||||
Key,
|
|
||||||
}
|
|
||||||
@@ -2,14 +2,12 @@ using Content.Server.NodeContainer;
|
|||||||
using Content.Server.NodeContainer.EntitySystems;
|
using Content.Server.NodeContainer.EntitySystems;
|
||||||
using Content.Server.NodeContainer.Nodes;
|
using Content.Server.NodeContainer.Nodes;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Robust.Shared.GameObjects;
|
using Content.Shared.Atmos.Components;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Content.Server.Atmos.Piping.EntitySystems;
|
namespace Content.Server.Atmos.Piping.EntitySystems;
|
||||||
|
|
||||||
public sealed class AtmosPipeNodeAppearanceSystem : EntitySystem
|
public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
@@ -17,17 +15,12 @@ public sealed class AtmosPipeNodeAppearanceSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
// This should probably just be a directed event, but that would require a weird component that exists only to
|
SubscribeLocalEvent<PipeAppearanceComponent, NodeGroupsRebuilt>(OnNodeUpdate);
|
||||||
// receive directed events (*cough* *cough* CableVisComponent *cough*).
|
|
||||||
//
|
|
||||||
// Really I want to target any entity with a PipeConnectorVisualizer or a NodeContainerComponent that contains a
|
|
||||||
// pipe-node. But I don't know of nice way of doing that.
|
|
||||||
SubscribeLocalEvent<NodeGroupsRebuilt>(OnNodeUpdate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnNodeUpdate(ref NodeGroupsRebuilt ev)
|
private void OnNodeUpdate(EntityUid uid, PipeAppearanceComponent component, ref NodeGroupsRebuilt args)
|
||||||
{
|
{
|
||||||
UpdateAppearance(ev.NodeOwner);
|
UpdateAppearance(args.NodeOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAppearance(EntityUid uid, AppearanceComponent? appearance = null, NodeContainerComponent? container = null,
|
private void UpdateAppearance(EntityUid uid, AppearanceComponent? appearance = null, NodeContainerComponent? container = null,
|
||||||
7
Content.Server/SubFloor/SubFloorHideSystem.cs
Normal file
7
Content.Server/SubFloor/SubFloorHideSystem.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
using Content.Shared.SubFloor;
|
||||||
|
|
||||||
|
namespace Content.Server.SubFloor;
|
||||||
|
|
||||||
|
public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Content.Shared.SubFloor;
|
|
||||||
|
|
||||||
namespace Content.Server.SubFloor;
|
|
||||||
|
|
||||||
public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|
||||||
{
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
11
Content.Shared/Atmos/Components/PipeAppearanceComponent.cs
Normal file
11
Content.Shared/Atmos/Components/PipeAppearanceComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Content.Shared.Atmos.Components;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class PipeAppearanceComponent : Component
|
||||||
|
{
|
||||||
|
[DataField("rsi")]
|
||||||
|
public string RsiPath = "Structures/Piping/Atmospherics/pipe.rsi";
|
||||||
|
|
||||||
|
[DataField("baseState")]
|
||||||
|
public string BaseState = "pipeConnector";
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameStates;
|
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
@@ -11,26 +10,11 @@ namespace Content.Shared.SubFloor
|
|||||||
/// Entity system backing <see cref="SubFloorHideComponent"/>.
|
/// Entity system backing <see cref="SubFloorHideComponent"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class SubFloorHideSystem : EntitySystem
|
public abstract class SharedSubFloorHideSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||||
[Dependency] private readonly SharedTrayScannerSystem _trayScannerSystem = default!;
|
[Dependency] private readonly TrayScannerSystem _trayScannerSystem = default!;
|
||||||
|
|
||||||
private bool _showAll;
|
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public bool ShowAll
|
|
||||||
{
|
|
||||||
get => _showAll;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_showAll == value) return;
|
|
||||||
_showAll = value;
|
|
||||||
|
|
||||||
UpdateAll();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -42,7 +26,6 @@ namespace Content.Shared.SubFloor
|
|||||||
SubscribeLocalEvent<SubFloorHideComponent, ComponentStartup>(OnSubFloorStarted);
|
SubscribeLocalEvent<SubFloorHideComponent, ComponentStartup>(OnSubFloorStarted);
|
||||||
SubscribeLocalEvent<SubFloorHideComponent, ComponentShutdown>(OnSubFloorTerminating);
|
SubscribeLocalEvent<SubFloorHideComponent, ComponentShutdown>(OnSubFloorTerminating);
|
||||||
SubscribeLocalEvent<SubFloorHideComponent, AnchorStateChangedEvent>(HandleAnchorChanged);
|
SubscribeLocalEvent<SubFloorHideComponent, AnchorStateChangedEvent>(HandleAnchorChanged);
|
||||||
SubscribeLocalEvent<SubFloorHideComponent, ComponentHandleState>(HandleComponentState);
|
|
||||||
SubscribeLocalEvent<SubFloorHideComponent, InteractUsingEvent>(OnInteractionAttempt);
|
SubscribeLocalEvent<SubFloorHideComponent, InteractUsingEvent>(OnInteractionAttempt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,13 +37,6 @@ namespace Content.Shared.SubFloor
|
|||||||
_mapManager.TileChanged -= MapManagerOnTileChanged;
|
_mapManager.TileChanged -= MapManagerOnTileChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetEnabled(SubFloorHideComponent subFloor, bool enabled)
|
|
||||||
{
|
|
||||||
subFloor.Enabled = enabled;
|
|
||||||
Dirty(subFloor);
|
|
||||||
UpdateAppearance(subFloor.Owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInteractionAttempt(EntityUid uid, SubFloorHideComponent component, InteractUsingEvent args)
|
private void OnInteractionAttempt(EntityUid uid, SubFloorHideComponent component, InteractUsingEvent args)
|
||||||
{
|
{
|
||||||
// TODO make this use an interact attempt event or something. Handling an InteractUsing is not going to work in general.
|
// TODO make this use an interact attempt event or something. Handling an InteractUsing is not going to work in general.
|
||||||
@@ -103,17 +79,14 @@ namespace Content.Shared.SubFloor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleComponentState(EntityUid uid, SubFloorHideComponent component, ref ComponentHandleState args)
|
|
||||||
{
|
|
||||||
if (args.Current is not SubFloorHideComponentState state)
|
|
||||||
return;
|
|
||||||
|
|
||||||
component.Enabled = state.Enabled;
|
|
||||||
UpdateAppearance(uid, component);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MapManagerOnTileChanged(object? sender, TileChangedEventArgs e)
|
private void MapManagerOnTileChanged(object? sender, TileChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (e.OldTile.IsEmpty)
|
||||||
|
return; // Nothing is anchored here anyways.
|
||||||
|
|
||||||
|
if (e.NewTile.Tile.IsEmpty)
|
||||||
|
return; // Anything that was here will be unanchored anyways.
|
||||||
|
|
||||||
UpdateTile(_mapManager.GetGrid(e.NewTile.GridIndex), e.NewTile.GridIndices);
|
UpdateTile(_mapManager.GetGrid(e.NewTile.GridIndex), e.NewTile.GridIndices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +111,6 @@ namespace Content.Shared.SubFloor
|
|||||||
else
|
else
|
||||||
component.IsUnderCover = false;
|
component.IsUnderCover = false;
|
||||||
|
|
||||||
// Update normally.
|
|
||||||
UpdateAppearance(uid, component);
|
UpdateAppearance(uid, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,14 +121,6 @@ namespace Content.Shared.SubFloor
|
|||||||
return !tileDef.IsSubFloor;
|
return !tileDef.IsSubFloor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAll()
|
|
||||||
{
|
|
||||||
foreach (var comp in EntityManager.EntityQuery<SubFloorHideComponent>(true))
|
|
||||||
{
|
|
||||||
UpdateAppearance(comp.Owner, comp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateTile(IMapGrid grid, Vector2i position)
|
private void UpdateTile(IMapGrid grid, Vector2i position)
|
||||||
{
|
{
|
||||||
var covered = HasFloorCover(grid, position);
|
var covered = HasFloorCover(grid, position);
|
||||||
@@ -177,7 +141,7 @@ namespace Content.Shared.SubFloor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is used by T-Ray scanners or other sub-floor revealing entities to toggle visibility.
|
/// This function is used by T-Ray scanners or other sub-floor revealing entities to toggle visibility.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetEntitiesRevealed(IEnumerable<EntityUid> entities, EntityUid revealer, bool visible, IEnumerable<object>? appearanceKeys = null)
|
public void SetEntitiesRevealed(IEnumerable<EntityUid> entities, EntityUid revealer, bool visible)
|
||||||
{
|
{
|
||||||
foreach (var uid in entities)
|
foreach (var uid in entities)
|
||||||
{
|
{
|
||||||
@@ -188,77 +152,40 @@ namespace Content.Shared.SubFloor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is used by T-Ray scanners or other sub-floor revealing entities to toggle visibility.
|
/// This function is used by T-Ray scanners or other sub-floor revealing entities to toggle visibility.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetEntityRevealed(EntityUid uid, EntityUid revealer, bool visible,
|
public void SetEntityRevealed(EntityUid uid, EntityUid revealer, bool visible, SubFloorHideComponent? hideComp = null)
|
||||||
SubFloorHideComponent? hideComp = null,
|
|
||||||
IEnumerable<object>? appearanceKeys = null)
|
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref hideComp))
|
if (!Resolve(uid, ref hideComp, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
{
|
||||||
if (hideComp.RevealedBy.Add(revealer) && hideComp.RevealedBy.Count == 1)
|
if (hideComp.RevealedBy.Add(revealer) && hideComp.RevealedBy.Count == 1)
|
||||||
UpdateAppearance(uid, hideComp, appearanceKeys);
|
UpdateAppearance(uid, hideComp);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hideComp.RevealedBy.Remove(revealer) && hideComp.RevealedBy.Count == 0)
|
if (hideComp.RevealedBy.Remove(revealer) && hideComp.RevealedBy.Count == 0)
|
||||||
UpdateAppearance(uid, hideComp, appearanceKeys);
|
UpdateAppearance(uid, hideComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateAppearance(EntityUid uid, SubFloorHideComponent? hideComp = null, IEnumerable<object>? appearanceKeys = null)
|
public void UpdateAppearance(
|
||||||
|
EntityUid uid,
|
||||||
|
SubFloorHideComponent? hideComp = null,
|
||||||
|
AppearanceComponent? appearance = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref hideComp))
|
if (!Resolve(uid, ref hideComp, ref appearance, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var revealedWithoutEntity = ShowAll || !hideComp.IsUnderCover;
|
appearance.SetData(SubFloorVisuals.Covered, hideComp.IsUnderCover);
|
||||||
var revealed = revealedWithoutEntity || hideComp.RevealedBy.Count != 0;
|
appearance.SetData(SubFloorVisuals.ScannerRevealed, hideComp.RevealedBy.Count != 0);
|
||||||
|
|
||||||
// if there are no keys given,
|
|
||||||
// or if the subfloor is already revealed,
|
|
||||||
// set the keys to the default:
|
|
||||||
//
|
|
||||||
// the reason why it's set to default when the subfloor is
|
|
||||||
// revealed without an entity is because the appearance keys
|
|
||||||
// should only apply if the visualizer is underneath a subfloor
|
|
||||||
if (appearanceKeys == null || revealedWithoutEntity) appearanceKeys = _defaultVisualizerKeys;
|
|
||||||
|
|
||||||
ShowSubfloorSprite(uid, revealed, appearanceKeys);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSubfloorSprite(EntityUid uid, bool revealed, IEnumerable<object> appearanceKeys)
|
|
||||||
{
|
|
||||||
// Show sprite
|
|
||||||
if (EntityManager.TryGetComponent(uid, out SharedSpriteComponent? spriteComponent))
|
|
||||||
{
|
|
||||||
spriteComponent.Visible = revealed;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set an appearance data value so visualizers can use this as needed.
|
|
||||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
|
|
||||||
{
|
|
||||||
foreach (var key in appearanceKeys)
|
|
||||||
{
|
|
||||||
switch (key)
|
|
||||||
{
|
|
||||||
case Enum enumKey:
|
|
||||||
appearanceComponent.SetData(enumKey, revealed);
|
|
||||||
break;
|
|
||||||
case string stringKey:
|
|
||||||
appearanceComponent.SetData(stringKey, revealed);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<object> _defaultVisualizerKeys = new List<object>{ SubFloorVisuals.SubFloor };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public enum SubFloorVisuals : byte
|
public enum SubFloorVisuals : byte
|
||||||
{
|
{
|
||||||
SubFloor,
|
Covered, // is there a floor tile over this entity
|
||||||
|
ScannerRevealed, // is this entity revealed by a scanner or some other entity?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
using Content.Shared.Interaction;
|
|
||||||
using Robust.Shared.GameStates;
|
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
|
|
||||||
namespace Content.Shared.SubFloor;
|
|
||||||
|
|
||||||
public abstract class SharedTrayScannerSystem : EntitySystem
|
|
||||||
{
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
SubscribeLocalEvent<TrayScannerComponent, ComponentGetState>(OnTrayScannerGetState);
|
|
||||||
SubscribeLocalEvent<TrayScannerComponent, ComponentHandleState>(OnTrayScannerHandleState);
|
|
||||||
SubscribeLocalEvent<TrayScannerComponent, ActivateInWorldEvent>(OnTrayScannerActivate);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTrayScannerActivate(EntityUid uid, TrayScannerComponent scanner, ActivateInWorldEvent args)
|
|
||||||
{
|
|
||||||
ActivateTray(uid, scanner);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ActivateTray(EntityUid uid, TrayScannerComponent? scanner = null)
|
|
||||||
{
|
|
||||||
if (!Resolve(uid, ref scanner))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ToggleTrayScanner(uid, !scanner.Toggled, scanner);
|
|
||||||
if (EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
|
|
||||||
{
|
|
||||||
appearance.SetData(TrayScannerVisual.Visual, scanner.Toggled == true ? TrayScannerVisual.On : TrayScannerVisual.Off);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void ToggleTrayScanner(EntityUid uid, bool state, TrayScannerComponent? scanner = null)
|
|
||||||
{
|
|
||||||
if (!Resolve(uid, ref scanner))
|
|
||||||
return;
|
|
||||||
|
|
||||||
scanner.Toggled = state;
|
|
||||||
scanner.Dirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTrayScannerGetState(EntityUid uid, TrayScannerComponent scanner, ref ComponentGetState args)
|
|
||||||
{
|
|
||||||
args.State = new TrayScannerState(scanner.Toggled);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTrayScannerHandleState(EntityUid uid, TrayScannerComponent scanner, ref ComponentHandleState args)
|
|
||||||
{
|
|
||||||
if (args.Current is not TrayScannerState state)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ToggleTrayScanner(uid, state.Toggled, scanner);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnSubfloorAnchored(EntityUid uid, SubFloorHideComponent? hideComp = null, TransformComponent? xform = null)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public enum TrayScannerVisual : sbyte
|
|
||||||
{
|
|
||||||
Visual,
|
|
||||||
On,
|
|
||||||
Off
|
|
||||||
}
|
|
||||||
@@ -5,49 +5,26 @@ namespace Content.Shared.SubFloor
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simple component that automatically hides the sibling
|
/// Simple component that automatically hides the sibling
|
||||||
/// <see cref="ISpriteComponent" /> when the tile it's on is not a sub floor
|
/// <see cref="SpriteComponent" /> when the tile it's on is not a sub floor
|
||||||
/// (plating).
|
/// (plating).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <seealso cref="P:Content.Shared.Maps.ContentTileDefinition.IsSubFloor" />
|
/// <seealso cref="P:Content.Shared.Maps.ContentTileDefinition.IsSubFloor" />
|
||||||
[NetworkedComponent]
|
[NetworkedComponent]
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[Friend(typeof(SubFloorHideSystem))]
|
[Friend(typeof(SharedSubFloorHideSystem))]
|
||||||
public sealed class SubFloorHideComponent : Component
|
public sealed class SubFloorHideComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Whether the entity will be hid when not in subfloor.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
[DataField("enabled")]
|
|
||||||
public bool Enabled { get; set; } = true;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the entity's current position has a "Floor-type" tile above its current position.
|
/// Whether the entity's current position has a "Floor-type" tile above its current position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[ViewVariables]
|
||||||
public bool IsUnderCover { get; set; } = false;
|
public bool IsUnderCover { get; set; } = false;
|
||||||
|
|
||||||
/*
|
|
||||||
* An un-anchored hiding entity would require listening to on-move events in case it moves into a sub-floor
|
|
||||||
* tile. Also T-Ray scanner headaches.
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This entity needs to be anchored to be hid when not in subfloor.
|
/// When revealed using some scanning tool, what transparency should be used to draw this item?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[DataField("scannerTransparency")]
|
||||||
[DataField("requireAnchored")]
|
public float ScannerTransparency = 0.8f;
|
||||||
public bool RequireAnchored { get; set; } = true;
|
|
||||||
*/
|
|
||||||
|
|
||||||
public override ComponentState GetComponentState()
|
|
||||||
{
|
|
||||||
return new SubFloorHideComponentState(Enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether or not this entity is supposed
|
|
||||||
/// to be visible.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables]
|
|
||||||
public bool Visible { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The entities this subfloor is revealed by.
|
/// The entities this subfloor is revealed by.
|
||||||
@@ -55,15 +32,4 @@ namespace Content.Shared.SubFloor
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public HashSet<EntityUid> RevealedBy { get; set; } = new();
|
public HashSet<EntityUid> RevealedBy { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public sealed class SubFloorHideComponentState : ComponentState
|
|
||||||
{
|
|
||||||
public bool Enabled { get; }
|
|
||||||
|
|
||||||
public SubFloorHideComponentState(bool enabled)
|
|
||||||
{
|
|
||||||
Enabled = enabled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,33 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Maths;
|
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
|
||||||
using Robust.Shared.ViewVariables;
|
|
||||||
|
|
||||||
namespace Content.Shared.SubFloor;
|
namespace Content.Shared.SubFloor;
|
||||||
|
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[NetworkedComponent]
|
[NetworkedComponent]
|
||||||
public class TrayScannerComponent : Component
|
public sealed class TrayScannerComponent : Component
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the scanner is currently on.
|
||||||
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public bool Toggled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
|
|
||||||
// this should always be rounded
|
/// <summary>
|
||||||
|
/// Last position of the scanner. Rounded to integers to avoid excessive entity lookups when moving.
|
||||||
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public Vector2 LastLocation { get; set; }
|
public Vector2i? LastLocation { get; set; }
|
||||||
|
|
||||||
// range of the scanner itself
|
/// <summary>
|
||||||
|
/// Radius in which the scanner will reveal entities. Centered on the <see cref="LastLocation"/>.
|
||||||
|
/// </summary>
|
||||||
[DataField("range")]
|
[DataField("range")]
|
||||||
public float Range { get; set; } = 2f;
|
public float Range { get; set; } = 2.5f;
|
||||||
|
|
||||||
// exclude entities that are not the set
|
/// <summary>
|
||||||
// of entities in range & entities already revealed
|
/// The sub-floor entities that this scanner is currently revealing.
|
||||||
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public HashSet<EntityUid> RevealedSubfloors = new();
|
public HashSet<EntityUid> RevealedSubfloors = new();
|
||||||
}
|
}
|
||||||
@@ -33,10 +35,10 @@ public class TrayScannerComponent : Component
|
|||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public sealed class TrayScannerState : ComponentState
|
public sealed class TrayScannerState : ComponentState
|
||||||
{
|
{
|
||||||
public bool Toggled { get; }
|
public bool Enabled;
|
||||||
|
|
||||||
public TrayScannerState(bool toggle)
|
public TrayScannerState(bool enabled)
|
||||||
{
|
{
|
||||||
Toggled = toggle;
|
Enabled = enabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,88 @@
|
|||||||
using System.Linq;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.SubFloor;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Content.Client.SubFloor;
|
namespace Content.Shared.SubFloor;
|
||||||
|
|
||||||
public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
public sealed class TrayScannerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private IMapManager _mapManager = default!;
|
[Dependency] private IMapManager _mapManager = default!;
|
||||||
[Dependency] private SubFloorHideSystem _subfloorSystem = default!;
|
[Dependency] private IGameTiming _gameTiming = default!;
|
||||||
|
[Dependency] private SharedSubFloorHideSystem _subfloorSystem = default!;
|
||||||
[Dependency] private SharedContainerSystem _containerSystem = default!;
|
[Dependency] private SharedContainerSystem _containerSystem = default!;
|
||||||
|
|
||||||
|
private HashSet<EntityUid> _activeScanners = new();
|
||||||
|
private RemQueue<EntityUid> _invalidScanners = new();
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
UpdatesOutsidePrediction = true;
|
|
||||||
|
|
||||||
SubscribeLocalEvent<TrayScannerComponent, ComponentShutdown>(OnComponentShutdown);
|
SubscribeLocalEvent<TrayScannerComponent, ComponentShutdown>(OnComponentShutdown);
|
||||||
|
SubscribeLocalEvent<TrayScannerComponent, ComponentGetState>(OnTrayScannerGetState);
|
||||||
|
SubscribeLocalEvent<TrayScannerComponent, ComponentHandleState>(OnTrayScannerHandleState);
|
||||||
|
SubscribeLocalEvent<TrayScannerComponent, ActivateInWorldEvent>(OnTrayScannerActivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnComponentShutdown(EntityUid uid, TrayScannerComponent scanner, ComponentShutdown args)
|
private void OnTrayScannerActivate(EntityUid uid, TrayScannerComponent scanner, ActivateInWorldEvent args)
|
||||||
{
|
{
|
||||||
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false, _visualizerKeys);
|
SetScannerEnabled(uid, !scanner.Enabled, scanner);
|
||||||
_invalidScanners.Add(uid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ToggleTrayScanner(EntityUid uid, bool toggle, TrayScannerComponent? scanner = null)
|
private void SetScannerEnabled(EntityUid uid, bool enabled, TrayScannerComponent? scanner = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref scanner))
|
if (!Resolve(uid, ref scanner))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scanner.Toggled = toggle;
|
scanner.Enabled = enabled;
|
||||||
UpdateTrayScanner(uid, scanner);
|
scanner.Dirty();
|
||||||
|
|
||||||
if (toggle) _activeScanners.Add(uid);
|
if (scanner.Enabled)
|
||||||
|
_activeScanners.Add(uid);
|
||||||
|
|
||||||
|
// We don't remove from _activeScanners on disabled, because the update function will handle that, as well as
|
||||||
|
// managing the revealed subfloor entities
|
||||||
|
|
||||||
|
if (EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
|
||||||
|
{
|
||||||
|
appearance.SetData(TrayScannerVisual.Visual, scanner.Enabled == true ? TrayScannerVisual.On : TrayScannerVisual.Off);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private HashSet<EntityUid> _activeScanners = new();
|
private void OnTrayScannerGetState(EntityUid uid, TrayScannerComponent scanner, ref ComponentGetState args)
|
||||||
private RemQueue<EntityUid> _invalidScanners = new();
|
{
|
||||||
|
args.State = new TrayScannerState(scanner.Enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTrayScannerHandleState(EntityUid uid, TrayScannerComponent scanner, ref ComponentHandleState args)
|
||||||
|
{
|
||||||
|
if (args.Current is not TrayScannerState state)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetScannerEnabled(uid, scanner.Enabled, scanner);
|
||||||
|
|
||||||
|
// This is hacky and somewhat inefficient for the client. But when resetting predicted entities we have to unset
|
||||||
|
// last position. This is because appearance data gets reset, but if the position isn't reset the scanner won't
|
||||||
|
// re-reveal entities leading to odd visuals.
|
||||||
|
scanner.LastLocation = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnComponentShutdown(EntityUid uid, TrayScannerComponent scanner, ComponentShutdown args)
|
||||||
|
{
|
||||||
|
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false);
|
||||||
|
_activeScanners.Remove(uid);
|
||||||
|
}
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
|
if (!_gameTiming.IsFirstTimePredicted)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!_activeScanners.Any()) return;
|
if (!_activeScanners.Any()) return;
|
||||||
|
|
||||||
foreach (var scanner in _activeScanners)
|
foreach (var scanner in _activeScanners)
|
||||||
@@ -58,13 +98,13 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|||||||
foreach (var invalidScanner in _invalidScanners)
|
foreach (var invalidScanner in _invalidScanners)
|
||||||
_activeScanners.Remove(invalidScanner);
|
_activeScanners.Remove(invalidScanner);
|
||||||
|
|
||||||
if (_invalidScanners.List != null) _invalidScanners.List.Clear();
|
_invalidScanners.List?.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When a subfloor entity gets anchored (which includes spawning & coming into PVS range), Check for nearby scanners.
|
/// When a subfloor entity gets anchored (which includes spawning & coming into PVS range), Check for nearby scanners.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void OnSubfloorAnchored(EntityUid uid, SubFloorHideComponent? hideComp = null, TransformComponent? xform = null)
|
public void OnSubfloorAnchored(EntityUid uid, SubFloorHideComponent? hideComp = null, TransformComponent? xform = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref hideComp, ref xform))
|
if (!Resolve(uid, ref hideComp, ref xform))
|
||||||
return;
|
return;
|
||||||
@@ -92,67 +132,62 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|||||||
/// <returns>true if the update was successful, false otherwise</returns>
|
/// <returns>true if the update was successful, false otherwise</returns>
|
||||||
private bool UpdateTrayScanner(EntityUid uid, TrayScannerComponent? scanner = null, TransformComponent? transform = null)
|
private bool UpdateTrayScanner(EntityUid uid, TrayScannerComponent? scanner = null, TransformComponent? transform = null)
|
||||||
{
|
{
|
||||||
// whoops?
|
|
||||||
if (!Resolve(uid, ref scanner, ref transform))
|
if (!Resolve(uid, ref scanner, ref transform))
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// if the scanner was toggled off recently,
|
// if the scanner was toggled off recently,
|
||||||
// set all the known subfloor to invisible,
|
// set all the known subfloor to invisible,
|
||||||
// and return false so it's removed from
|
// and return false so it's removed from
|
||||||
// the active scanner list
|
// the active scanner list
|
||||||
if (!scanner.Toggled || transform.MapID == MapId.Nullspace)
|
if (!scanner.Enabled || transform.MapID == MapId.Nullspace)
|
||||||
{
|
{
|
||||||
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false, _visualizerKeys);
|
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false);
|
||||||
scanner.LastLocation = Vector2.Zero;
|
scanner.LastLocation = null;
|
||||||
scanner.RevealedSubfloors.Clear();
|
scanner.RevealedSubfloors.Clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the rounded position so that small movements don't cause this to
|
var pos = transform.LocalPosition;
|
||||||
// update every time
|
|
||||||
Vector2 flooredPos;
|
|
||||||
|
|
||||||
// zero vector implies container
|
// zero vector implies container
|
||||||
//
|
//
|
||||||
// this means we should get the entity transform's parent
|
// this means we should get the entity transform's parent
|
||||||
if (transform.LocalPosition == Vector2.Zero
|
if (pos == Vector2.Zero
|
||||||
&& transform.Parent != null
|
&& transform.Parent != null
|
||||||
&& _containerSystem.ContainsEntity(transform.ParentUid, uid))
|
&& _containerSystem.ContainsEntity(transform.ParentUid, uid))
|
||||||
{
|
{
|
||||||
flooredPos = transform.Parent.LocalPosition.Rounded();
|
pos = transform.Parent.LocalPosition;
|
||||||
|
|
||||||
// if this is also zero, we can check one more time
|
// if this is also zero, we can check one more time
|
||||||
//
|
//
|
||||||
// could recurse through fully but i think that's useless,
|
// could recurse through fully but i think that's useless,
|
||||||
// just attempt to check through the gp's transform and if
|
// just attempt to check through the gp's transform and if
|
||||||
// that doesn't work, just don't bother any further
|
// that doesn't work, just don't bother any further
|
||||||
if (flooredPos == Vector2.Zero)
|
if (pos == Vector2.Zero)
|
||||||
{
|
{
|
||||||
var gpTransform = transform.Parent.Parent;
|
var gpTransform = transform.Parent.Parent;
|
||||||
if (gpTransform != null
|
if (gpTransform != null
|
||||||
&& _containerSystem.ContainsEntity(gpTransform.Owner, transform.ParentUid))
|
&& _containerSystem.ContainsEntity(gpTransform.Owner, transform.ParentUid))
|
||||||
{
|
{
|
||||||
flooredPos = gpTransform.LocalPosition.Rounded();
|
pos = gpTransform.LocalPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
flooredPos = transform.LocalPosition.Rounded();
|
|
||||||
}
|
|
||||||
|
|
||||||
// is the position still logically zero? just clear,
|
// is the position still logically zero? just clear,
|
||||||
// but we need to keep it as 'true' since this t-ray
|
// but we need to keep it as 'true' since this t-ray
|
||||||
// is still technically on
|
// is still technically on
|
||||||
if (flooredPos == Vector2.Zero)
|
if (pos == Vector2.Zero)
|
||||||
{
|
{
|
||||||
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false, _visualizerKeys);
|
_subfloorSystem.SetEntitiesRevealed(scanner.RevealedSubfloors, uid, false);
|
||||||
scanner.RevealedSubfloors.Clear();
|
scanner.RevealedSubfloors.Clear();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the rounded position so that small movements don't cause this to
|
||||||
|
// update every time
|
||||||
|
var flooredPos = (Vector2i) pos;
|
||||||
|
|
||||||
// MAYBE redo this. Currently different players can see different entities
|
// MAYBE redo this. Currently different players can see different entities
|
||||||
//
|
//
|
||||||
// Here we avoid the entity lookup & return early if the scanner's position hasn't appreciably changed. However,
|
// Here we avoid the entity lookup & return early if the scanner's position hasn't appreciably changed. However,
|
||||||
@@ -161,7 +196,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|||||||
// same scanner. The correct fix for this is probably just to network the revealed entity set.... But I CBF
|
// same scanner. The correct fix for this is probably just to network the revealed entity set.... But I CBF
|
||||||
// doing that right now....
|
// doing that right now....
|
||||||
if (flooredPos == scanner.LastLocation
|
if (flooredPos == scanner.LastLocation
|
||||||
|| (float.IsNaN(flooredPos.X) && float.IsNaN(flooredPos.Y)))
|
|| float.IsNaN(flooredPos.X) && float.IsNaN(flooredPos.Y))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
scanner.LastLocation = flooredPos;
|
scanner.LastLocation = flooredPos;
|
||||||
@@ -186,7 +221,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|||||||
nearby.Add(entity);
|
nearby.Add(entity);
|
||||||
|
|
||||||
if (scanner.RevealedSubfloors.Add(entity))
|
if (scanner.RevealedSubfloors.Add(entity))
|
||||||
_subfloorSystem.SetEntityRevealed(entity, uid, true, hideComp, _visualizerKeys);
|
_subfloorSystem.SetEntityRevealed(entity, uid, true, hideComp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,14 +232,16 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
|
|||||||
scanner.RevealedSubfloors.ExceptWith(missing);
|
scanner.RevealedSubfloors.ExceptWith(missing);
|
||||||
|
|
||||||
// and hide them
|
// and hide them
|
||||||
_subfloorSystem.SetEntitiesRevealed(missing, uid, false, _visualizerKeys);
|
_subfloorSystem.SetEntitiesRevealed(missing, uid, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private static IEnumerable<object> _visualizerKeys = new List<object>
|
|
||||||
{
|
[Serializable, NetSerializable]
|
||||||
SubFloorVisuals.SubFloor,
|
public enum TrayScannerVisual : sbyte
|
||||||
TrayScannerTransparency.Key
|
{
|
||||||
};
|
Visual,
|
||||||
|
On,
|
||||||
|
Off
|
||||||
}
|
}
|
||||||
@@ -33,11 +33,9 @@
|
|||||||
state: pipeStraight
|
state: pipeStraight
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: pumpPressure
|
- state: pumpPressure
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.PressurePumpVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.PressurePumpVisualizer+Layers.Enabled" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: PressurePumpVisualizer
|
- type: PressurePumpVisualizer
|
||||||
disabledState: pumpPressure
|
disabledState: pumpPressure
|
||||||
@@ -64,11 +62,9 @@
|
|||||||
state: pipeStraight
|
state: pipeStraight
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: pumpVolume
|
- state: pumpVolume
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasVolumePump
|
- type: GasVolumePump
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
@@ -92,11 +88,9 @@
|
|||||||
state: pipeStraight
|
state: pipeStraight
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: pumpPassiveGate
|
- state: pumpPassiveGate
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasPassiveGate
|
- type: GasPassiveGate
|
||||||
|
|
||||||
@@ -117,11 +111,9 @@
|
|||||||
state: pipeStraight
|
state: pipeStraight
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: pumpManualValve
|
- state: pumpManualValve
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.GasValveVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasValveVisualizer+Layers.Enabled" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasValveVisualizer
|
- type: GasValveVisualizer
|
||||||
disabledState: pumpManualValve
|
disabledState: pumpManualValve
|
||||||
@@ -156,11 +148,9 @@
|
|||||||
state: pipeHalf
|
state: pipeHalf
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: gasCanisterPort
|
- state: gasCanisterPort
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasPort
|
- type: GasPort
|
||||||
- type: NodeContainer
|
- type: NodeContainer
|
||||||
@@ -187,11 +177,9 @@
|
|||||||
state: pipeStraight
|
state: pipeStraight
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: vent_off
|
- state: vent_off
|
||||||
map: [ "enum.VentVisualLayers.Vent", "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.VentVisualLayers.Vent", "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: VentPumpVisualizer
|
- type: VentPumpVisualizer
|
||||||
- type: GasVentPump
|
- type: GasVentPump
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
damageContainer: Inorganic
|
damageContainer: Inorganic
|
||||||
damageModifierSet: Metallic
|
damageModifierSet: Metallic
|
||||||
- type: SubFloorHide
|
- type: SubFloorHide
|
||||||
|
- type: PipeAppearance
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
- type: Rotatable
|
- type: Rotatable
|
||||||
- type: Pullable
|
- type: Pullable
|
||||||
@@ -57,9 +58,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: NodeContainer
|
- type: NodeContainer
|
||||||
- type: AtmosUnsafeUnanchor
|
- type: AtmosUnsafeUnanchor
|
||||||
- type: AtmosPipeColor
|
- type: AtmosPipeColor
|
||||||
|
|||||||
@@ -39,11 +39,9 @@
|
|||||||
rotation: -90 # fuck you!!! who cares
|
rotation: -90 # fuck you!!! who cares
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: gasFilter
|
- state: gasFilter
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasFilterVisualizer
|
- type: GasFilterVisualizer
|
||||||
disabledState: gasFilter
|
disabledState: gasFilter
|
||||||
@@ -73,13 +71,11 @@
|
|||||||
rotation: -90
|
rotation: -90
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: gasFilterF
|
- state: gasFilterF
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
||||||
- type: Flippable
|
- type: Flippable
|
||||||
mirrorEntity: GasFilter
|
mirrorEntity: GasFilter
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasFilterVisualizer
|
- type: GasFilterVisualizer
|
||||||
disabledState: gasFilterF
|
disabledState: gasFilterF
|
||||||
@@ -116,11 +112,9 @@
|
|||||||
rotation: -90
|
rotation: -90
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: gasMixer
|
- state: gasMixer
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasFilterVisualizer
|
- type: GasFilterVisualizer
|
||||||
disabledState: gasMixer
|
disabledState: gasMixer
|
||||||
@@ -152,11 +146,9 @@
|
|||||||
rotation: -90
|
rotation: -90
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: gasMixerF
|
- state: gasMixerF
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasFilterVisualizer
|
- type: GasFilterVisualizer
|
||||||
disabledState: gasMixerF
|
disabledState: gasMixerF
|
||||||
|
|||||||
@@ -39,11 +39,9 @@
|
|||||||
state: pipeHalf
|
state: pipeHalf
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: vent_off
|
- state: vent_off
|
||||||
map: [ "enum.VentVisualLayers.Vent", "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.VentVisualLayers.Vent", "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: VentPumpVisualizer
|
- type: VentPumpVisualizer
|
||||||
- type: GasVentPump
|
- type: GasVentPump
|
||||||
@@ -66,11 +64,9 @@
|
|||||||
state: pipeHalf
|
state: pipeHalf
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: vent_off
|
- state: vent_off
|
||||||
map: [ "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasPassiveVent
|
- type: GasPassiveVent
|
||||||
|
|
||||||
@@ -100,11 +96,9 @@
|
|||||||
state: pipeHalf
|
state: pipeHalf
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- state: scrub_off
|
- state: scrub_off
|
||||||
map: [ "enum.ScrubberVisualLayers.Scrubber", "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.ScrubberVisualLayers.Scrubber", "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: ScrubberVisualizer
|
- type: ScrubberVisualizer
|
||||||
- type: AtmosDevice
|
- type: AtmosDevice
|
||||||
@@ -126,11 +120,9 @@
|
|||||||
layers:
|
layers:
|
||||||
- state: pipeHalf
|
- state: pipeHalf
|
||||||
sprite: Structures/Piping/Atmospherics/pipe.rsi
|
sprite: Structures/Piping/Atmospherics/pipe.rsi
|
||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe", "enum.SubFloorShowLayerVisualizer+Layers.FirstLayer" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe", "enum.SubfloorLayers.FirstLayer" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: GasOutletInjector
|
- type: GasOutletInjector
|
||||||
|
|
||||||
@@ -149,7 +141,6 @@
|
|||||||
noRot: true
|
noRot: true
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: Rotatable
|
- type: Rotatable
|
||||||
- type: GasThermoMachine
|
- type: GasThermoMachine
|
||||||
@@ -177,7 +168,6 @@
|
|||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: ThermoMachineVisualizer
|
- type: ThermoMachineVisualizer
|
||||||
disabledState: freezer_off
|
disabledState: freezer_off
|
||||||
@@ -201,7 +191,6 @@
|
|||||||
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
|
||||||
- type: PipeColorVisualizer
|
- type: PipeColorVisualizer
|
||||||
- type: ThermoMachineVisualizer
|
- type: ThermoMachineVisualizer
|
||||||
disabledState: heater_off
|
disabledState: heater_off
|
||||||
|
|||||||
@@ -60,10 +60,6 @@
|
|||||||
drawdepth: ThickPipe
|
drawdepth: ThickPipe
|
||||||
sprite: Structures/Piping/disposal.rsi
|
sprite: Structures/Piping/disposal.rsi
|
||||||
state: pipe-b
|
state: pipe-b
|
||||||
- type: Appearance
|
|
||||||
visuals:
|
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: Fixtures
|
- type: Fixtures
|
||||||
fixtures:
|
fixtures:
|
||||||
@@ -88,8 +84,6 @@
|
|||||||
- type: DisposalTransit
|
- type: DisposalTransit
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-s
|
state_free: conpipe-s
|
||||||
state_anchored: pipe-s
|
state_anchored: pipe-s
|
||||||
@@ -117,8 +111,6 @@
|
|||||||
- type: DisposalTagger
|
- type: DisposalTagger
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-tagger
|
state_free: conpipe-tagger
|
||||||
state_anchored: pipe-tagger
|
state_anchored: pipe-tagger
|
||||||
@@ -150,8 +142,6 @@
|
|||||||
- type: DisposalEntry
|
- type: DisposalEntry
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-t
|
state_free: conpipe-t
|
||||||
state_anchored: pipe-t
|
state_anchored: pipe-t
|
||||||
@@ -183,8 +173,6 @@
|
|||||||
- 180
|
- 180
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-j1s
|
state_free: conpipe-j1s
|
||||||
state_anchored: pipe-j1s
|
state_anchored: pipe-j1s
|
||||||
@@ -221,8 +209,6 @@
|
|||||||
- 180
|
- 180
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-j2s
|
state_free: conpipe-j2s
|
||||||
state_anchored: pipe-j2s
|
state_anchored: pipe-j2s
|
||||||
@@ -253,8 +239,6 @@
|
|||||||
- 180
|
- 180
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-j1
|
state_free: conpipe-j1
|
||||||
state_anchored: pipe-j1
|
state_anchored: pipe-j1
|
||||||
@@ -287,8 +271,6 @@
|
|||||||
- 180
|
- 180
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-j2
|
state_free: conpipe-j2
|
||||||
state_anchored: pipe-j2
|
state_anchored: pipe-j2
|
||||||
@@ -319,8 +301,6 @@
|
|||||||
- -90
|
- -90
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-y
|
state_free: conpipe-y
|
||||||
state_anchored: pipe-y
|
state_anchored: pipe-y
|
||||||
@@ -348,8 +328,6 @@
|
|||||||
- type: DisposalBend
|
- type: DisposalBend
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: SubFloorShowLayerVisualizer
|
|
||||||
- type: DisposalVisualizer
|
- type: DisposalVisualizer
|
||||||
state_free: conpipe-c
|
state_free: conpipe-c
|
||||||
state_anchored: pipe-c
|
state_anchored: pipe-c
|
||||||
|
|||||||
@@ -84,7 +84,6 @@
|
|||||||
acts: [ "Destruction" ]
|
acts: [ "Destruction" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: CableVisualizer
|
- type: CableVisualizer
|
||||||
base: hvcable_
|
base: hvcable_
|
||||||
|
|
||||||
@@ -131,7 +130,6 @@
|
|||||||
acts: [ "Destruction" ]
|
acts: [ "Destruction" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: CableVisualizer
|
- type: CableVisualizer
|
||||||
base: mvcable_
|
base: mvcable_
|
||||||
|
|
||||||
@@ -181,6 +179,5 @@
|
|||||||
acts: [ "Destruction" ]
|
acts: [ "Destruction" ]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: TrayScannerSubFloorVisualizer
|
|
||||||
- type: CableVisualizer
|
- type: CableVisualizer
|
||||||
base: lvcable_
|
base: lvcable_
|
||||||
|
|||||||
Reference in New Issue
Block a user