Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BUI deferred closes #5503

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Robust.Client/UserInterface/UserInterfaceManager.Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ private static void _doGuiInput(

private void _clearTooltip()
{
if (!_showingTooltip) return;
_resetTooltipTimer();

if (!_showingTooltip)
return;

if (_suppliedTooltip != null)
{
Expand All @@ -321,7 +324,6 @@ private void _clearTooltip()
}

CurrentlyHovered?.PerformHideTooltip();
_resetTooltipTimer();
_showingTooltip = false;
}

Expand Down
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
Loading