From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Wed, 29 Mar 2023 22:36:20 +0000 (+1300) Subject: Add Missing ExamineEntry attribute (#14965) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=87b7f67bcfd6337ec2781b53442dd1a21f619096;p=space-station-14.git Add Missing ExamineEntry attribute (#14965) --- diff --git a/Content.Shared/Examine/GroupExamineComponent.cs b/Content.Shared/Examine/GroupExamineComponent.cs index 91be372bee..0bd260102f 100644 --- a/Content.Shared/Examine/GroupExamineComponent.cs +++ b/Content.Shared/Examine/GroupExamineComponent.cs @@ -73,14 +73,14 @@ namespace Content.Shared.Examine /// /// An entry used when showing examine details /// - [Serializable, NetSerializable] + [Serializable, NetSerializable, DataDefinition] public sealed class ExamineEntry { /// /// Which component does this entry relate to? /// - [DataField("component")] - public string ComponentName = string.Empty; + [DataField("component", required: true)] + public string ComponentName; /// /// What priority has this entry - entries are sorted high to low. @@ -91,8 +91,8 @@ namespace Content.Shared.Examine /// /// The FormattedMessage of this entry. /// - [DataField("message")] - public FormattedMessage Message = new(); + [DataField("message", required: true)] + public FormattedMessage Message; /// Should be set to _componentFactory.GetComponentName(component.GetType()) to properly function. public ExamineEntry(string componentName, float priority, FormattedMessage message) @@ -101,6 +101,13 @@ namespace Content.Shared.Examine Priority = priority; Message = message; } + + private ExamineEntry() + { + // parameterless ctor is required for data-definition serialization + Message = default!; + ComponentName = default!; + } } }