From b25ce7bdbc2ca483235bffd6dbae365ef3e4c585 Mon Sep 17 00:00:00 2001 From: Artur Miguel Date: Sun, 22 Feb 2026 23:06:24 -0300 Subject: [PATCH] Added an option to disable the concealment of moving grids --- Concealment/ConcealmentControl.xaml | 1 + Concealment/ConcealmentPlugin.cs | 23 +++++++++++++++++++++-- Concealment/Settings.cs | 11 +++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Concealment/ConcealmentControl.xaml b/Concealment/ConcealmentControl.xaml index 27cd087..fc8a0a1 100644 --- a/Concealment/ConcealmentControl.xaml +++ b/Concealment/ConcealmentControl.xaml @@ -17,6 +17,7 @@ + diff --git a/Concealment/ConcealmentPlugin.cs b/Concealment/ConcealmentPlugin.cs index 7c4b3ea..11f7d59 100644 --- a/Concealment/ConcealmentPlugin.cs +++ b/Concealment/ConcealmentPlugin.cs @@ -95,7 +95,7 @@ public override void Update() if (_ready) { if (_counter % (ulong)Settings.Data.ConcealInterval == 0) - ConcealGrids(Settings.Data.ConcealDistance); + ConcealGrids(Settings.Data.ConcealDistance, Settings.Data.ConcealInMovement); if (_counter % (ulong)Settings.Data.RevealInterval == 0) RevealGrids(Settings.Data.RevealDistance); _counter += 1; @@ -329,7 +329,7 @@ public int RevealGrids(double distanceFromPlayers) return revealed; } - public int ConcealGrids(double distanceFromPlayers = 0) + public int ConcealGrids(double distanceFromPlayers = 0, bool concealInMovement = false) { Log.Debug("Concealing grids"); @@ -342,6 +342,25 @@ public int ConcealGrids(double distanceFromPlayers = 0) { var concealGroup = new ConcealGroup(group); + if (!concealInMovement) + { + var isInMovement = false; + foreach (var grid in group.Nodes) + { + if (grid?.NodeData?.Speed > 20f) + { + isInMovement = true; + break; + } + } + + if (isInMovement) + { + Log.Trace("group in movement"); + return; + } + } + if (distanceFromPlayers != 0) { var volume = group.GetWorldAABB(); diff --git a/Concealment/Settings.cs b/Concealment/Settings.cs index 86c6d72..6c3b8fd 100644 --- a/Concealment/Settings.cs +++ b/Concealment/Settings.cs @@ -17,6 +17,7 @@ namespace Concealment public class Settings : ViewModel { private bool _enabled = true; + private bool _concealInMovement; private double _concealDistance = 75000; private int _concealInterval = 3600; private double _revealDistance = 50000; @@ -197,6 +198,16 @@ public bool Enabled } } + public bool ConcealInMovement + { + get => _concealInMovement; + set + { + _concealInMovement = value; + OnPropertyChanged(); + } + } + public int ConcealInterval { get => _concealInterval;