Merge remote-tracking branch 'upstream/stable' into ed-21-07-2025-upstream-sync
# Conflicts: # Content.Client/Overlays/StencilOverlay.Weather.cs # Content.IntegrationTests/Tests/Atmos/AlarmThresholdTest.cs # Content.IntegrationTests/Tests/VendingMachineRestockTest.cs # Content.Server/Chat/Systems/ChatSystem.cs # Content.Server/Fluids/EntitySystems/PuddleSystem.cs # Content.Shared/Damage/Systems/SharedStaminaSystem.cs # Content.Shared/Fluids/Components/EvaporationComponent.cs # Content.Shared/GameTicking/SharedGameTicker.cs
This commit is contained in:
@@ -15,6 +15,7 @@ using Content.Shared.Storage.Components;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Wires;
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -58,6 +59,8 @@ public sealed class LockSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
|
||||
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, LockToggledEvent>(LockToggled);
|
||||
|
||||
SubscribeLocalEvent<ItemToggleRequiresLockComponent, ItemToggleActivateAttemptEvent>(OnActivateAttempt);
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
||||
@@ -433,4 +436,19 @@ public sealed class LockSystem : EntitySystem
|
||||
|
||||
_activatableUI.CloseAll(uid);
|
||||
}
|
||||
private void OnActivateAttempt(EntityUid uid, ItemToggleRequiresLockComponent component, ref ItemToggleActivateAttemptEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked != component.RequireLocked)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
if (lockComp.Locked)
|
||||
_sharedPopupSystem.PopupClient(Loc.GetString("lock-comp-generic-fail",
|
||||
("target", Identity.Entity(uid, EntityManager))),
|
||||
uid,
|
||||
args.User);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user