Skip to content

Commit

Permalink
Remove BUI deferred closes
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth committed Oct 18, 2024
1 parent ba7d145 commit 839f6bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ public abstract class BoundUserInterface : IDisposable
/// </summary>
protected internal BoundUserInterfaceState? State { get; internal set; }

// Bandaid just for storage :)
/// <summary>
/// Defers state handling
/// </summary>
[Obsolete]
public virtual bool DeferredClose { get; } = true;

protected BoundUserInterface(EntityUid owner, Enum uiKey)
{
IoCManager.InjectDependencies(this);
Expand Down
21 changes: 3 additions & 18 deletions Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,7 @@ private void CloseUiInternal(Entity<UserInterfaceComponent?> 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)
Expand Down Expand Up @@ -402,14 +396,7 @@ private void OnUserInterfaceHandleState(Entity<UserInterfaceComponent> 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
Expand Down Expand Up @@ -454,9 +441,7 @@ private void EnsureClientBui(Entity<UserInterfaceComponent> 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;
}

Expand Down

0 comments on commit 839f6bd

Please sign in to comment.