]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
cleanup: remove TargetingDoll-related code (#20866)
authoriacore <74560659+iacore@users.noreply.github.com>
Mon, 9 Oct 2023 23:40:17 +0000 (23:40 +0000)
committerGitHub <noreply@github.com>
Mon, 9 Oct 2023 23:40:17 +0000 (16:40 -0700)
.gitignore
Content.Client/CombatMode/CombatModeSystem.cs
Content.Client/Stylesheets/StyleNano.cs
Content.Client/Targeting/UI/TargetingDoll.xaml [deleted file]
Content.Client/Targeting/UI/TargetingDoll.xaml.cs [deleted file]
Content.Shared/CombatMode/CombatModeComponent.cs
Content.Shared/CombatMode/Events/CombatModeSystemMessages.cs [deleted file]
Content.Shared/CombatMode/SharedCombatModeSystem.cs
Content.Shared/Targeting/TargetingZone.cs [deleted file]

index 42c93e1fc35603bb1b86e42ca8f8ae6abbbc3639..2dd5912047c6ee090c64378560c0e601cba1d74a 100644 (file)
@@ -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/
index 9fccfd173e8ea6139ff4ea1e411b807f35fa5767..69f149c310a95bfeacd5a5594ece12cb9120aafb 100644 (file)
@@ -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 sealed class CombatModeSystem : SharedCombatModeSystem
         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 sealed class CombatModeSystem : SharedCombatModeSystem
         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)
index a61eef97b8cc3fc65e93f281746e4ff11def8772..2ef5a63ac7311bc1262ab84f5978ac96ca4907bf 100644 (file)
@@ -4,7 +4,6 @@ using Content.Client.ContextMenu.UI;
 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 @@ namespace Content.Client.Stylesheets
                         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 (file)
index f50ddfe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<targeting:TargetingDoll xmlns="https://spacestation14.io"
-              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-              xmlns:targeting="clr-namespace:Content.Client.Targeting.UI"
-              Orientation="Vertical">
-    <TextureButton Name = "ButtonHigh" TexturePath="/Textures/Interface/target-doll-high.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>
-    <TextureButton Name = "ButtonMedium" TexturePath="/Textures/Interface/target-doll-middle.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>
-    <TextureButton Name = "ButtonLow" TexturePath="/Textures/Interface/target-doll-low.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>
-</targeting:TargetingDoll>
diff --git a/Content.Client/Targeting/UI/TargetingDoll.xaml.cs b/Content.Client/Targeting/UI/TargetingDoll.xaml.cs
deleted file mode 100644 (file)
index 5425e6b..0000000
+++ /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<TargetingZone>? 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;
-    }
-}
index 6696f8af806d6b479481009dbb726ded7c86b2f9..124a682d5c762e0f47d4f874262442d26fa793ca 100644 (file)
@@ -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 @@ namespace Content.Shared.CombatMode
         /// </summary>
         [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 (file)
index 819a449..0000000
+++ /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; }
-        }
-    }
-}
index 0b57840addd5a72022a5eddf129e14206f6d813f..5fe763370fdb0cd78f974cf35eab50752b055981 100644 (file)
@@ -2,7 +2,6 @@ using Content.Shared.Actions;
 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 abstract class SharedCombatModeSystem : EntitySystem
         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 (file)
index 733563d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Targeting
-{
-    /// <summary>
-    ///     Zones the player can target for attacks.
-    /// </summary>
-    [Serializable, NetSerializable]
-    public enum TargetingZone
-    {
-        /// <summary>
-        ///     Torso/arm area.
-        /// </summary>
-        Middle,
-
-        /// <summary>
-        ///     Legs/groin area.
-        /// </summary>
-        Low,
-
-        /// <summary>
-        ///     Go for the head.
-        /// </summary>
-        High
-    }
-}