# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
+.nuget/
# Microsoft Azure Build Output
csx/
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;
base.Shutdown();
}
- private void OnTargetingZoneChanged(TargetingZone obj)
- {
- EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
- }
-
public bool IsInCombatMode()
{
var entity = _playerManager.LocalPlayer?.ControlledEntity;
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)
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;
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(
+++ /dev/null
-<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>
+++ /dev/null
-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;
- }
-}
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;
/// </summary>
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;
-
- [ViewVariables(VVAccess.ReadWrite), DataField("activeZone"), AutoNetworkedField]
- public TargetingZone ActiveZone;
}
}
+++ /dev/null
-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; }
- }
- }
-}
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;
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)
+++ /dev/null
-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
- }
-}