Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Бадикам добавлен в жетоны. #183

Merged
merged 7 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: "Нагрудная камера"
Vonsant marked this conversation as resolved.
Show resolved Hide resolved
- type: SurveillanceCameraMicrophone
- type: ActiveListener
range: 6
- type: BodyCamera

Loading