From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Fri, 31 May 2024 14:56:20 +0000 (-0700) Subject: Add firelock warnings popup when opening on access allowed (#28420) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=42de8df51915896c3703c5f7acac7b123a246397;p=space-station-14.git Add firelock warnings popup when opening on access allowed (#28420) --- diff --git a/Content.Shared/Doors/Systems/SharedFirelockSystem.cs b/Content.Shared/Doors/Systems/SharedFirelockSystem.cs index 4afe26039b..03350d2e64 100644 --- a/Content.Shared/Doors/Systems/SharedFirelockSystem.cs +++ b/Content.Shared/Doors/Systems/SharedFirelockSystem.cs @@ -56,23 +56,34 @@ public abstract class SharedFirelockSystem : EntitySystem if (!component.Powered || (!overrideAccess && component.IsLocked)) args.Cancel(); + else if (args.User != null) + WarnPlayer((uid, component), args.User.Value); } private void OnDoorGetPryTimeModifier(EntityUid uid, FirelockComponent component, ref GetPryTimeModifierEvent args) { - if (component.Temperature) + WarnPlayer((uid, component), args.User); + + if (component.IsLocked) + args.PryTimeModifier *= component.LockedPryTimeModifier; + } + + private void WarnPlayer(Entity ent, EntityUid user) + { + if (ent.Comp.Temperature) { _popupSystem.PopupClient(Loc.GetString("firelock-component-is-holding-fire-message"), - uid, args.User, PopupType.MediumCaution); + ent.Owner, + user, + PopupType.MediumCaution); } - else if (component.Pressure) + else if (ent.Comp.Pressure) { _popupSystem.PopupClient(Loc.GetString("firelock-component-is-holding-pressure-message"), - uid, args.User, PopupType.MediumCaution); + ent.Owner, + user, + PopupType.MediumCaution); } - - if (component.IsLocked) - args.PryTimeModifier *= component.LockedPryTimeModifier; } private void OnAfterPried(EntityUid uid, FirelockComponent component, ref PriedEvent args)