Random spontaneous cleanup PR (#25131)
* Use new Subs.CVar helper Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe. This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown. * Fix a bunch of warnings * More warning fixes * Use new DateTime serializer to get rid of ISerializationHooks in changelog code. * Get rid of some more ISerializationHooks for enums * And a little more * Apply suggestions from code review Co-authored-by: 0x6273 <0x40@keemail.me> --------- Co-authored-by: 0x6273 <0x40@keemail.me>
This commit is contained in:
committed by
GitHub
parent
d0c174388c
commit
68ce53ae17
@@ -1,10 +1,8 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Markdown;
|
||||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
@@ -162,7 +160,7 @@ namespace Content.Client.Changelog
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class ChangelogEntry : ISerializationHooks
|
||||
public sealed partial class ChangelogEntry
|
||||
{
|
||||
[DataField("id")]
|
||||
public int Id { get; private set; }
|
||||
@@ -170,17 +168,11 @@ namespace Content.Client.Changelog
|
||||
[DataField("author")]
|
||||
public string Author { get; private set; } = "";
|
||||
|
||||
[DataField("time")] private string _time = default!;
|
||||
|
||||
[DataField]
|
||||
public DateTime Time { get; private set; }
|
||||
|
||||
[DataField("changes")]
|
||||
public List<ChangelogChange> Changes { get; private set; } = default!;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
Time = DateTime.Parse(_time, null, DateTimeStyles.RoundtripKind);
|
||||
}
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
|
||||
Reference in New Issue
Block a user