Gas Analyzer can now scan pipes/devices along with the environment (#10976)
This commit is contained in:
@@ -49,6 +49,12 @@ namespace Content.Server.UserInterface
|
||||
[DataField("allowSpectator")]
|
||||
public bool AllowSpectator = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the UI should close when the item is deselected due to a hand swap or drop
|
||||
/// </summary>
|
||||
[DataField("closeOnHandDeselect")]
|
||||
public bool CloseOnHandDeselect = true;
|
||||
|
||||
/// <summary>
|
||||
/// The client channel currently using the object, or null if there's none/not single user.
|
||||
/// NOTE: DO NOT DIRECTLY SET, USE ActivatableUISystem.SetCurrentSingleUser
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user