From 65e799923995a8ca0cf569b9d2ffa945e5ef5fc0 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:32:22 +0300 Subject: [PATCH] Just to suffer? --- .../_CorvaxNext/BodyCam/BodyCameraSystem.cs | 87 +++++++++---------- 1 file changed, 40 insertions(+), 47 deletions(-) diff --git a/Content.Server/_CorvaxNext/BodyCam/BodyCameraSystem.cs b/Content.Server/_CorvaxNext/BodyCam/BodyCameraSystem.cs index 071cfd0ce06..659269ae49f 100644 --- a/Content.Server/_CorvaxNext/BodyCam/BodyCameraSystem.cs +++ b/Content.Server/_CorvaxNext/BodyCam/BodyCameraSystem.cs @@ -3,58 +3,51 @@ using Content.Shared.Clothing.Components; using Robust.Shared.GameObjects; -namespace Content.Server._CorvaxNext.BodyCam +namespace Content.Server._CorvaxNext.BodyCam; + +/// +/// A system that automatically enables or disables a camera +/// depending on whether the item is currently equipped in a clothing slot. +/// +public sealed class BodyCameraSystem : EntitySystem { - /// - /// A system that automatically enables or disables a camera - /// depending on whether the item is currently equipped in a clothing slot. - /// - public sealed class BodyCameraSystem : EntitySystem - { - [Dependency] private readonly SurveillanceCameraSystem _surveillanceSystem = default!; + [Dependency] private readonly SurveillanceCameraSystem _surveillanceSystem = default!; - public override void Initialize() - { - // When the BodyCameraComponent is added, ensure the camera starts off. - SubscribeLocalEvent(OnStartup); + public override void Initialize() + { + // When the BodyCameraComponent is added, ensure the camera starts off. + SubscribeLocalEvent(OnStartup); - // Turn camera on/off when the clothing item is equipped/unequipped. - SubscribeLocalEvent(OnEquipped); - SubscribeLocalEvent(OnUnequipped); - } + // Turn camera on/off when the clothing item is equipped/unequipped. + SubscribeLocalEvent(OnEquipped); + SubscribeLocalEvent(OnUnequipped); + } - /// - /// On component startup, forcibly disable the camera (if found). - /// - private void OnStartup(EntityUid uid, BodyCameraComponent component, ComponentStartup args) - { - // If there's a SurveillanceCameraComponent, turn it off immediately. - if (TryComp(uid, out var camComp)) - { - _surveillanceSystem.SetActive(uid, false, camComp); - } - } + /// + /// On component startup, forcibly disable the camera (if found). + /// + private void OnStartup(EntityUid uid, BodyCameraComponent component, ComponentStartup args) + { + // If there's a SurveillanceCameraComponent, turn it off immediately. + if (TryComp(uid, out var camComp)) + _surveillanceSystem.SetActive(uid, false, camComp); + } - /// - /// When the item is equipped, turn the camera on. - /// - private void OnEquipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotEquippedEvent args) - { - if (TryComp(uid, out var camComp)) - { - _surveillanceSystem.SetActive(uid, true, camComp); - } - } + /// + /// When the item is equipped, turn the camera on. + /// + private void OnEquipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotEquippedEvent args) + { + if (TryComp(uid, out var camComp)) + _surveillanceSystem.SetActive(uid, true, camComp); + } - /// - /// When the item is unequipped, turn the camera off. - /// - private void OnUnequipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotUnequippedEvent args) - { - if (TryComp(uid, out var camComp)) - { - _surveillanceSystem.SetActive(uid, false, camComp); - } - } + /// + /// When the item is unequipped, turn the camera off. + /// + private void OnUnequipped(EntityUid uid, BodyCameraComponent component, ref ClothingGotUnequippedEvent args) + { + if (TryComp(uid, out var camComp)) + _surveillanceSystem.SetActive(uid, false, camComp); } }