diff --git a/Content.Server/GameObjects/Components/Stack/StackComponent.cs b/Content.Server/GameObjects/Components/Stack/StackComponent.cs index 3d68b4c479..df8928af16 100644 --- a/Content.Server/GameObjects/Components/Stack/StackComponent.cs +++ b/Content.Server/GameObjects/Components/Stack/StackComponent.cs @@ -1,8 +1,5 @@ using Content.Shared.GameObjects.Components; -using Content.Shared.GameObjects.EntitySystems; using Robust.Shared.GameObjects; -using Robust.Shared.Localization; -using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Stack @@ -10,23 +7,9 @@ namespace Content.Server.GameObjects.Components.Stack // TODO: Naming and presentation and such could use some improvement. [RegisterComponent] [ComponentReference(typeof(SharedStackComponent))] - public class StackComponent : SharedStackComponent, IExamine + public class StackComponent : SharedStackComponent { [ViewVariables(VVAccess.ReadWrite)] public bool ThrowIndividually { get; set; } = false; - - void IExamine.Examine(FormattedMessage message, bool inDetailsRange) - { - if (inDetailsRange) - { - message.AddMarkup( - Loc.GetString( - "comp-stack-examine-detail-count", - ("count", Count), - ("markupCountColor", "lightgray") - ) - ); - } - } } } diff --git a/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs b/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs index 96a4b6ebd8..fe14354b63 100644 --- a/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs +++ b/Content.Shared/GameObjects/EntitySystems/ExamineSystemShared.cs @@ -237,6 +237,7 @@ namespace Content.Shared.GameObjects.EntitySystems { Message = message; Examiner = examiner; + IsInDetailsRange = isInDetailsRange; } } } diff --git a/Content.Shared/GameObjects/EntitySystems/SharedStackSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedStackSystem.cs index df054b0fc6..b7d622fdcc 100644 --- a/Content.Shared/GameObjects/EntitySystems/SharedStackSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/SharedStackSystem.cs @@ -1,6 +1,7 @@ using Content.Shared.GameObjects.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.Localization; namespace Content.Shared.GameObjects.EntitySystems { @@ -13,6 +14,7 @@ namespace Content.Shared.GameObjects.EntitySystems SubscribeLocalEvent(OnStackStarted); SubscribeLocalEvent(OnStackCountChange); + SubscribeLocalEvent(OnStackExamined); } private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args) @@ -56,6 +58,20 @@ namespace Content.Shared.GameObjects.EntitySystems RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count)); } + + private void OnStackExamined(EntityUid uid, SharedStackComponent component, ExaminedEvent args) + { + if (!args.IsInDetailsRange) + return; + + args.Message.AddText("\n"); + args.Message.AddMarkup( + Loc.GetString("comp-stack-examine-detail-count", + ("count", component.Count), + ("markupCountColor", "lightgray") + ) + ); + } } ///