diff --git a/Model/IWhen.cs b/Model/IWhen.cs index e5f45a8..9b48372 100644 --- a/Model/IWhen.cs +++ b/Model/IWhen.cs @@ -11,8 +11,7 @@ public interface IWhen { bool IsValid(Plugin plugin); } -public class WhenNodeDeserialiser : INodeDeserializer -{ +public class WhenNodeDeserialiser : INodeDeserializer { public bool Deserialize(IParser reader, Type expectedType, Func nestedObjectDeserializer, out object? value) { if (expectedType != typeof(IWhen)) { value = null; diff --git a/Plugin.cs b/Plugin.cs index 153e907..a879cfb 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -25,9 +25,10 @@ public class Plugin : IDalamudPlugin { private Dictionary<(string, bool), nint> ReplacementPointers { get; } = []; private SemaphoreSlim Mutex { get; } = new(1, 1); - internal static IDeserializer Deserializer { get; } = new DeserializerBuilder() + private static IDeserializer Deserializer { get; } = new DeserializerBuilder() .WithNamingConvention(UnderscoredNamingConvention.Instance) .WithNodeDeserializer(new WhenNodeDeserialiser()) + .IgnoreUnmatchedProperties() .Build(); private static class Signatures { @@ -149,5 +150,11 @@ public class Plugin : IDalamudPlugin { [Serializable] internal class DataFile { + public Definitions Definitions { get; init; } public Replacement[] Replacements { get; init; } } + +[Serializable] +public class Definitions { + public Dictionary Quests { get; init; } +} diff --git a/replacements.yaml b/replacements.yaml index 1865bcc..9a7d36e 100644 --- a/replacements.yaml +++ b/replacements.yaml @@ -1,10 +1,23 @@ +definitions: + quests: + patch2.0: &patch2.0 70058 + replacements: # Original: Just what we need. Another outsider. - id: 22 when: - quest: - id: 70058 # final msq for A Realm Reborn + id: *patch2.0 # final msq for A Realm Reborn status: complete text: |- - It's been - quiet lately. + The water here + is so peaceful. + # Original: Start any trouble, and I'll see you rot in the oubliettes for eternity. + - id: 291 + when: + - quest: + id: *patch2.0 + status: complete + text: |- + My eyes are peeled + for trouble.