From 8bef6dbeaf635edebbbec3aa21895a8fef646a8c Mon Sep 17 00:00:00 2001
From: iacore <74560659+iacore@users.noreply.github.com>
Date: Mon, 9 Oct 2023 23:40:17 +0000
Subject: [PATCH] cleanup: remove TargetingDoll-related code (#20866)
---
.gitignore | 1 +
Content.Client/CombatMode/CombatModeSystem.cs | 12 -----
Content.Client/Stylesheets/StyleNano.cs | 24 ----------
.../Targeting/UI/TargetingDoll.xaml | 8 ----
.../Targeting/UI/TargetingDoll.xaml.cs | 44 -------------------
.../CombatMode/CombatModeComponent.cs | 4 --
.../Events/CombatModeSystemMessages.cs | 19 --------
.../CombatMode/SharedCombatModeSystem.cs | 10 -----
Content.Shared/Targeting/TargetingZone.cs | 26 -----------
9 files changed, 1 insertion(+), 147 deletions(-)
delete mode 100644 Content.Client/Targeting/UI/TargetingDoll.xaml
delete mode 100644 Content.Client/Targeting/UI/TargetingDoll.xaml.cs
delete mode 100644 Content.Shared/CombatMode/Events/CombatModeSystemMessages.cs
delete mode 100644 Content.Shared/Targeting/TargetingZone.cs
diff --git a/.gitignore b/.gitignore
index b085ccfc7c..0cd376f5dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -162,6 +162,7 @@ PublishScripts/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
+.nuget/
# Microsoft Azure Build Output
csx/
diff --git a/Content.Client/CombatMode/CombatModeSystem.cs b/Content.Client/CombatMode/CombatModeSystem.cs
index 9fccfd173e..69f149c310 100644
--- a/Content.Client/CombatMode/CombatModeSystem.cs
+++ b/Content.Client/CombatMode/CombatModeSystem.cs
@@ -1,7 +1,6 @@
using Content.Client.Hands.Systems;
using Content.Shared.CCVar;
using Content.Shared.CombatMode;
-using Content.Shared.Targeting;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Player;
@@ -44,11 +43,6 @@ public override void Shutdown()
base.Shutdown();
}
- private void OnTargetingZoneChanged(TargetingZone obj)
- {
- EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
- }
-
public bool IsInCombatMode()
{
var entity = _playerManager.LocalPlayer?.ControlledEntity;
@@ -65,12 +59,6 @@ public override void SetInCombatMode(EntityUid entity, bool value, CombatModeCom
UpdateHud(entity);
}
- public override void SetActiveZone(EntityUid entity, TargetingZone zone, CombatModeComponent? component = null)
- {
- base.SetActiveZone(entity, zone, component);
- UpdateHud(entity);
- }
-
private void UpdateHud(EntityUid entity)
{
if (entity != _playerManager.LocalPlayer?.ControlledEntity || !Timing.IsFirstTimePredicted)
diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs
index d79e7aa78c..071429a992 100644
--- a/Content.Client/Stylesheets/StyleNano.cs
+++ b/Content.Client/Stylesheets/StyleNano.cs
@@ -4,7 +4,6 @@
using Content.Client.Examine;
using Content.Client.PDA;
using Content.Client.Resources;
-using Content.Client.Targeting.UI;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Controls.FancyTree;
using Content.Client.Verbs.UI;
@@ -1148,29 +1147,6 @@ public StyleNano(IResourceCache resCache) : base(resCache)
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
}),
- // Targeting doll
-
- new StyleRule(
- new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
- new[] {TextureButton.StylePseudoClassNormal}), new[]
- {
- new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDefault),
- }),
-
- new StyleRule(
- new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
- new[] {TextureButton.StylePseudoClassHover}), new[]
- {
- new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorHovered),
- }),
-
- new StyleRule(
- new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
- new[] {TextureButton.StylePseudoClassPressed}), new[]
- {
- new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorPressed),
- }),
-
// NanoHeading
new StyleRule(
diff --git a/Content.Client/Targeting/UI/TargetingDoll.xaml b/Content.Client/Targeting/UI/TargetingDoll.xaml
deleted file mode 100644
index f50ddfe448..0000000000
--- a/Content.Client/Targeting/UI/TargetingDoll.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
diff --git a/Content.Client/Targeting/UI/TargetingDoll.xaml.cs b/Content.Client/Targeting/UI/TargetingDoll.xaml.cs
deleted file mode 100644
index 5425e6b6a4..0000000000
--- a/Content.Client/Targeting/UI/TargetingDoll.xaml.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using Content.Shared.Targeting;
-using Robust.Client.AutoGenerated;
-using Robust.Client.UserInterface.Controls;
-using Robust.Client.UserInterface.XAML;
-
-namespace Content.Client.Targeting.UI;
-
-[GenerateTypedNameReferences]
-public sealed partial class TargetingDoll : BoxContainer
-{
- public static readonly string StyleClassTargetDollZone = "target-doll-zone";
-
-
- private TargetingZone _activeZone = TargetingZone.Middle;
-
- public event Action? OnZoneChanged;
- public TargetingDoll()
- {
- RobustXamlLoader.Load(this);
- }
-
- public TargetingZone ActiveZone
- {
- get => _activeZone;
- set
- {
- if (_activeZone == value)
- {
- return;
- }
-
- _activeZone = value;
- OnZoneChanged?.Invoke(value);
-
- UpdateButtons();
- }
- }
- private void UpdateButtons()
- {
- ButtonHigh.Pressed = _activeZone == TargetingZone.High;
- ButtonMedium.Pressed = _activeZone == TargetingZone.Middle;
- ButtonLow.Pressed = _activeZone == TargetingZone.Low;
- }
-}
diff --git a/Content.Shared/CombatMode/CombatModeComponent.cs b/Content.Shared/CombatMode/CombatModeComponent.cs
index 6696f8af80..124a682d5c 100644
--- a/Content.Shared/CombatMode/CombatModeComponent.cs
+++ b/Content.Shared/CombatMode/CombatModeComponent.cs
@@ -1,6 +1,5 @@
using Content.Shared.MouseRotator;
using Content.Shared.Movement.Components;
-using Content.Shared.Targeting;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -49,8 +48,5 @@ public sealed partial class CombatModeComponent : Component
///
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;
-
- [ViewVariables(VVAccess.ReadWrite), DataField("activeZone"), AutoNetworkedField]
- public TargetingZone ActiveZone;
}
}
diff --git a/Content.Shared/CombatMode/Events/CombatModeSystemMessages.cs b/Content.Shared/CombatMode/Events/CombatModeSystemMessages.cs
deleted file mode 100644
index 819a449349..0000000000
--- a/Content.Shared/CombatMode/Events/CombatModeSystemMessages.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Content.Shared.Targeting;
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.CombatMode
-{
- public static class CombatModeSystemMessages
- {
- [Serializable, NetSerializable]
- public sealed class SetTargetZoneMessage : EntityEventArgs
- {
- public SetTargetZoneMessage(TargetingZone targetZone)
- {
- TargetZone = targetZone;
- }
-
- public TargetingZone TargetZone { get; }
- }
- }
-}
diff --git a/Content.Shared/CombatMode/SharedCombatModeSystem.cs b/Content.Shared/CombatMode/SharedCombatModeSystem.cs
index 0b57840add..5fe763370f 100644
--- a/Content.Shared/CombatMode/SharedCombatModeSystem.cs
+++ b/Content.Shared/CombatMode/SharedCombatModeSystem.cs
@@ -2,7 +2,6 @@
using Content.Shared.MouseRotator;
using Content.Shared.Movement.Components;
using Content.Shared.Popups;
-using Content.Shared.Targeting;
using Robust.Shared.Network;
using Robust.Shared.Timing;
@@ -89,15 +88,6 @@ public virtual void SetInCombatMode(EntityUid entity, bool value, CombatModeComp
SetMouseRotatorComponents(entity, value);
}
- public virtual void SetActiveZone(EntityUid entity, TargetingZone zone,
- CombatModeComponent? component = null)
- {
- if (!Resolve(entity, ref component))
- return;
-
- component.ActiveZone = zone;
- }
-
private void SetMouseRotatorComponents(EntityUid uid, bool value)
{
if (value)
diff --git a/Content.Shared/Targeting/TargetingZone.cs b/Content.Shared/Targeting/TargetingZone.cs
deleted file mode 100644
index 733563d7e4..0000000000
--- a/Content.Shared/Targeting/TargetingZone.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Targeting
-{
- ///
- /// Zones the player can target for attacks.
- ///
- [Serializable, NetSerializable]
- public enum TargetingZone
- {
- ///
- /// Torso/arm area.
- ///
- Middle,
-
- ///
- /// Legs/groin area.
- ///
- Low,
-
- ///
- /// Go for the head.
- ///
- High
- }
-}