From dc994f9c66f13f8195b7938f849003dc5b37464d Mon Sep 17 00:00:00 2001 From: "I.K" <45953835+notquitehadouken@users.noreply.github.com> Date: Mon, 8 Jan 2024 00:23:41 -0600 Subject: [PATCH] Improve visibility of gun bolts (#23711) * add overlay * ?????? --- .../CombatMode/CombatModeIndicatorsOverlay.cs | 10 +++++++++- .../Weapons/Ranged/Systems/SharedGunSystem.cs | 2 +- .../crosshair_pointers.rsi/gun_bolt_sight.png | Bin 0 -> 2206 bytes .../Misc/crosshair_pointers.rsi/meta.json | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_bolt_sight.png diff --git a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs index 9732a67753..b2bdf2893d 100644 --- a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs +++ b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs @@ -4,6 +4,7 @@ using Content.Shared.Weapons.Ranged.Components; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.Input; +using Robust.Client.Serialization; using Robust.Client.UserInterface; using Robust.Shared.Enums; using Robust.Shared.Graphics; @@ -26,6 +27,7 @@ public sealed class CombatModeIndicatorsOverlay : Overlay private readonly HandsSystem _hands = default!; private readonly Texture _gunSight; + private readonly Texture _gunBoltSight; private readonly Texture _meleeSight; public override OverlaySpace Space => OverlaySpace.ScreenSpace; @@ -46,6 +48,8 @@ public sealed class CombatModeIndicatorsOverlay : Overlay var spriteSys = _entMan.EntitySysManager.GetEntitySystem(); _gunSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), "gun_sight")); + _gunBoltSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), + "gun_bolt_sight")); _meleeSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"), "melee_sight")); } @@ -67,12 +71,16 @@ public sealed class CombatModeIndicatorsOverlay : Overlay var handEntity = _hands.GetActiveHandEntity(); var isHandGunItem = _entMan.HasComponent(handEntity); + var isGunBolted = true; + if (_entMan.TryGetComponent(handEntity, out ChamberMagazineAmmoProviderComponent? chamber)) + isGunBolted = chamber.BoltClosed ?? true; + 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; + var sight = isHandGunItem ? (isGunBolted ? _gunSight : _gunBoltSight) : _meleeSight; DrawSight(sight, args.ScreenHandle, mousePos, limitedScale * Scale); } diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 06667857b3..45f4f2e608 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -323,7 +323,7 @@ public abstract partial class SharedGunSystem : EntitySystem { if (ev.Reason != null) { - PopupSystem.PopupClient(ev.Reason, gunUid, user); + PopupSystem.PopupCursor(ev.Reason); } // Don't spam safety sounds at gun fire rate, play it at a reduced rate. diff --git a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_bolt_sight.png b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/gun_bolt_sight.png new file mode 100644 index 0000000000000000000000000000000000000000..4badcc7d1e04bee50bb566c30cd83a3dc6912f6a GIT binary patch literal 2206 zcmV;P2x0e$P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vG?9{>O@9|3sofnNXs2s24UK~#8N?VDSu z6;&9=kLIay#{rZ1v zKz!|py1Tor??e~`BmFA={3{#}`{95L7%<>4*UD9C1K{v5F5_W1%z+VbDIA0|LFaY& zFZc!geg|xeuV2DvR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oWI6PaJKxh$-eY!;+V;^)e&c#jnYi{dbnD;Ci^k z?|Pwg7!!QWz9Xt+heSiT_x5E3|5?h2tT8#GvJRll>KsD@`2PhRQ6&wKh=%Y8>U{9D z*s!~^hF2TH=#H@l2S4Kx24wtx77gI>d`DDi1Jo;S44oCHP9xEVuXJ8Jj7lBC`K-`e gzxvg$cB`xFAD92M(wHENs{jB107*qoM6N<$f}jm39RL6T literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json index a9ef50c0dd..25fd92795e 100644 --- a/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json +++ b/Resources/Textures/Interface/Misc/crosshair_pointers.rsi/meta.json @@ -10,6 +10,9 @@ { "name": "gun_sight" }, + { + "name": "gun_bolt_sight" + }, { "name": "melee_sight" }