From a45b1a693513942845031814b16998d96fb0c3d7 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Sun, 3 Nov 2024 09:38:04 +0800 Subject: [PATCH 1/2] Fix the Offset, Zoffset used by TintedCellsLayer --- OpenRA.Mods.AS/Graphics/TintedCell.cs | 2 +- OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.AS/Graphics/TintedCell.cs b/OpenRA.Mods.AS/Graphics/TintedCell.cs index 37929f57a15e..dc3317a1ee98 100644 --- a/OpenRA.Mods.AS/Graphics/TintedCell.cs +++ b/OpenRA.Mods.AS/Graphics/TintedCell.cs @@ -74,7 +74,7 @@ public void Render(WorldRenderer wr) var ramp = ti != null ? ti.RampType : 0; var corners = map.Grid.Ramps[ramp].Corners; - screen = corners.Select(c => wr.Screen3DPxPosition(wpos + c - new WVec(0, 0, map.Grid.Ramps[ramp].CenterHeightOffset) + new WVec(0, 0, ZOffset))).ToArray(); + screen = corners.Select(c => wr.Screen3DPxPosition(wpos + c - new WVec(0, 0, map.Grid.Ramps[ramp].CenterHeightOffset) + layer.Info.Offset)).ToArray(); SetLevel(Level); firstTime = false; } diff --git a/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs b/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs index c6a799fe4f49..ce4b3bf8dc28 100644 --- a/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs +++ b/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs @@ -46,6 +46,9 @@ public class TintedCellsLayerInfo : TraitInfo [Desc("Z offset of the visualization.")] public readonly int ZOffset = 512; + [Desc("Offset of the visualization.")] + public readonly WVec Offset = new(0, 0, 512); + [Desc("Name of the layer.")] public readonly string Name = "radioactivity"; From 313ae134519e34a0830f0260533e32ccc85494c5 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Sun, 3 Nov 2024 14:45:03 +0800 Subject: [PATCH 2/2] Set ZOffset and Offset default value to 0 --- OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs b/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs index ce4b3bf8dc28..46c7aca22cf9 100644 --- a/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs +++ b/OpenRA.Mods.AS/Traits/World/TintedCellsLayer.cs @@ -44,10 +44,10 @@ public class TintedCellsLayerInfo : TraitInfo public readonly int FadeoutDelay = 150; [Desc("Z offset of the visualization.")] - public readonly int ZOffset = 512; + public readonly int ZOffset = 0; [Desc("Offset of the visualization.")] - public readonly WVec Offset = new(0, 0, 512); + public readonly WVec Offset = WVec.Zero; [Desc("Name of the layer.")] public readonly string Name = "radioactivity";