forked from space-syndicate/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SecCam * meh * Fixes * fixes * Добавлено описание * Why are we still here? * Just to suffer?
- Loading branch information
Showing
5 changed files
with
92 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Content.Server._CorvaxNext.BodyCam; | ||
/// <summary> | ||
/// A marker component for cameras that should only be active when worn. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class BodyCameraComponent : Component; |
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,53 @@ | ||
using Content.Server.SurveillanceCamera; | ||
using Content.Shared.Clothing; | ||
using Content.Shared.Clothing.Components; | ||
using Robust.Shared.GameObjects; | ||
|
||
namespace Content.Server._CorvaxNext.BodyCam; | ||
|
||
/// <summary> | ||
/// A system that automatically enables or disables a camera | ||
/// depending on whether the item is currently equipped in a clothing slot. | ||
/// </summary> | ||
public sealed class BodyCameraSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SurveillanceCameraSystem _surveillanceSystem = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
// When the BodyCameraComponent is added, ensure the camera starts off. | ||
SubscribeLocalEvent<BodyCameraComponent, ComponentStartup>(OnStartup); | ||
|
||
// Turn camera on/off when the clothing item is equipped/unequipped. | ||
SubscribeLocalEvent<BodyCameraComponent, ClothingGotEquippedEvent>(OnEquipped); | ||
SubscribeLocalEvent<BodyCameraComponent, ClothingGotUnequippedEvent>(OnUnequipped); | ||
} | ||
|
||
/// <summary> | ||
/// On component startup, forcibly disable the camera (if found). | ||
/// </summary> | ||
private void OnStartup(EntityUid uid, BodyCameraComponent component, ComponentStartup args) | ||
{ | ||
// If there's a SurveillanceCameraComponent, turn it off immediately. | ||
if (TryComp<SurveillanceCameraComponent>(uid, out var camComp)) | ||
_surveillanceSystem.SetActive(uid, false, camComp); | ||
} | ||
|
||
/// <summary> | ||
/// When the item is equipped, turn the camera on. | ||
/// </summary> | ||
private void OnEquipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotEquippedEvent args) | ||
{ | ||
if (TryComp<SurveillanceCameraComponent>(uid, out var camComp)) | ||
_surveillanceSystem.SetActive(uid, true, camComp); | ||
} | ||
|
||
/// <summary> | ||
/// When the item is unequipped, turn the camera off. | ||
/// </summary> | ||
private void OnUnequipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotUnequippedEvent args) | ||
{ | ||
if (TryComp<SurveillanceCameraComponent>(uid, out var camComp)) | ||
_surveillanceSystem.SetActive(uid, false, camComp); | ||
} | ||
} |
14 changes: 7 additions & 7 deletions
14
Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/clothing/neck/secbadge.ftl
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
ent-ClothingNeckSecBadgeBase = жетон | ||
.desc = Уважай мой авторитет! | ||
ent-ClothingNeckSecBadgeCadet = жетон кадета | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон для новичков службы безопасности. Встроенная камера фиксирует события для последующего анализа. | ||
ent-ClothingNeckSecBadgePilot = жетон пилота | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон пилота службы безопасности. Встроенная камера обеспечивает мониторинг во время выполнения полетов. | ||
ent-ClothingNeckSecBadgeDetective = жетон детектива | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон детектива. Оснащен встроенной камерой для фиксации хода расследований. | ||
ent-ClothingNeckSecBadgeBrigmedic = жетон бригмедика | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон медицинского специалиста брига. Встроенная камера записывает действия для отчетности. | ||
ent-ClothingNeckSecBadgeOfficer = жетон офицера | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон офицера службы безопасности. Имеет встроенную камеру, работающую на авторитете. | ||
ent-ClothingNeckSecBadgeWarden = жетон смотрителя | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон смотрителя. Оснащен встроенной камерой для документирования ключевых событий. | ||
ent-ClothingNeckSecBadgeHos = жетон главы службы безопасности | ||
.desc = { ent-ClothingNeckSecBadgeBase.desc } | ||
.desc = Стандартный жетон главы службы безопасности. Встроенная камера обеспечивает постоянное наблюдение и архивирование данных. |
2 changes: 1 addition & 1 deletion
2
Resources/Prototypes/_CorvaxNext/Entities/Clothing/Neck/secbadge.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
25 changes: 25 additions & 0 deletions
25
Resources/Prototypes/_CorvaxNext/Entities/Objects/Tools/bodycamera.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,25 @@ | ||
- type: entity | ||
abstract: true | ||
parent: BaseItem | ||
id: BaseBodyCamera | ||
components: | ||
- type: Eye | ||
- type: WirelessNetworkConnection | ||
- type: UserInterface | ||
interfaces: | ||
enum.SurveillanceCameraSetupUiKey.Camera: | ||
type: SurveillanceCameraSetupBoundUi | ||
- type: DeviceNetwork | ||
deviceNetId: Wired | ||
receiveFrequencyId: SurveillanceCameraSecurity | ||
transmitFrequencyId: SurveillanceCamera | ||
- type: SurveillanceCamera | ||
setupAvailableNetworks: | ||
- SurveillanceCameraSecurity | ||
networkSet: true | ||
id: "Нагрудная камера" | ||
- type: SurveillanceCameraMicrophone | ||
- type: ActiveListener | ||
range: 6 | ||
- type: BodyCamera | ||
|