Visualizer systems update (#8203)
* optimize appearance updating for subfloor entities * sprite event args * a * stop double appearance update.
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Client.SubFloor;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Components;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.SubFloor;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.ResourceManagement;
|
||||
@@ -48,6 +49,16 @@ public sealed class AtmosPipeAppearanceSystem : EntitySystem
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(SubFloorVisuals.Covered, out bool isUnderCover)
|
||||
&& isUnderCover
|
||||
&& args.Component.TryGetData(SubFloorVisuals.ScannerRevealed, out bool revealed)
|
||||
&& !revealed)
|
||||
{
|
||||
// This entity is below a floor and is not even visible to the user -> don't bother updating sprite data.
|
||||
// Note that if the subfloor visuals change, then another AppearanceChangeEvent will get triggered.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||
color = Color.White;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user