]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
New indicators for combat mode (#15427)
authorArtjom <artjombebenin@gmail.com>
Sat, 6 May 2023 05:06:42 +0000 (08:06 +0300)
committerGitHub <noreply@github.com>
Sat, 6 May 2023 05:06:42 +0000 (15:06 +1000)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs [new file with mode: 0644]
Content.Client/CombatMode/CombatModeSystem.cs
Content.Client/Options/UI/Tabs/GraphicsTab.xaml
Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs
Content.Server/CombatMode/CombatModeSystem.cs
Content.Shared/CCVar/CCVars.cs
Content.Shared/CombatMode/SharedCombatModeSystem.cs
Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_sight.png [new file with mode: 0644]
Resources/Textures/Interface/Misc/crosshair_pointers.rsi/melee_sight.png [new file with mode: 0644]
Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json [new file with mode: 0644]

diff --git a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs
new file mode 100644 (file)
index 0000000..8d4eedb
--- /dev/null
@@ -0,0 +1,87 @@
+using Content.Client.Hands.Systems;
+using Content.Shared.Weapons.Ranged.Components;
+using Robust.Client.GameObjects;
+using Robust.Client.Graphics;
+using Robust.Client.Input;
+using Robust.Client.UserInterface;
+using Robust.Shared.Enums;
+using Robust.Shared.Utility;
+
+namespace Content.Client.CombatMode;
+
+/// <summary>
+///   This shows something like crosshairs for the combat mode next to the mouse cursor.
+///   For weapons with the gun class, a crosshair of one type is displayed,
+///   while for all other types of weapons and items in hand, as well as for an empty hand,
+///   a crosshair of a different type is displayed. These crosshairs simply show the state of combat mode (on|off).
+/// </summary>
+public sealed class CombatModeIndicatorsOverlay : Overlay
+{
+    private readonly IInputManager _inputManager;
+    private readonly IEntityManager _entMan;
+    private readonly IEyeManager _eye;
+    private readonly CombatModeSystem _combat;
+    private readonly HandsSystem _hands = default!;
+
+    private readonly Texture _gunSight;
+    private readonly Texture _meleeSight;
+
+    public override OverlaySpace Space => OverlaySpace.ScreenSpace;
+
+    public Color MainColor = Color.White.WithAlpha(0.3f);
+    public Color StrokeColor = Color.Black.WithAlpha(0.5f);
+    public float Scale = 0.8f;  // 1 is a little big
+
+    public CombatModeIndicatorsOverlay(IInputManager input, IEntityManager entMan,
+            IEyeManager eye, CombatModeSystem combatSys, HandsSystem hands)
+    {
+        _inputManager = input;
+        _entMan = entMan;
+        _eye = eye;
+        _combat = combatSys;
+        _hands = hands;
+
+        var spriteSys = _entMan.EntitySysManager.GetEntitySystem<SpriteSystem>();
+        _gunSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"),
+            "gun_sight"));
+        _meleeSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"),
+             "melee_sight"));
+    }
+
+    protected override bool BeforeDraw(in OverlayDrawArgs args)
+    {
+        if (!_combat.IsInCombatMode())
+            return false;
+
+        return base.BeforeDraw(in args);
+    }
+
+    protected override void Draw(in OverlayDrawArgs args)
+    {
+        var mouseScreenPosition = _inputManager.MouseScreenPosition;
+        var mousePosMap = _eye.ScreenToMap(mouseScreenPosition);
+        if (mousePosMap.MapId != args.MapId)
+            return;
+
+        var handEntity = _hands.GetActiveHandEntity();
+        var isHandGunItem = _entMan.HasComponent<GunComponent>(handEntity);
+
+        var mousePos = mouseScreenPosition.Position;
+        var uiScale = (args.ViewportControl as Control)?.UIScale ?? 1f;
+        var limitedScale = uiScale > 1.25f ? 1.25f : uiScale;
+
+        var sight = isHandGunItem ? _gunSight : _meleeSight;
+        DrawSight(sight, args.ScreenHandle, mousePos, limitedScale * Scale);
+    }
+
+    private void DrawSight(Texture sight, DrawingHandleScreen screen, Vector2 centerPos, float scale)
+    {
+        var sightSize = sight.Size * scale;
+        var expandedSize = sightSize + 7f;
+
+        screen.DrawTextureRect(sight,
+            UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), StrokeColor);
+        screen.DrawTextureRect(sight,
+            UIBox2.FromDimensions(centerPos - expandedSize * 0.5f, expandedSize), MainColor);
+    }
+}
index 63792385c10b04dd538be3a4439f58fc407b68df..d89afba2148ac4c211e0d87df2c48a55b4a6a13a 100644 (file)
+using Content.Client.Hands.Systems;
 using Content.Shared.CombatMode;
 using Content.Shared.Targeting;
-using JetBrains.Annotations;
+using Content.Shared.CCVar;
 using Robust.Client.Player;
+using Robust.Client.Input;
+using Robust.Client.Graphics;
 using Robust.Shared.GameStates;
-using Robust.Shared.Input.Binding;
+using Robust.Shared.Configuration;
 
-namespace Content.Client.CombatMode
+namespace Content.Client.CombatMode;
+
+public sealed class CombatModeSystem : SharedCombatModeSystem
 {
-    [UsedImplicitly]
-    public sealed class CombatModeSystem : SharedCombatModeSystem
+    [Dependency] private readonly IOverlayManager _overlayManager = default!;
+    [Dependency] private readonly IPlayerManager _playerManager = default!;
+    [Dependency] private readonly IConfigurationManager _cfg = default!;
+    [Dependency] private readonly IInputManager _inputManager = default!;
+    [Dependency] private readonly IEyeManager _eye = default!;
+    public event Action? LocalPlayerCombatModeUpdated;
+
+    public override void Initialize()
     {
-        [Dependency] private readonly IPlayerManager _playerManager = default!;
+        base.Initialize();
 
-        public event Action? LocalPlayerCombatModeUpdated;
+        SubscribeLocalEvent<CombatModeComponent, ComponentHandleState>(OnHandleState);
 
-        public override void Initialize()
-        {
-            base.Initialize();
+        _cfg.OnValueChanged(CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged, true);
+    }
 
-            SubscribeLocalEvent<CombatModeComponent, ComponentHandleState>(OnHandleState);
-        }
+    private void OnHandleState(EntityUid uid, CombatModeComponent component, ref ComponentHandleState args)
+    {
+        if (args.Current is not CombatModeComponentState state)
+            return;
 
-        private void OnHandleState(EntityUid uid, CombatModeComponent component, ref ComponentHandleState args)
-        {
-            if (args.Current is not CombatModeComponentState state)
-                return;
+        component.IsInCombatMode = state.IsInCombatMode;
+        component.ActiveZone = state.TargetingZone;
+        UpdateHud(uid);
+    }
 
-            component.IsInCombatMode = state.IsInCombatMode;
-            component.ActiveZone = state.TargetingZone;
-            UpdateHud(uid);
-        }
+    public override void Shutdown()
+    {
+        _cfg.OnValueChanged(CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged);
+        _overlayManager.RemoveOverlay<CombatModeIndicatorsOverlay>();
 
-        public override void Shutdown()
-        {
-            CommandBinds.Unregister<CombatModeSystem>();
-            base.Shutdown();
-        }
+        base.Shutdown();
+    }
 
-        private void OnTargetingZoneChanged(TargetingZone obj)
-        {
-            EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
-        }
+    private void OnTargetingZoneChanged(TargetingZone obj)
+    {
+        EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
+    }
 
-        public bool IsInCombatMode()
-        {
-            var entity = _playerManager.LocalPlayer?.ControlledEntity;
+    public bool IsInCombatMode()
+    {
+        var entity = _playerManager.LocalPlayer?.ControlledEntity;
 
-            if (entity == null)
-                return false;
+        if (entity == null)
+            return false;
 
-            return IsInCombatMode(entity.Value);
-        }
+        return IsInCombatMode(entity.Value);
+    }
+
+    public override void SetInCombatMode(EntityUid entity, bool inCombatMode, CombatModeComponent? component = null)
+    {
+        base.SetInCombatMode(entity, inCombatMode, component);
+        UpdateHud(entity);
+    }
+
+    public override void SetActiveZone(EntityUid entity, TargetingZone zone, CombatModeComponent? component = null)
+    {
+        base.SetActiveZone(entity, zone, component);
+        UpdateHud(entity);
+    }
 
-        public override void SetInCombatMode(EntityUid entity, bool inCombatMode, CombatModeComponent? component = null)
+    private void UpdateHud(EntityUid entity)
+    {
+        if (entity != _playerManager.LocalPlayer?.ControlledEntity)
         {
-            base.SetInCombatMode(entity, inCombatMode, component);
-            UpdateHud(entity);
+            return;
         }
 
-        public override void SetActiveZone(EntityUid entity, TargetingZone zone, CombatModeComponent? component = null)
+        LocalPlayerCombatModeUpdated?.Invoke();
+    }
+
+    private void OnShowCombatIndicatorsChanged(bool isShow)
+    {
+        if (isShow)
         {
-            base.SetActiveZone(entity, zone, component);
-            UpdateHud(entity);
+            _overlayManager.AddOverlay(new CombatModeIndicatorsOverlay(
+                _inputManager,
+                EntityManager,
+                _eye,
+                this,
+                EntityManager.System<HandsSystem>()));
         }
-
-        private void UpdateHud(EntityUid entity)
+        else
         {
-            if (entity != _playerManager.LocalPlayer?.ControlledEntity)
-            {
-                return;
-            }
-
-            LocalPlayerCombatModeUpdated?.Invoke();
+            _overlayManager.RemoveOverlay<CombatModeIndicatorsOverlay>();
         }
     }
 }
index caf4dca99a47518b6b940d2f36f97b401fa1b3c7..41b304417a2a24e29ad86f5bcbffba390d61321d 100644 (file)
@@ -21,6 +21,7 @@
                 <OptionButton Name="HudThemeOption" />
             </BoxContainer>
             <CheckBox Name="ShowHeldItemCheckBox" Text="{Loc 'ui-options-show-held-item'}" />
+            <CheckBox Name="ShowCombatModeIndicatorsCheckBox" Text="{Loc 'ui-options-show-combat-mode-indicators'}" />
             <BoxContainer Orientation="Horizontal">
                 <CheckBox Name="ViewportStretchCheckBox" Text="{Loc 'ui-options-vp-stretch'}" />
                 <BoxContainer Name="ViewportScaleBox" Orientation="Horizontal">
index b45b5db477b3f711d8d00fc72508a0861bc4f164..87adbd1ca89b96e7cf7a1eded9848395776f7f25 100644 (file)
@@ -99,6 +99,7 @@ namespace Content.Client.Options.UI.Tabs
             };
 
             ShowHeldItemCheckBox.OnToggled += OnCheckBoxToggled;
+            ShowCombatModeIndicatorsCheckBox.OnToggled += OnCheckBoxToggled;
             IntegerScalingCheckBox.OnToggled += OnCheckBoxToggled;
             ViewportLowResCheckBox.OnToggled += OnCheckBoxToggled;
             ParallaxLowQualityCheckBox.OnToggled += OnCheckBoxToggled;
@@ -116,6 +117,7 @@ namespace Content.Client.Options.UI.Tabs
             ParallaxLowQualityCheckBox.Pressed = _cfg.GetCVar(CCVars.ParallaxLowQuality);
             FpsCounterCheckBox.Pressed = _cfg.GetCVar(CCVars.HudFpsCounterVisible);
             ShowHeldItemCheckBox.Pressed = _cfg.GetCVar(CCVars.HudHeldItemShow);
+            ShowCombatModeIndicatorsCheckBox.Pressed = _cfg.GetCVar(CCVars.CombatModeIndicatorsPointShow);
             ViewportWidthSlider.Value = _cfg.GetCVar(CCVars.ViewportWidth);
 
             _cfg.OnValueChanged(CCVars.ViewportMinimumWidth, _ => UpdateViewportWidthRange());
@@ -158,6 +160,7 @@ namespace Content.Client.Options.UI.Tabs
             _cfg.SetCVar(CCVars.ViewportScaleRender, !ViewportLowResCheckBox.Pressed);
             _cfg.SetCVar(CCVars.ParallaxLowQuality, ParallaxLowQualityCheckBox.Pressed);
             _cfg.SetCVar(CCVars.HudHeldItemShow, ShowHeldItemCheckBox.Pressed);
+            _cfg.SetCVar(CCVars.CombatModeIndicatorsPointShow, ShowCombatModeIndicatorsCheckBox.Pressed);
             _cfg.SetCVar(CCVars.HudFpsCounterVisible, FpsCounterCheckBox.Pressed);
             _cfg.SetCVar(CCVars.ViewportWidth, (int) ViewportWidthSlider.Value);
 
@@ -194,6 +197,7 @@ namespace Content.Client.Options.UI.Tabs
             var isVPResSame = ViewportLowResCheckBox.Pressed == !_cfg.GetCVar(CCVars.ViewportScaleRender);
             var isPLQSame = ParallaxLowQualityCheckBox.Pressed == _cfg.GetCVar(CCVars.ParallaxLowQuality);
             var isShowHeldItemSame = ShowHeldItemCheckBox.Pressed == _cfg.GetCVar(CCVars.HudHeldItemShow);
+            var isCombatModeIndicatorsSame = ShowCombatModeIndicatorsCheckBox.Pressed == _cfg.GetCVar(CCVars.CombatModeIndicatorsPointShow);
             var isFpsCounterVisibleSame = FpsCounterCheckBox.Pressed == _cfg.GetCVar(CCVars.HudFpsCounterVisible);
             var isWidthSame = (int) ViewportWidthSlider.Value == _cfg.GetCVar(CCVars.ViewportWidth);
             var isLayoutSame = HudLayoutOption.SelectedMetadata is string opt && opt == _cfg.GetCVar(CCVars.UILayout);
@@ -209,6 +213,7 @@ namespace Content.Client.Options.UI.Tabs
                                    isPLQSame &&
                                    isHudThemeSame &&
                                    isShowHeldItemSame &&
+                                   isCombatModeIndicatorsSame &&
                                    isFpsCounterVisibleSame &&
                                    isWidthSame &&
                                    isLayoutSame;
index 3ad2e5aa19bc17771401394d0b9e2e5d4b0386c6..945a7f67ce9014f24f1e416a74909b15036184d1 100644 (file)
@@ -2,21 +2,19 @@ using Content.Shared.CombatMode;
 using JetBrains.Annotations;
 using Robust.Shared.GameStates;
 
-namespace Content.Server.CombatMode
+namespace Content.Server.CombatMode;
+
+public sealed class CombatModeSystem : SharedCombatModeSystem
 {
-    [UsedImplicitly]
-    public sealed class CombatModeSystem : SharedCombatModeSystem
+    public override void Initialize()
     {
-        public override void Initialize()
-        {
-            base.Initialize();
+        base.Initialize();
 
-            SubscribeLocalEvent<CombatModeComponent, ComponentGetState>(OnGetState);
-        }
+        SubscribeLocalEvent<CombatModeComponent, ComponentGetState>(OnGetState);
+    }
 
-        private void OnGetState(EntityUid uid, CombatModeComponent component, ref ComponentGetState args)
-        {
-            args.State = new CombatModeComponentState(component.IsInCombatMode, component.ActiveZone);
-        }
+    private void OnGetState(EntityUid uid, CombatModeComponent component, ref ComponentGetState args)
+    {
+        args.State = new CombatModeComponentState(component.IsInCombatMode, component.ActiveZone);
     }
 }
index 4aad6a444067969894c85e0e1b126e4ebf63798d..29e3c6072caa22a771236c8854d7b0e9b548f55d 100644 (file)
@@ -572,6 +572,9 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<bool> HudHeldItemShow =
             CVarDef.Create("hud.held_item_show", true, CVar.ARCHIVE | CVar.CLIENTONLY);
 
+        public static readonly CVarDef<bool> CombatModeIndicatorsPointShow =
+            CVarDef.Create("hud.combat_mode_indicators_point_show", true, CVar.ARCHIVE | CVar.CLIENTONLY);
+
         public static readonly CVarDef<float> HudHeldItemOffset =
             CVarDef.Create("hud.held_item_offset", 28f, CVar.ARCHIVE | CVar.CLIENTONLY);
 
@@ -919,7 +922,7 @@ namespace Content.Shared.CCVar
         /// Whether or not OOC chat should be enabled during a round.
         /// </summary>
         public static readonly CVarDef<bool> OocEnableDuringRound =
-            CVarDef.Create("ooc.enable_during_round", false, CVar.NOTIFY | CVar.REPLICATED |CVar.SERVER);
+            CVarDef.Create("ooc.enable_during_round", false, CVar.NOTIFY | CVar.REPLICATED | CVar.SERVER);
 
         /*
          * LOOC
@@ -1101,7 +1104,7 @@ namespace Content.Shared.CCVar
         /// </summary>
         public static readonly CVarDef<bool> CargoShuttles =
             CVarDef.Create("shuttle.cargo", true, CVar.SERVERONLY);
-        
+
         /// <summary>
         /// Whether to automatically spawn escape shuttles.
         /// </summary>
index 57c7b5c8d812ec635050d6d211bc06056a833494..244752e32259fea5b98e92ee0271cb2efa520f39 100644 (file)
@@ -6,101 +6,100 @@ using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
 
-namespace Content.Shared.CombatMode
+namespace Content.Shared.CombatMode;
+
+public abstract class SharedCombatModeSystem : EntitySystem
 {
-    public abstract class SharedCombatModeSystem : EntitySystem
-    {
-        [Dependency] private readonly IPrototypeManager _protoMan = default!;
-        [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
-        [Dependency] private readonly SharedPopupSystem _popup = default!;
-        [Dependency] private readonly IGameTiming _timing = default!;
+    [Dependency] private readonly IPrototypeManager _protoMan = default!;
+    [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+    [Dependency] private readonly SharedPopupSystem _popup = default!;
+    [Dependency] private readonly IGameTiming _timing = default!;
 
-        public override void Initialize()
-        {
-            base.Initialize();
+    public override void Initialize()
+    {
+        base.Initialize();
 
-            SubscribeLocalEvent<CombatModeComponent, ComponentStartup>(OnStartup);
-            SubscribeLocalEvent<CombatModeComponent, ComponentShutdown>(OnShutdown);
-            SubscribeLocalEvent<CombatModeComponent, ToggleCombatActionEvent>(OnActionPerform);
-        }
+        SubscribeLocalEvent<CombatModeComponent, ComponentStartup>(OnStartup);
+        SubscribeLocalEvent<CombatModeComponent, ComponentShutdown>(OnShutdown);
+        SubscribeLocalEvent<CombatModeComponent, ToggleCombatActionEvent>(OnActionPerform);
+    }
 
-        private void OnStartup(EntityUid uid, CombatModeComponent component, ComponentStartup args)
+    private void OnStartup(EntityUid uid, CombatModeComponent component, ComponentStartup args)
+    {
+        if (component.CombatToggleAction == null
+            && _protoMan.TryIndex(component.CombatToggleActionId, out InstantActionPrototype? toggleProto))
         {
-            if (component.CombatToggleAction == null
-                && _protoMan.TryIndex(component.CombatToggleActionId, out InstantActionPrototype? toggleProto))
-            {
-                component.CombatToggleAction = new(toggleProto);
-            }
-
-            if (component.CombatToggleAction != null)
-                _actionsSystem.AddAction(uid, component.CombatToggleAction, null);
+            component.CombatToggleAction = new(toggleProto);
         }
 
-        private void OnShutdown(EntityUid uid, CombatModeComponent component, ComponentShutdown args)
-        {
-            if (component.CombatToggleAction != null)
-                _actionsSystem.RemoveAction(uid, component.CombatToggleAction);
-        }
+        if (component.CombatToggleAction != null)
+            _actionsSystem.AddAction(uid, component.CombatToggleAction, null);
+    }
 
-        private void OnActionPerform(EntityUid uid, CombatModeComponent component, ToggleCombatActionEvent args)
-        {
-            if (args.Handled)
-                return;
+    private void OnShutdown(EntityUid uid, CombatModeComponent component, ComponentShutdown args)
+    {
+        if (component.CombatToggleAction != null)
+            _actionsSystem.RemoveAction(uid, component.CombatToggleAction);
+    }
 
-            args.Handled = true;
-            SetInCombatMode(uid, !component.IsInCombatMode, component);
+    private void OnActionPerform(EntityUid uid, CombatModeComponent component, ToggleCombatActionEvent args)
+    {
+        if (args.Handled)
+            return;
 
-            if (!_timing.IsFirstTimePredicted)
-                return;
+        args.Handled = true;
+        SetInCombatMode(uid, !component.IsInCombatMode, component);
 
-            var msg = component.IsInCombatMode ? "action-popup-combat-enabled" : "action-popup-combat-disabled";
-            _popup.PopupEntity(Loc.GetString(msg), args.Performer, args.Performer);
-        }
+        if (!_timing.IsFirstTimePredicted)
+            return;
 
-        public void SetCanDisarm(EntityUid entity, bool canDisarm, CombatModeComponent? component = null)
-        {
-            if (!Resolve(entity, ref component))
-                return;
+        var msg = component.IsInCombatMode ? "action-popup-combat-enabled" : "action-popup-combat-disabled";
+        _popup.PopupEntity(Loc.GetString(msg), args.Performer, args.Performer);
+    }
 
-            component.CanDisarm = canDisarm;
-        }
+    public void SetCanDisarm(EntityUid entity, bool canDisarm, CombatModeComponent? component = null)
+    {
+        if (!Resolve(entity, ref component))
+            return;
 
-        public bool IsInCombatMode(EntityUid? entity, CombatModeComponent? component = null)
-        {
-            return entity != null && Resolve(entity.Value, ref component, false) && component.IsInCombatMode;
-        }
+        component.CanDisarm = canDisarm;
+    }
 
-        public virtual void SetInCombatMode(EntityUid entity, bool inCombatMode,
-            CombatModeComponent? component = null)
-        {
-            if (!Resolve(entity, ref component))
-                return;
+    public bool IsInCombatMode(EntityUid? entity, CombatModeComponent? component = null)
+    {
+        return entity != null && Resolve(entity.Value, ref component, false) && component.IsInCombatMode;
+    }
 
-            component.IsInCombatMode = inCombatMode;
-        }
+    public virtual void SetInCombatMode(EntityUid entity, bool inCombatMode,
+        CombatModeComponent? component = null)
+    {
+        if (!Resolve(entity, ref component))
+            return;
 
-        public virtual void SetActiveZone(EntityUid entity, TargetingZone zone,
-            CombatModeComponent? component = null)
-        {
-            if (!Resolve(entity, ref component))
-                return;
+        component.IsInCombatMode = inCombatMode;
+    }
 
-            component.ActiveZone = zone;
-        }
+    public virtual void SetActiveZone(EntityUid entity, TargetingZone zone,
+        CombatModeComponent? component = null)
+    {
+        if (!Resolve(entity, ref component))
+            return;
+
+        component.ActiveZone = zone;
+    }
 
-        [Serializable, NetSerializable]
-        protected sealed class CombatModeComponentState : ComponentState
+    [Serializable, NetSerializable]
+    protected sealed class CombatModeComponentState : ComponentState
+    {
+        public bool IsInCombatMode { get; }
+        public TargetingZone TargetingZone { get; }
+
+        public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone)
         {
-            public bool IsInCombatMode { get; }
-            public TargetingZone TargetingZone { get; }
-
-            public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone)
-            {
-                IsInCombatMode = isInCombatMode;
-                TargetingZone = targetingZone;
-            }
+            IsInCombatMode = isInCombatMode;
+            TargetingZone = targetingZone;
         }
     }
-
-    public sealed class ToggleCombatActionEvent : InstantActionEvent { }
 }
+
+public sealed class ToggleCombatActionEvent : InstantActionEvent { }
index 9359b7ca21254a48f7ed585a78be598a0734ad72..0caa547301018572bb4c82a1e0490de62806bf7d 100644 (file)
@@ -29,6 +29,7 @@ ui-options-volume-percent = { TOSTRING($volume, "P0") }
 ## Graphics menu
 
 ui-options-show-held-item = Show held item next to cursor?
+ui-options-show-combat-mode-indicators = Show combat mode indicators with cursor?
 ui-options-vsync = VSync
 ui-options-fullscreen = Fullscreen
 ui-options-lighting-label = Lighting Quality:
diff --git a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_sight.png b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_sight.png
new file mode 100644 (file)
index 0000000..4b50b40
Binary files /dev/null and b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_sight.png differ
diff --git a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/melee_sight.png b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/melee_sight.png
new file mode 100644 (file)
index 0000000..8ab45b0
Binary files /dev/null and b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/melee_sight.png differ
diff --git a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json
new file mode 100644 (file)
index 0000000..a9ef50c
--- /dev/null
@@ -0,0 +1,17 @@
+{
+  "version": 1,
+  "license": "CC-BY-SA-3.0",
+  "copyright": "https://github.com/Arteben",
+  "size": {
+    "x": 64,
+    "y": 64
+  },
+  "states": [
+    {
+      "name": "gun_sight"
+    },
+    {
+      "name": "melee_sight"
+    }
+  ]
+}