This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
forked from estacaoespacialpirata/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conserta o painel de chaves encriptadas aparecendo enquando o painel …
…está fechado
- Loading branch information
Showing
7 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...rver/_EstacaoPirata/EncryptionHolderRequiresLock/EncryptionHolderRequiresLockComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Content.Server.SimpleStation14.EncryptionHolderRequiresLock; | ||
|
||
[RegisterComponent] | ||
public sealed partial class EncryptionHolderRequiresLockComponent : Component | ||
{ | ||
} |
28 changes: 28 additions & 0 deletions
28
....Server/_EstacaoPirata/EncryptionHolderRequiresLock/EncryptionHolderRequiresLockSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Content.Shared.Containers.ItemSlots; | ||
using Content.Shared.Lock; | ||
using Content.Shared.Radio.Components; | ||
using Content.Shared.Radio.EntitySystems; | ||
|
||
namespace Content.Server.SimpleStation14.EncryptionHolderRequiresLock; | ||
|
||
public sealed class EncryptionHolderRequiresLockSystem : EntitySystem | ||
|
||
{ | ||
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; | ||
[Dependency] private readonly EncryptionKeySystem _encryptionKeySystem = default!; | ||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<EncryptionHolderRequiresLockComponent, LockToggledEvent>(LockToggled); | ||
|
||
} | ||
private void LockToggled(EntityUid uid, EncryptionHolderRequiresLockComponent component, LockToggledEvent args) | ||
{ | ||
if (!TryComp<LockComponent>(uid, out var lockComp) || !TryComp<EncryptionKeyHolderComponent>(uid, out var keyHolder)) | ||
return; | ||
keyHolder.KeysUnlocked = !lockComp.Locked; | ||
_encryptionKeySystem.UpdateChannels(uid, keyHolder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters