From a66790f1581c08423293c0d6c00bc0a5d906fc91 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Tue, 10 Jan 2023 06:48:05 -0500 Subject: [PATCH] fix emitter examining (#13369) --- Content.Shared/Weapons/Ranged/Components/GunComponent.cs | 7 +++++++ .../Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs | 2 +- .../Structures/Power/Generation/Singularity/emitter.yml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs index 229b43ac84..d3e9dd1042 100644 --- a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs @@ -113,6 +113,13 @@ public class GunComponent : Component [DataField("selectModeAction")] public InstantAction? SelectModeAction; + + /// + /// Whether or not information about + /// the gun will be shown on examine. + /// + [DataField("showExamineText")] + public bool ShowExamineText = true; } [Flags] diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs index b2afc368ab..bb4ab81183 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs @@ -12,7 +12,7 @@ public abstract partial class SharedGunSystem { private void OnExamine(EntityUid uid, GunComponent component, ExaminedEvent args) { - if (!args.IsInDetailsRange) + if (!args.IsInDetailsRange || !component.ShowExamineText) return; args.PushMarkup(Loc.GetString("gun-selected-mode-examine", ("color", ModeExamineColor), ("mode", GetLocSelector(component.SelectedMode)))); diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml index 0a7bffc42a..9b3e449399 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml @@ -37,6 +37,7 @@ map: ["enum.StorageVisualLayers.Lock"] - type: Emitter - type: Gun + showExamineText: false fireRate: 10 #just has to be fast enough to keep up with upgrades selectedMode: SemiAuto availableModes: