From 375d44e277d37f0a12ba93b3db07fe330fffadb9 Mon Sep 17 00:00:00 2001 From: Cat <115424457+CatBackGround@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:11:22 +0500 Subject: [PATCH] Delete Content.Client/Backmen/AccessWeaponBlockerSystem directory --- .../AccessWeaponBlockerComponent.cs | 13 ---- .../AccessWeaponBlockerSystem.cs | 64 ------------------- 2 files changed, 77 deletions(-) delete mode 100644 Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerComponent.cs delete mode 100644 Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerSystem.cs diff --git a/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerComponent.cs b/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerComponent.cs deleted file mode 100644 index 83e96b0450a..00000000000 --- a/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Content.Shared.Backmen.AccessWeaponBlockerSystem; - -namespace Content.Client.Backmen.AccessWeaponBlockerSystem; - -[RegisterComponent] -public sealed partial class AccessWeaponBlockerComponent : SharedAccessWeaponBlockerComponent -{ - [ViewVariables(VVAccess.ReadWrite)] - public bool CanUse; - - [ViewVariables(VVAccess.ReadWrite)] - public string AlertText = ""; -} diff --git a/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerSystem.cs b/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerSystem.cs deleted file mode 100644 index 823cf8b7df7..00000000000 --- a/Content.Client/Backmen/AccessWeaponBlockerSystem/AccessWeaponBlockerSystem.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Content.Shared.Interaction.Events; -using Content.Shared.Backmen.AccessWeaponBlockerSystem; -using Content.Shared.Weapons.Melee.Events; -using Content.Shared.Weapons.Ranged.Systems; -using Robust.Shared.GameStates; - -namespace Content.Client.Backmen.AccessWeaponBlockerSystem; - -public sealed class AccessWeaponBlockerSystem : EntitySystem -{ - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnShootAttempt); - SubscribeLocalEvent(OnMeleeAttempt); - SubscribeLocalEvent(OnUseAttempt); - SubscribeLocalEvent(OnInteractAttempt); - SubscribeLocalEvent(OnAccessWeaponBlockerHandleState); - } - - private void OnUseAttempt(EntityUid uid, AccessWeaponBlockerComponent component, ref UseAttemptEvent args) - { - if (component.CanUse) - return; - - args.Cancel(); - } - - private void OnInteractAttempt(EntityUid uid, AccessWeaponBlockerComponent component, ref InteractionAttemptEvent args) - { - if (component.CanUse) - return; - - args.Cancelled = true; - } - - private void OnAccessWeaponBlockerHandleState(EntityUid uid, AccessWeaponBlockerComponent component, ref ComponentHandleState args) - { - if (args.Current is not AccessWeaponBlockerComponentState state) - return; - - component.CanUse = state.CanUse; - component.AlertText = state.AlertText; - } - - private void OnMeleeAttempt(EntityUid uid, AccessWeaponBlockerComponent component, ref AttemptMeleeEvent args) - { - if (component.CanUse) - return; - - args.Cancelled = true; - args.Message = component.AlertText; - } - - private void OnShootAttempt(EntityUid uid, AccessWeaponBlockerComponent component, ref AttemptShootEvent args) - { - if (component.CanUse) - return; - - args.Cancelled = true; - args.Message = component.AlertText; - } -}