Skip to content

Commit

Permalink
Бадикам добавлен в жетоны. (#183)
Browse files Browse the repository at this point in the history
* SecCam

* meh

* Fixes

* fixes

* Добавлено описание

* Why are we still here?

* Just to suffer?
  • Loading branch information
Vonsant authored Dec 23, 2024
1 parent 81f9b7b commit 80eb8ac
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Content.Server/_CorvaxNext/BodyCam/BodyCameraComponent.cs
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;
53 changes: 53 additions & 0 deletions Content.Server/_CorvaxNext/BodyCam/BodyCameraSystem.cs
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);
}
}
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 = Стандартный жетон главы службы безопасности. Встроенная камера обеспечивает постоянное наблюдение и архивирование данных.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- type: entity
parent: ClothingNeckBase
parent: [ClothingNeckBase, BaseBodyCamera]
id: ClothingNeckSecBadgeBase
name: badge
description: Respect my authority!
Expand Down
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

0 comments on commit 80eb8ac

Please sign in to comment.