-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
64 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Content.Shared.Item.ItemToggle.Components; | ||
using Content.Shared.Lock; | ||
using Content.Shared.ActionBlocker; | ||
using Content.Shared.Popups; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Shared._DV.Lock; | ||
|
||
/// <summary> | ||
/// Handles (un)locking and examining of Lock components | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed class ItemToggleRequiresLockSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; | ||
[Dependency] private readonly SharedPopupSystem _sharedPopupSystem = default!; | ||
|
||
/// <inheritdoc /> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ItemToggleRequiresLockComponent, ItemToggleActivateAttemptEvent>(OnActivateAttempt); | ||
} | ||
|
||
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) | ||
args.Popup = Loc.GetString("lock-comp-has-user-access-fail"); | ||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
Resources/Prototypes/_DV/Entities/Markers/Spawners/Random/lighters.yml
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,17 @@ | ||
- type: entityTable | ||
id: BrandedFlippoTable | ||
table: !type:GroupSelector | ||
children: | ||
- id: CybersunFlippo | ||
- id: InterdyneFlippo | ||
- id: WaffleCoFlippo | ||
- id: HonkCoFlippo | ||
- id: DiscountDanLighter | ||
- id: GorlexMatchbox | ||
weight: 0.5 | ||
- id: DonkcoLighter | ||
weight: 0.5 | ||
- id: NanotrasenFlippo | ||
weight: 0.25 | ||
- id: SpiderclanFlippo | ||
weight: 0.25 |
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