Skip to content

Commit c7362e0

Browse files
committed
* Concealment 1.1.3
- Fixed crash related to MyDynamicAABBTree.RemoveLeaf - Fixed button bindings in the UI - Fixed "Enabled" setting not working
1 parent df8e209 commit c7362e0

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

‎Concealment/ConcealGroup.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public void UpdatePostConceal()
4545
HookOnClosing();
4646
}
4747

48+
public void UpdatePostReveal()
49+
{
50+
IsConcealed = false;
51+
foreach (var grid in Grids)
52+
grid.OnClosing -= Grid_OnClosing;
53+
}
54+
4855
private void HookOnClosing()
4956
{
5057
foreach (var grid in Grids)

‎Concealment/ConcealmentControl.xaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
<Button Content="Manual Conceal" Margin="3" Click="Conceal_OnClick" />
3333
<Button Content="Manual Reveal" Margin="3" Click="Reveal_OnClick" />
3434
</StackPanel>
35-
<Button Content="Edit Excluded Subtypes" Margin="3" Click="RevealSelected_OnClick"/>
35+
<Button Content="Edit Excluded Subtypes" Margin="3" Click="EditExclusion_OnClick"/>
3636
</StackPanel>
37-
<Button Content="Reveal Selected" Margin="3" DockPanel.Dock="Bottom" Click="EditExclusion_OnClick" />
37+
<Button Content="Reveal Selected" Margin="3" DockPanel.Dock="Bottom" Click="RevealSelected_OnClick" />
3838
<ListView Name="Concealed" Margin="3" DockPanel.Dock="Bottom" ItemsSource="{Binding ConcealGroups}">
3939
<ItemsControl.ItemTemplate>
4040
<DataTemplate>

‎Concealment/ConcealmentPlugin.cs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131

3232
namespace Concealment
3333
{
34-
[Plugin("Concealment", "1.1.2", "17f44521-b77a-4e85-810f-ee73311cf75d")]
34+
[Plugin("Concealment", "1.1.3", "17f44521-b77a-4e85-810f-ee73311cf75d")]
3535
public sealed class ConcealmentPlugin : TorchPluginBase, IWpfPlugin
3636
{
3737
public Persistent<Settings> Settings { get; private set; }
3838
public MTObservableCollection<ConcealGroup> ConcealGroups { get; } = new MTObservableCollection<ConcealGroup>();
3939

4040
private static readonly Logger Log = LogManager.GetLogger("Concealment");
4141
private UserControl _control;
42-
private ulong _counter;
42+
private ulong _counter = 1;
4343
private bool _init;
4444
private readonly List<ConcealGroup> _concealGroups = new List<ConcealGroup>();
4545
private readonly List<ConcealGroup> _intersectGroups;
@@ -59,11 +59,16 @@ public override void Init(ITorchBase torch)
5959
{
6060
base.Init(torch);
6161
Settings = Persistent<Settings>.Load(Path.Combine(StoragePath, "Concealment.cfg"));
62+
Settings.Data.PropertyChanged += Data_PropertyChanged;
6263
_concealedAabbTree = new MyDynamicAABBTreeD(MyConstants.GAME_PRUNING_STRUCTURE_AABB_EXTENSION);
63-
//torch.SessionUnloading += Torch_SessionUnloading;
6464
RegisterEntityStorage("Concealment", Id);
6565
}
6666

67+
private void Data_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
68+
{
69+
RevealAll();
70+
}
71+
6772
private void RegisterEntityStorage(string name, Guid id)
6873
{
6974
var comp = new MyModStorageComponentDefinition
@@ -74,14 +79,9 @@ private void RegisterEntityStorage(string name, Guid id)
7479
MyDefinitionManager.Static.Definitions.AddDefinition(comp);
7580
}
7681

77-
private void Torch_SessionUnloading()
78-
{
79-
RevealAll();
80-
}
81-
8282
public override void Update()
8383
{
84-
if (MyAPIGateway.Session == null)
84+
if (MyAPIGateway.Session == null || !Settings.Data.Enabled)
8585
return;
8686

8787
if (_counter % Settings.Data.ConcealInterval == 0)
@@ -93,7 +93,6 @@ public override void Update()
9393
if (_init)
9494
return;
9595

96-
//MySession.Static.Players.PlayerRequesting += RevealSpawns;
9796
MyMultiplayer.Static.ClientJoined += RevealCryoPod;
9897

9998
_init = true;
@@ -236,6 +235,7 @@ public int RevealGroup(ConcealGroup group)
236235
#if !NOPHYS
237236
_concealGroups.Remove(group);
238237
_concealedAabbTree.RemoveProxy(group.ProxyId);
238+
group.UpdatePostReveal();
239239
#endif
240240
return count;
241241
}

‎Concealment/Settings.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Runtime.CompilerServices;
45
using System.Xml.Serialization;
56
using Torch;
67

0 commit comments

Comments
 (0)