Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -144,7 +144,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
RaiseLocalEvent((aui).Owner, bae, false);
SetCurrentSingleUser((aui).Owner, actor.PlayerSession, aui);
ui.Toggle(actor.PlayerSession);
_uiSystem.ToggleUi(ui, actor.PlayerSession);
//Let the component know a user opened it so it can do whatever it needs to do
var aae = new AfterActivatableUIOpenEvent(user, actor.PlayerSession);
@@ -167,8 +167,12 @@ public sealed partial class ActivatableUISystem : EntitySystem
public void CloseAll(EntityUid uid, ActivatableUIComponent? aui = null)
{
if (!Resolve(uid, ref aui, false)) return;
aui.UserInterface?.CloseAll();
if (!Resolve(uid, ref aui, false))
return;
if (aui.UserInterface is null)
return;
_uiSystem.CloseAll(aui.UserInterface);
}
private void OnHandDeselected(EntityUid uid, ActivatableUIComponent? aui, HandDeselectedEvent args)