Fix gas pipe rotation rendering (#5015)
This commit is contained in:
@@ -63,6 +63,7 @@ namespace Content.Client.Atmos.Visualizers
|
|||||||
|
|
||||||
if (!component.Owner.TryGetComponent<ITransformComponent>(out var xform))
|
if (!component.Owner.TryGetComponent<ITransformComponent>(out var xform))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite))
|
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -75,10 +76,18 @@ namespace Content.Client.Atmos.Visualizers
|
|||||||
if(!component.TryGetData(SubFloorVisuals.SubFloor, out bool subfloor))
|
if(!component.TryGetData(SubFloorVisuals.SubFloor, out bool subfloor))
|
||||||
subfloor = true;
|
subfloor = true;
|
||||||
|
|
||||||
|
var rotation = xform.LocalRotation;
|
||||||
|
|
||||||
foreach (Layer layerKey in Enum.GetValues(typeof(Layer)))
|
foreach (Layer layerKey in Enum.GetValues(typeof(Layer)))
|
||||||
{
|
{
|
||||||
var layer = sprite.LayerMapGet(layerKey);
|
var layer = sprite.LayerMapGet(layerKey);
|
||||||
sprite.LayerSetVisible(layer, state.ConnectedDirections.HasDirection(((PipeDirection)layerKey)) && subfloor);
|
var dir = (PipeDirection) layerKey;
|
||||||
|
var visible = subfloor && state.ConnectedDirections.HasDirection(dir);
|
||||||
|
sprite.LayerSetVisible(layer, visible);
|
||||||
|
|
||||||
|
if (!visible) continue;
|
||||||
|
|
||||||
|
sprite.LayerSetRotation(layer, -rotation);
|
||||||
sprite.LayerSetColor(layer, color);
|
sprite.LayerSetColor(layer, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
sprite: Structures/Piping/Atmospherics/pipe.rsi
|
sprite: Structures/Piping/Atmospherics/pipe.rsi
|
||||||
drawdepth: BelowFloor
|
drawdepth: BelowFloor
|
||||||
netsync: false
|
netsync: false
|
||||||
noRot: true # TODO: This is a hack so pipe connectors don't look wrong. Also see BaseGasThermoMachine.
|
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
|
|||||||
@@ -124,7 +124,6 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Structures/Piping/Atmospherics/thermomachine.rsi
|
sprite: Structures/Piping/Atmospherics/thermomachine.rsi
|
||||||
noRot: true # TODO: This is a hack so pipe connectors don't look wrong. Also see GasPipeBase.
|
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: PipeConnectorVisualizer
|
- type: PipeConnectorVisualizer
|
||||||
|
|||||||
Reference in New Issue
Block a user