-
Notifications
You must be signed in to change notification settings - Fork 616
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
1 parent
3cc6e5b
commit f31197e
Showing
8 changed files
with
457 additions
and
65 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
Content.Server/Corvax/HiddenDescription/HiddenDescriptionContainerShowerComponent.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,7 @@ | ||
namespace Content.Server.Corvax.HiddenDescription; | ||
|
||
/// <summary> | ||
/// Shows hidden description from entity in container | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class HiddenDescriptionContainerShowerComponent : Component { } |
31 changes: 31 additions & 0 deletions
31
Content.Server/Corvax/HiddenDescription/HiddenDescriptionContainerShowerSystem.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,31 @@ | ||
using Content.Shared.Examine; | ||
using Robust.Server.Containers; | ||
|
||
namespace Content.Server.Corvax.HiddenDescription; | ||
|
||
public sealed class HiddenDescriptionContainerShowerSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ContainerSystem _container = default!; | ||
[Dependency] private readonly HiddenDescriptionSystem _hiddenDescription = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<HiddenDescriptionContainerShowerComponent, ExaminedEvent>(OnExamine); | ||
} | ||
|
||
private void OnExamine(Entity<HiddenDescriptionContainerShowerComponent> entity, ref ExaminedEvent args) | ||
{ | ||
foreach (var container in _container.GetAllContainers(entity.Owner)) | ||
{ | ||
foreach (var containedEntity in container.ContainedEntities) | ||
{ | ||
if (TryComp<HiddenDescriptionComponent>(containedEntity, out var hiddenDescription)) | ||
{ | ||
_hiddenDescription.PushExamineInformation(hiddenDescription, ref args); | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.