Communications Console & Medical Scanner now close when too far away (#2175)

-Wire & GasAnalyzer dispose instead of closing only
This commit is contained in:
Exp
2020-10-06 10:16:42 +02:00
committed by GitHub
parent 67ba000528
commit 920f3a999b
12 changed files with 40 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
using System.Threading; using System.Threading;
using Content.Client.GameObjects.Components.Command; using Content.Client.GameObjects.Components.Command;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
@@ -68,7 +68,9 @@ namespace Content.Client.Command
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if(disposing) base.Dispose(disposing);
if (disposing)
_timerCancelTokenSource.Cancel(); _timerCancelTokenSource.Cancel();
} }
} }

View File

@@ -74,7 +74,9 @@ namespace Content.Client.GameObjects.Components.Arcade
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if(!disposing) { return; } if (!disposing)
return;
_menu?.Dispose(); _menu?.Dispose();
} }
} }

View File

@@ -48,7 +48,9 @@ namespace Content.Client.GameObjects.Components.Arcade
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if(!disposing) { return; } if (!disposing)
return;
_menu?.Dispose(); _menu?.Dispose();
} }
} }

View File

@@ -35,8 +35,10 @@ namespace Content.Client.GameObjects.Components.Atmos
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if (!disposing)
return;
_menu.Close(); _menu?.Dispose();
} }
} }
} }

View File

@@ -50,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
if (disposing) if (disposing)
{ {
_display.Dispose(); _display?.Dispose();
_template = null; _template = null;
_parts.Clear(); _parts.Clear();
} }

View File

@@ -111,7 +111,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
if (disposing) if (disposing)
{ {
_window.Dispose(); _window?.Dispose();
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Client.Command; using Content.Client.Command;
using Content.Shared.GameObjects.Components.Command; using Content.Shared.GameObjects.Components.Command;
using Robust.Client.GameObjects.Components.UserInterface; using Robust.Client.GameObjects.Components.UserInterface;
@@ -69,6 +69,7 @@ namespace Content.Client.GameObjects.Components.Command
{ {
base.Dispose(disposing); base.Dispose(disposing);
if (!disposing) return; if (!disposing) return;
_menu?.Dispose(); _menu?.Dispose();
} }
} }

View File

@@ -40,10 +40,10 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if (!disposing) return; if (!disposing)
_strippingMenu.Dispose(); return;
_strippingMenu.Close(); _strippingMenu.Dispose();
} }
private void UpdateMenu() private void UpdateMenu()

View File

@@ -1,4 +1,4 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.GameObjects.Components.UserInterface; using Robust.Client.GameObjects.Components.UserInterface;
using Robust.Shared.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface;
using static Content.Shared.GameObjects.Components.Medical.SharedMedicalScannerComponent; using static Content.Shared.GameObjects.Components.Medical.SharedMedicalScannerComponent;
@@ -31,5 +31,13 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
base.UpdateState(state); base.UpdateState(state);
_window.Populate((MedicalScannerBoundUserInterfaceState) state); _window.Populate((MedicalScannerBoundUserInterfaceState) state);
} }
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_window.Dispose();
}
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Client.GameObjects.EntitySystems; using Content.Client.GameObjects.EntitySystems;
using Content.Client.Utility; using Content.Client.Utility;
using Content.Shared.GameObjects.Components.PDA; using Content.Shared.GameObjects.Components.PDA;
@@ -133,6 +133,9 @@ namespace Content.Client.GameObjects.Components.PDA
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if (!disposing)
return;
_menu?.Dispose(); _menu?.Dispose();
} }

View File

@@ -54,7 +54,9 @@ namespace Content.Client.GameObjects.Components.VendingMachines
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if(!disposing) { return; } if (!disposing)
return;
_menu?.Dispose(); _menu?.Dispose();
} }
} }

View File

@@ -1,4 +1,4 @@
using Robust.Client.GameObjects.Components.UserInterface; using Robust.Client.GameObjects.Components.UserInterface;
using Robust.Shared.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface;
using static Content.Shared.GameObjects.Components.SharedWiresComponent; using static Content.Shared.GameObjects.Components.SharedWiresComponent;
@@ -35,8 +35,10 @@ namespace Content.Client.GameObjects.Components.Wires
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); base.Dispose(disposing);
if (!disposing)
return;
_menu.Close(); _menu.Dispose();
} }
} }
} }