From 839f6bd5d032758a339006d3bb79f5d32b643c3d Mon Sep 17 00:00:00 2001 From: metalgearsloth Date: Fri, 18 Oct 2024 18:04:23 +1100 Subject: [PATCH] Remove BUI deferred closes --- .../UserInterface/BoundUserInterface.cs | 7 ------- .../Systems/SharedUserInterfaceSystem.cs | 21 +++---------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs b/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs index a8a51012f6d..c6d65135c5a 100644 --- a/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs +++ b/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs @@ -28,13 +28,6 @@ public abstract class BoundUserInterface : IDisposable /// protected internal BoundUserInterfaceState? State { get; internal set; } - // Bandaid just for storage :) - /// - /// Defers state handling - /// - [Obsolete] - public virtual bool DeferredClose { get; } = true; - protected BoundUserInterface(EntityUid owner, Enum uiKey) { IoCManager.InjectDependencies(this); diff --git a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs index f08e5520083..e29921babd3 100644 --- a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs @@ -222,13 +222,7 @@ private void CloseUiInternal(Entity ent, Enum key, Enti if (ent.Comp.ClientOpenInterfaces.TryGetValue(key, out var cBui)) { - if (cBui.DeferredClose) - _queuedCloses.Add(cBui); - else - { - ent.Comp.ClientOpenInterfaces.Remove(key); - cBui.Dispose(); - } + _queuedCloses.Add(cBui); } if (ent.Comp.Actors.Count == 0) @@ -402,14 +396,7 @@ private void OnUserInterfaceHandleState(Entity ent, ref } var bui = ent.Comp.ClientOpenInterfaces[key]; - - if (bui.DeferredClose) - _queuedCloses.Add(bui); - else - { - ent.Comp.ClientOpenInterfaces.Remove(key); - bui.Dispose(); - } + _queuedCloses.Add(bui); } // update any states we have open @@ -454,9 +441,7 @@ private void EnsureClientBui(Entity entity, Enum key, In // Existing BUI just keep it. if (entity.Comp.ClientOpenInterfaces.TryGetValue(key, out var existing)) { - if (existing.DeferredClose) - _queuedCloses.Remove(existing); - + _queuedCloses.Remove(existing); return; }