Gas Analyzer can now scan pipes/devices along with the environment (#10976)

This commit is contained in:
theashtronaut
2022-09-08 14:22:14 +00:00
committed by GitHub
parent ae8fe43529
commit 868abaca5c
23 changed files with 826 additions and 758 deletions

View File

@@ -25,7 +25,7 @@ namespace Content.Server.UserInterface
SubscribeLocalEvent<ActivatableUIComponent, ActivateInWorldEvent>(OnActivate);
SubscribeLocalEvent<ActivatableUIComponent, UseInHandEvent>(OnUseInHand);
SubscribeLocalEvent<ActivatableUIComponent, HandDeselectedEvent>((uid, aui, _) => CloseAll(uid, aui));
SubscribeLocalEvent<ActivatableUIComponent, HandDeselectedEvent>(OnHandDeselected);
SubscribeLocalEvent<ActivatableUIComponent, GotUnequippedHandEvent>((uid, aui, _) => CloseAll(uid, aui));
// *THIS IS A BLATANT WORKAROUND!* RATIONALE: Microwaves need it
SubscribeLocalEvent<ActivatableUIComponent, EntParentChangedMessage>(OnParentChanged);
@@ -169,6 +169,14 @@ namespace Content.Server.UserInterface
if (!Resolve(uid, ref aui, false)) return;
aui.UserInterface?.CloseAll();
}
private void OnHandDeselected(EntityUid uid, ActivatableUIComponent? aui, HandDeselectedEvent args)
{
if (!Resolve(uid, ref aui, false)) return;
if (!aui.CloseOnHandDeselect)
return;
CloseAll(uid, aui);
}
}
public sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs