cleanup: remove TargetingDoll-related code (#20866)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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/
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user