From 87b7f67bcfd6337ec2781b53442dd1a21f619096 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Thu, 30 Mar 2023 11:36:20 +1300 Subject: [PATCH] Add Missing ExamineEntry attribute (#14965) --- Content.Shared/Examine/GroupExamineComponent.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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!; + } } } -- 2.51.2