@@ -1,43 +0,0 @@
|
|||||||
using Content.Server.Lock.Components;
|
|
||||||
using Content.Server.Popups;
|
|
||||||
using Content.Shared.UserInterface;
|
|
||||||
using Content.Shared.Lock;
|
|
||||||
using Content.Server.UserInterface;
|
|
||||||
using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
|
|
||||||
|
|
||||||
namespace Content.Server.Lock.EntitySystems;
|
|
||||||
public sealed class ActivatableUIRequiresLockSystem : EntitySystem
|
|
||||||
{
|
|
||||||
[Dependency] private readonly ActivatableUISystem _activatableUI = default!;
|
|
||||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
|
||||||
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
|
||||||
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, LockToggledEvent>(LockToggled);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnUIOpenAttempt(EntityUid uid, ActivatableUIRequiresLockComponent component, ActivatableUIOpenAttemptEvent args)
|
|
||||||
{
|
|
||||||
if (args.Cancelled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked != component.requireLocked)
|
|
||||||
{
|
|
||||||
args.Cancel();
|
|
||||||
if (lockComp.Locked)
|
|
||||||
_popupSystem.PopupEntity(Loc.GetString("entity-storage-component-locked-message"), uid, args.User);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LockToggled(EntityUid uid, ActivatableUIRequiresLockComponent component, LockToggledEvent args)
|
|
||||||
{
|
|
||||||
if (!TryComp<LockComponent>(uid, out var lockComp) || lockComp.Locked == component.requireLocked)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_activatableUI.CloseAll(uid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5,7 +5,6 @@ using Content.Server.DeviceNetwork.Systems;
|
|||||||
using Content.Server.Explosion.EntitySystems;
|
using Content.Server.Explosion.EntitySystems;
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Server.PowerCell;
|
using Content.Server.PowerCell;
|
||||||
using Content.Shared.UserInterface;
|
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
@@ -70,7 +69,6 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
|||||||
SubscribeLocalEvent<BorgChassisComponent, MobStateChangedEvent>(OnMobStateChanged);
|
SubscribeLocalEvent<BorgChassisComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, PowerCellChangedEvent>(OnPowerCellChanged);
|
SubscribeLocalEvent<BorgChassisComponent, PowerCellChangedEvent>(OnPowerCellChanged);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty);
|
SubscribeLocalEvent<BorgChassisComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
|
||||||
SubscribeLocalEvent<BorgChassisComponent, GetCharactedDeadIcEvent>(OnGetDeadIC);
|
SubscribeLocalEvent<BorgChassisComponent, GetCharactedDeadIcEvent>(OnGetDeadIC);
|
||||||
|
|
||||||
SubscribeLocalEvent<BorgBrainComponent, MindAddedMessage>(OnBrainMindAdded);
|
SubscribeLocalEvent<BorgBrainComponent, MindAddedMessage>(OnBrainMindAdded);
|
||||||
@@ -214,13 +212,6 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
|||||||
UpdateUI(uid, component);
|
UpdateUI(uid, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUIOpenAttempt(EntityUid uid, BorgChassisComponent component, ActivatableUIOpenAttemptEvent args)
|
|
||||||
{
|
|
||||||
// borgs can't view their own ui
|
|
||||||
if (args.User == uid)
|
|
||||||
args.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnGetDeadIC(EntityUid uid, BorgChassisComponent component, ref GetCharactedDeadIcEvent args)
|
private void OnGetDeadIC(EntityUid uid, BorgChassisComponent component, ref GetCharactedDeadIcEvent args)
|
||||||
{
|
{
|
||||||
args.Dead = true;
|
args.Dead = true;
|
||||||
|
|||||||
@@ -4,27 +4,23 @@ using System.Threading;
|
|||||||
using Content.Server.Construction;
|
using Content.Server.Construction;
|
||||||
using Content.Server.Construction.Components;
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.UserInterface;
|
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Tools.Components;
|
using Content.Shared.Tools.Components;
|
||||||
using Content.Shared.UserInterface;
|
|
||||||
using Content.Shared.Wires;
|
using Content.Shared.Wires;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
|
|
||||||
|
|
||||||
namespace Content.Server.Wires;
|
namespace Content.Server.Wires;
|
||||||
|
|
||||||
public sealed class WiresSystem : SharedWiresSystem
|
public sealed class WiresSystem : SharedWiresSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||||
[Dependency] private readonly ActivatableUISystem _activatableUI = default!;
|
|
||||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||||
@@ -52,8 +48,6 @@ public sealed class WiresSystem : SharedWiresSystem
|
|||||||
SubscribeLocalEvent<WiresComponent, TimedWireEvent>(OnTimedWire);
|
SubscribeLocalEvent<WiresComponent, TimedWireEvent>(OnTimedWire);
|
||||||
SubscribeLocalEvent<WiresComponent, PowerChangedEvent>(OnWiresPowered);
|
SubscribeLocalEvent<WiresComponent, PowerChangedEvent>(OnWiresPowered);
|
||||||
SubscribeLocalEvent<WiresComponent, WireDoAfterEvent>(OnDoAfter);
|
SubscribeLocalEvent<WiresComponent, WireDoAfterEvent>(OnDoAfter);
|
||||||
SubscribeLocalEvent<ActivatableUIRequiresPanelComponent, ActivatableUIOpenAttemptEvent>(OnAttemptOpenActivatableUI);
|
|
||||||
SubscribeLocalEvent<ActivatableUIRequiresPanelComponent, PanelChangedEvent>(OnActivatableUIPanelChanged);
|
|
||||||
SubscribeLocalEvent<WiresPanelSecurityComponent, WiresPanelSecurityEvent>(SetWiresPanelSecurity);
|
SubscribeLocalEvent<WiresPanelSecurityComponent, WiresPanelSecurityEvent>(SetWiresPanelSecurity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,23 +467,6 @@ public sealed class WiresSystem : SharedWiresSystem
|
|||||||
_uiSystem.CloseUi(ent.Owner, WiresUiKey.Key);
|
_uiSystem.CloseUi(ent.Owner, WiresUiKey.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAttemptOpenActivatableUI(EntityUid uid, ActivatableUIRequiresPanelComponent component, ActivatableUIOpenAttemptEvent args)
|
|
||||||
{
|
|
||||||
if (args.Cancelled || !TryComp<WiresPanelComponent>(uid, out var wires))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (component.RequireOpen != wires.Open)
|
|
||||||
args.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnActivatableUIPanelChanged(EntityUid uid, ActivatableUIRequiresPanelComponent component, ref PanelChangedEvent args)
|
|
||||||
{
|
|
||||||
if (args.Open == component.RequireOpen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_activatableUI.CloseAll(uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent args)
|
private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent args)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(component.LayoutId))
|
if (!string.IsNullOrEmpty(component.LayoutId))
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
namespace Content.Server.Lock.Components;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Lock;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used for activatable UIs that require the entity to have a lock in a certain state.
|
/// This is used for activatable UIs that require the entity to have a lock in a certain state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, NetworkedComponent, Access(typeof(LockSystem))]
|
||||||
public sealed partial class ActivatableUIRequiresLockComponent : Component
|
public sealed partial class ActivatableUIRequiresLockComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TRUE: the lock must be locked to access the UI.
|
/// TRUE: the lock must be locked to access the UI.
|
||||||
/// FALSE: the lock must be unlocked to access the UI.
|
/// FALSE: the lock must be unlocked to access the UI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("requireLocked"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField]
|
||||||
public bool requireLocked = false;
|
public bool RequireLocked;
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ using Content.Shared.Interaction;
|
|||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
using Content.Shared.Storage.Components;
|
using Content.Shared.Storage.Components;
|
||||||
|
using Content.Shared.UserInterface;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Content.Shared.Wires;
|
using Content.Shared.Wires;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -25,6 +26,7 @@ namespace Content.Shared.Lock;
|
|||||||
public sealed class LockSystem : EntitySystem
|
public sealed class LockSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
|
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
|
||||||
|
[Dependency] private readonly ActivatableUISystem _activatableUI = default!;
|
||||||
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _sharedPopupSystem = default!;
|
[Dependency] private readonly SharedPopupSystem _sharedPopupSystem = default!;
|
||||||
@@ -48,6 +50,9 @@ public sealed class LockSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<LockedWiresPanelComponent, LockToggleAttemptEvent>(OnLockToggleAttempt);
|
SubscribeLocalEvent<LockedWiresPanelComponent, LockToggleAttemptEvent>(OnLockToggleAttempt);
|
||||||
SubscribeLocalEvent<LockedWiresPanelComponent, AttemptChangePanelEvent>(OnAttemptChangePanel);
|
SubscribeLocalEvent<LockedWiresPanelComponent, AttemptChangePanelEvent>(OnAttemptChangePanel);
|
||||||
SubscribeLocalEvent<LockedAnchorableComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
|
SubscribeLocalEvent<LockedAnchorableComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
||||||
|
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, LockToggledEvent>(LockToggled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
||||||
@@ -349,5 +354,26 @@ public sealed class LockSystem : EntitySystem
|
|||||||
args.User);
|
args.User);
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnUIOpenAttempt(EntityUid uid, ActivatableUIRequiresLockComponent component, ActivatableUIOpenAttemptEvent args)
|
||||||
|
{
|
||||||
|
if (args.Cancelled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked != component.RequireLocked)
|
||||||
|
{
|
||||||
|
args.Cancel();
|
||||||
|
if (lockComp.Locked)
|
||||||
|
_sharedPopupSystem.PopupEntity(Loc.GetString("entity-storage-component-locked-message"), uid, args.User);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LockToggled(EntityUid uid, ActivatableUIRequiresLockComponent component, LockToggledEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp<LockComponent>(uid, out var lockComp) || lockComp.Locked == component.RequireLocked)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_activatableUI.CloseAll(uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Content.Shared.Movement.Systems;
|
|||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.PowerCell.Components;
|
using Content.Shared.PowerCell.Components;
|
||||||
using Content.Shared.Silicons.Borgs.Components;
|
using Content.Shared.Silicons.Borgs.Components;
|
||||||
|
using Content.Shared.UserInterface;
|
||||||
using Content.Shared.Wires;
|
using Content.Shared.Wires;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
|
||||||
@@ -30,7 +31,8 @@ public abstract partial class SharedBorgSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<BorgChassisComponent, EntInsertedIntoContainerMessage>(OnInserted);
|
SubscribeLocalEvent<BorgChassisComponent, EntInsertedIntoContainerMessage>(OnInserted);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, EntRemovedFromContainerMessage>(OnRemoved);
|
SubscribeLocalEvent<BorgChassisComponent, EntRemovedFromContainerMessage>(OnRemoved);
|
||||||
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
|
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
|
||||||
|
SubscribeLocalEvent<BorgChassisComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
||||||
|
|
||||||
InitializeRelay();
|
InitializeRelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +77,13 @@ public abstract partial class SharedBorgSystem : EntitySystem
|
|||||||
component.ModuleContainer = Container.EnsureContainer<Container>(uid, component.ModuleContainerId, containerManager);
|
component.ModuleContainer = Container.EnsureContainer<Container>(uid, component.ModuleContainerId, containerManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnUIOpenAttempt(EntityUid uid, BorgChassisComponent component, ActivatableUIOpenAttemptEvent args)
|
||||||
|
{
|
||||||
|
// borgs can't view their own ui
|
||||||
|
if (args.User == uid)
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void OnInserted(EntityUid uid, BorgChassisComponent component, EntInsertedIntoContainerMessage args)
|
protected virtual void OnInserted(EntityUid uid, BorgChassisComponent component, EntInsertedIntoContainerMessage args)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
namespace Content.Server.Wires;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Wires;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used for activatable UIs that require the entity to have a panel in a certain state.
|
/// This is used for activatable UIs that require the entity to have a panel in a certain state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedWiresSystem))]
|
||||||
public sealed partial class ActivatableUIRequiresPanelComponent : Component
|
public sealed partial class ActivatableUIRequiresPanelComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TRUE: the panel must be open to access the UI.
|
/// TRUE: the panel must be open to access the UI.
|
||||||
/// FALSE: the panel must be closed to access the UI.
|
/// FALSE: the panel must be closed to access the UI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("requireOpen"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField]
|
||||||
public bool RequireOpen = true;
|
public bool RequireOpen = true;
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ using Content.Shared.Database;
|
|||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Tools.Systems;
|
using Content.Shared.Tools.Systems;
|
||||||
|
using Content.Shared.UserInterface;
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
|
|
||||||
namespace Content.Shared.Wires;
|
namespace Content.Shared.Wires;
|
||||||
@@ -10,6 +11,7 @@ namespace Content.Shared.Wires;
|
|||||||
public abstract class SharedWiresSystem : EntitySystem
|
public abstract class SharedWiresSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] protected readonly ISharedAdminLogManager AdminLogger = default!;
|
[Dependency] protected readonly ISharedAdminLogManager AdminLogger = default!;
|
||||||
|
[Dependency] private readonly ActivatableUISystem _activatableUI = default!;
|
||||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||||
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
||||||
[Dependency] protected readonly SharedToolSystem Tool = default!;
|
[Dependency] protected readonly SharedToolSystem Tool = default!;
|
||||||
@@ -21,6 +23,9 @@ public abstract class SharedWiresSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<WiresPanelComponent, WirePanelDoAfterEvent>(OnPanelDoAfter);
|
SubscribeLocalEvent<WiresPanelComponent, WirePanelDoAfterEvent>(OnPanelDoAfter);
|
||||||
SubscribeLocalEvent<WiresPanelComponent, InteractUsingEvent>(OnInteractUsing);
|
SubscribeLocalEvent<WiresPanelComponent, InteractUsingEvent>(OnInteractUsing);
|
||||||
SubscribeLocalEvent<WiresPanelComponent, ExaminedEvent>(OnExamine);
|
SubscribeLocalEvent<WiresPanelComponent, ExaminedEvent>(OnExamine);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ActivatableUIRequiresPanelComponent, ActivatableUIOpenAttemptEvent>(OnAttemptOpenActivatableUI);
|
||||||
|
SubscribeLocalEvent<ActivatableUIRequiresPanelComponent, PanelChangedEvent>(OnActivatableUIPanelChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPanelDoAfter(EntityUid uid, WiresPanelComponent panel, WirePanelDoAfterEvent args)
|
private void OnPanelDoAfter(EntityUid uid, WiresPanelComponent panel, WirePanelDoAfterEvent args)
|
||||||
@@ -132,4 +137,21 @@ public abstract class SharedWiresSystem : EntitySystem
|
|||||||
|
|
||||||
return entity.Comp.Open;
|
return entity.Comp.Open;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnAttemptOpenActivatableUI(EntityUid uid, ActivatableUIRequiresPanelComponent component, ActivatableUIOpenAttemptEvent args)
|
||||||
|
{
|
||||||
|
if (args.Cancelled || !TryComp<WiresPanelComponent>(uid, out var wires))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (component.RequireOpen != wires.Open)
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnActivatableUIPanelChanged(EntityUid uid, ActivatableUIRequiresPanelComponent component, ref PanelChangedEvent args)
|
||||||
|
{
|
||||||
|
if (args.Open == component.RequireOpen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_activatableUI.CloseAll(uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user